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
{{ message }}
Repository navigation
RuntimeException: Time was negative, only if turn costs enabled #991
There is a bug that includes the turn time of 'infinity' (gets converted into negative when adding a bit), and it happens even if we consider turn restrictions in the routing: point=49.034281%2C1.549737&point=49.032909%2C1.560327&point=49.033029%2C1.563374&ch.disable=true&edge_based=true
but not if we import without turn restrictions.
java.lang.RuntimeException: Time was negative -9223372036854376553 for index 0. Please report as bug and include:49.034281,1.549737; 49.032909,1.560327; 49.033029,1.563374()
at com.graphhopper.routing.template.ViaRoutingTemplate.calcPaths(ViaRoutingTemplate.java:123)
at com.graphhopper.GraphHopper.calcPaths(GraphHopper.java:1044)
at com.graphhopper.GraphHopper.route(GraphHopper.java:934)
In TurnWeighting instead of returning the sum, we should check and return infinity like we do in FastestWeighting:
if (turnCosts"too high") returnDouble.POSITIVE_INFINITY;
But as we do this in calcTurnWeight this shouldn't be necessary in calcMillis.
The real reason seems to be that we wongly handle u-turns in the QueryGraph. Here the start location A is at a way X-Y where u-turns are forbidden:
X----Y => with query at A => X--A--Y
Somehow the 'turn' Y->A to A->X returns restriction==false but "turn time"==infinity
The order was exactly opposite: we passed the next edge. Now we've fixed this for (bidir.) Path. Will close here if CH performance is not affected. Nice situation where a test case uncovered many more problems, e.g. not just bidirectional path but also the unidirectional version.
Activity
karussell commentedon Mar 20, 2017
This is highly likely related to #393 where we incorrectly passed the prevEdgeId for the reverse case.
important bug fixes to correctly calculate turn costs for final path, #…
karussell commentedon Mar 20, 2017
The order was exactly opposite: we passed the next edge. Now we've fixed this for (bidir.) Path. Will close here if CH performance is not affected. Nice situation where a test case uncovered many more problems, e.g. not just bidirectional path but also the unidirectional version.