Skip to content

Instantly share code, notes, and snippets.

@karussell karussell/truck.yml

Created Feb 13, 2020
Embed
What would you like to do?
# Specify a vehicle (FlagEncoder) or another custom profile like
base: car
# in meter
vehicle_height: 3.8
vehicle_width: 2.5
# in tons
vehicle_weight: 4.5
# The formula is defined in CustomWeighting, where the speed_factor can be used to increase and decrease speed.
# If the value is higher than 1 the other values will be divided by this value to make the underlying routing
# algorithm work (normalization) and still have the same effect. And if two conditions are satisfied the values are
# multiplied e.g. if road_class==motorway and road_environment==tunnel, then the resulting speed is
# average_speed*0.85*0.9. The minimum value is 0.
speed_factor:
road_environment:
tunnel: 0.85
# trucks should be a bit slower on certain road classes compared to the 'base' car
# a more compact JSON-way to list the properties, fully YAML-compatible:
road_class: { motorway: 0.85, primary: 0.9 }
# You can lower the average speed for certain conditions via the max_speed map. The speed_factor is applied before
# this operation. See the following example that sets the maximum speed to 95km/h for motorways.
max_speed:
road_class:
motorway: 95
residential: 30
road_environment:
bridge: 85
# Trucks are slower so limit all speed to this value. In km/h
# If none of the conditions in the map above apply use the fallback, if specified:
max_speed_fallback: 100
# The distance term changes the influence of the distance. I.e. longer roads get a higher cost.
# The distance_factor_constant is independent of the edge properties and does not influence the ETA.
distance_term_constant: 0.07
# Now we want to set a preference without changing the taken time. I.e. trucks shall prefer bigger roads and so we could
# increase the speed for them, but this influences time. The default priority 1 won't change something.
# Higher than 1 will prefer the road under the specified condition and lower than 1 will avoid it.
# If the value is higher than 1 the other values will be divided by this value to make the underlying routing algorithm
# work (normalization) and still have the same effect. And if two conditions are met the values will be multiplied.
# The minimum value is 0.
priority:
road_class:
motorway: 1.1
residential: 0.5
# cars allow tracks so we should block them here, but in the example in CustomWeightingRouteResourceTest the bridge is only accessible through a track
# track: 0
# let's assume we transport gas: so NEVER go on restricted roads with hazmat==no
hazmat: { no: 0 }
# avoid destination-only roads
# TODO include private and delivery only access for base car profile so that we can avoid it here, but not exclude it
road_access: { destination: 0.1 }
# avoid turns if possible and links are one simple indication for that
road_class_link: 0.5
# avoid toll roads
toll: { no: 2 }
# avoid a certain area
area_custom1: 0.5
areas:
custom1:
type: "Feature"
geometry: { type: "Polygon", coordinates: [[[13.722, 51.053], [13.722, 51.055], [13.731, 51.055], [13.731, 51.053], [13.722, 51.053]]] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.