Fix calculation bug
This commit is contained in:
parent
ea58ea9484
commit
007cf661a9
1 changed files with 6 additions and 4 deletions
|
@ -190,13 +190,15 @@ public class BinaryRoutePlannerOld {
|
|||
if(ctx.calculationProgress != null) {
|
||||
ctx.calculationProgress.reverseSegmentQueueSize = graphReverseSegments.size();
|
||||
ctx.calculationProgress.directSegmentQueueSize = graphDirectSegments.size();
|
||||
if(graphDirectSegments.size() > 0) {
|
||||
RouteSegment dirPeek = graphDirectSegments.peek();
|
||||
if(dirPeek != null) {
|
||||
ctx.calculationProgress.distanceFromBegin =
|
||||
Math.max(graphDirectSegments.peek().distanceFromStart, ctx.calculationProgress.distanceFromBegin);
|
||||
Math.max(dirPeek.distanceFromStart, ctx.calculationProgress.distanceFromBegin);
|
||||
}
|
||||
if(graphDirectSegments.size() > 0) {
|
||||
RouteSegment revPeek = graphReverseSegments.peek();
|
||||
if(revPeek != null) {
|
||||
ctx.calculationProgress.distanceFromEnd =
|
||||
Math.max(graphReverseSegments.peek().distanceFromStart, ctx.calculationProgress.distanceFromBegin);
|
||||
Math.max(revPeek.distanceFromStart, ctx.calculationProgress.distanceFromEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue