Fix smart recalculation problem
This commit is contained in:
parent
33f19e7a95
commit
2d47028aca
2 changed files with 8 additions and 3 deletions
|
@ -746,8 +746,10 @@ public class BinaryRoutePlanner {
|
|||
RouteSegmentResult res = new RouteSegmentResult(segment.road, parentSegmentStart, segment.segmentStart);
|
||||
parentSegmentStart = segment.parentSegmentEnd;
|
||||
segment = segment.parentRoute;
|
||||
if(res.getStartPointIndex() != res.getEndPointIndex()) {
|
||||
result.add(res);
|
||||
}
|
||||
}
|
||||
Collections.reverse(result);
|
||||
|
||||
segment = ctx.finalDirectRoute;
|
||||
|
@ -756,8 +758,11 @@ public class BinaryRoutePlanner {
|
|||
RouteSegmentResult res = new RouteSegmentResult(segment.road, segment.segmentStart, parentSegmentEnd);
|
||||
parentSegmentEnd = segment.parentSegmentEnd;
|
||||
segment = segment.parentRoute;
|
||||
// happens in smart recalculation
|
||||
if(res.getStartPointIndex() != res.getEndPointIndex()) {
|
||||
result.add(res);
|
||||
}
|
||||
}
|
||||
Collections.reverse(result);
|
||||
|
||||
// calculate time
|
||||
|
|
|
@ -279,7 +279,7 @@ public class RoutingHelper {
|
|||
// if we are still too far try to proceed many points
|
||||
// if not then look ahead only 3 in order to catch sharp turns
|
||||
boolean longDistance = dist >= 250;
|
||||
int newCurrentRoute = lookAheadFindMinOrthogonalDistance(currentLocation, routeNodes, currentRoute, longDistance ? 10 : 3);
|
||||
int newCurrentRoute = lookAheadFindMinOrthogonalDistance(currentLocation, routeNodes, currentRoute, longDistance ? 15 : 8);
|
||||
double newDist = getOrthogonalDistance(currentLocation, routeNodes.get(newCurrentRoute),
|
||||
routeNodes.get(newCurrentRoute + 1));
|
||||
if(longDistance) {
|
||||
|
|
Loading…
Reference in a new issue