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);
|
RouteDirectionInfo prev = directions.get(i - 1);
|
||||||
prev.setAverageSpeed((prev.distance + r.distance)
|
prev.setAverageSpeed((prev.distance + r.distance)
|
||||||
/ (prev.distance / prev.getAverageSpeed() + r.distance / r.getAverageSpeed()));
|
/ (prev.distance / prev.getAverageSpeed() + r.distance / r.getAverageSpeed()));
|
||||||
|
prev.setDistance(prev.distance + r.distance);
|
||||||
directions.remove(i);
|
directions.remove(i);
|
||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -102,4 +102,8 @@ public class RouteDirectionInfo {
|
||||||
public int getDistance() {
|
public int getDistance() {
|
||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int setDistance(int distance) {
|
||||||
|
this.distance = distance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue