Skip to content

Commit 8c21567

Browse files
authored
Extend truck custom model (graphhopper#3117)
* Low priority private access * Low priority delivery/destination access * Check weight limit
1 parent ac75bb4 commit 8c21567

File tree

1 file changed

+6
-3
lines changed
  • core/src/main/resources/com/graphhopper/custom_models

1 file changed

+6
-3
lines changed

core/src/main/resources/com/graphhopper/custom_models/truck.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// to use this custom model you need to set the following option in the config.yml
2-
// graph.encoded_values: road_access, car_access, hgv, max_width, max_height, car_average_speed
2+
// graph.encoded_values: road_access, car_access, hgv, max_width, max_height, car_average_speed, max_weight, max_weight_except
33
// profiles:
44
// - name: truck
55
// turn_costs:
@@ -9,8 +9,11 @@
99
{
1010
"distance_influence": 1,
1111
"priority": [
12-
{ "if": "car_access == false || road_access == PRIVATE || hgv == NO", "multiply_by": "0" },
13-
{ "if": "max_width < 3 || max_height < 4", "multiply_by": "0" }
12+
{ "if": "hgv == NO", "multiply_by": "0" },
13+
{ "if": "!car_access && road_access != PRIVATE && hgv != DELIVERY && hgv != DESTINATION", "multiply_by": "0" },
14+
{ "if": "road_access == PRIVATE || hgv == DELIVERY || hgv == DESTINATION", "multiply_by": "0.1" },
15+
{ "if": "max_width < 3 || max_height < 4", "multiply_by": "0" },
16+
{ "if": "max_weight < 18 && max_weight_except == MISSING", "multiply_by": "0" }
1417
],
1518
"speed": [
1619
{ "if": "true", "limit_to": "car_average_speed * 0.9" },

0 commit comments

Comments
 (0)