update distance when removing goAheads
This commit is contained in:
parent
a2a196dca7
commit
570812f4ba
2 changed files with 5 additions and 0 deletions
|
@ -499,6 +499,7 @@ public class RouteCalculationResult {
|
|||
RouteDirectionInfo prev = directions.get(i - 1);
|
||||
prev.setAverageSpeed((prev.distance + r.distance)
|
||||
/ (prev.distance / prev.getAverageSpeed() + r.distance / r.getAverageSpeed()));
|
||||
prev.setDistance(prev.distance + r.distance);
|
||||
directions.remove(i);
|
||||
} else {
|
||||
i++;
|
||||
|
|
|
@ -102,4 +102,8 @@ public class RouteDirectionInfo {
|
|||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public int setDistance(int distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue