You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some tests in OSRM make turn penalties updates with negative value. This introduces incorrect behavior in snapping start points and may lead to quite non-obvious problems like #3647 and #3641.
Practically, negative turn penalties would make turns more preferable instead of going straight with 0 turn penalty. This can be achieved also by using a positive bias value and making all turn weight penalties positive. Duration values are not used as key values in heaps and can be negative.
clarify domain of turn penalties
review tests features/car/traffic_turn_penalties.feature and features/testbot/traffic_turn_penalties.feature
I think that we should allow for negative turn penalty values.
Consider a simple intersection where most of the traffic is not taking the straight maneuver - 25% of the traffic volume goes straight, 75% makes the right-hand turn:
Let's say we have samples of all cars passing the "Average speed" measurement point. It's likely that the average speed is biased towards cars making the turning maneuver.
In this case, it would make sense for the 25% straight through traffic to receive a "negative turn penalty" - it's faster than average to proceed straight.
Of course, the validity of this idea depends on these biases existing. If the speed approaching the intersection is the average of the vehicles making the fastest maneuver, then all penalties can be positive for the same effect, and the fastest maneuver would have a penalty of 0.
Some tests in OSRM make turn penalties updates with negative value. This introduces incorrect behavior in snapping start points and may lead to quite non-obvious problems like #3647 and #3641.
Practically, negative turn penalties would make turns more preferable instead of going straight with 0 turn penalty. This can be achieved also by using a positive bias value and making all turn weight penalties positive. Duration values are not used as key values in heaps and can be negative.
osrm-backend/src/contractor/contractor.cpp
Lines 832 to 841 in 005124f
osrm-backend/src/contractor/contractor.cpp
Lines 460 to 467 in 005124f
osrm-backend/src/engine/routing_algorithms/routing_base.cpp
Line 112 in 005124f
to_weight >= 0
/cc @danpat
The text was updated successfully, but these errors were encountered: