fixed bug in traffic simulation

This commit is contained in:
Arndt 2016-12-11 19:32:05 +01:00
parent b90e487fc0
commit dd07a1bf57

View file

@ -806,6 +806,7 @@ public class RoutingEngine extends Thread
} }
} }
OsmPath path = null; OsmPath path = null;
synchronized( openSet ) synchronized( openSet )
{ {
path = openSet.popLowestKeyValue(); path = openSet.popLowestKeyValue();
@ -892,6 +893,7 @@ public class RoutingEngine extends Thread
} }
} }
int keepPathAirdistance = path.airdistance;
OsmLinkHolder firstLinkHolder = currentLink.getFirstLinkHolder( sourceNode ); OsmLinkHolder firstLinkHolder = currentLink.getFirstLinkHolder( sourceNode );
for( OsmLinkHolder linkHolder = firstLinkHolder; linkHolder != null; linkHolder = linkHolder.getNextForLink() ) for( OsmLinkHolder linkHolder = firstLinkHolder; linkHolder != null; linkHolder = linkHolder.getNextForLink() )
{ {
@ -992,7 +994,7 @@ public class RoutingEngine extends Thread
{ {
boolean trafficSim = endPos == null; boolean trafficSim = endPos == null;
bestPath.airdistance = trafficSim ? path.airdistance : ( isFinalLink ? 0 : nextNode.calcDistance( endPos ) ); bestPath.airdistance = trafficSim ? keepPathAirdistance : ( isFinalLink ? 0 : nextNode.calcDistance( endPos ) );
boolean inRadius = boundary == null || boundary.isInBoundary( nextNode, bestPath.cost ); boolean inRadius = boundary == null || boundary.isInBoundary( nextNode, bestPath.cost );