fix 10736

This commit is contained in:
Kseniia 2021-02-18 18:46:32 +02:00
parent 2ca1303cf3
commit c28d6d75a9

View file

@ -620,9 +620,7 @@ public class GeneralRouter implements VehicleRouter {
public double calculateTurnTime(RouteSegment segment, int segmentEnd, RouteSegment prev, int prevSegmentEnd) { public double calculateTurnTime(RouteSegment segment, int segmentEnd, RouteSegment prev, int prevSegmentEnd) {
float ts = getPenaltyTransition(segment.getRoad()); float ts = getPenaltyTransition(segment.getRoad());
float prevTs = getPenaltyTransition(prev.getRoad()); float prevTs = getPenaltyTransition(prev.getRoad());
float totalPenalty = 0; float totalPenalty = 0;
if (prevTs != ts) { if (prevTs != ts) {
totalPenalty += Math.abs(ts - prevTs) / 2; totalPenalty += Math.abs(ts - prevTs) / 2;
} }
@ -638,7 +636,9 @@ public class GeneralRouter implements VehicleRouter {
// } // }
// } // }
// } // }
if (shortestRoute) {
return totalPenalty;
}
if(segment.getRoad().roundabout() && !prev.getRoad().roundabout()) { if(segment.getRoad().roundabout() && !prev.getRoad().roundabout()) {
double rt = getRoundaboutTurn(); double rt = getRoundaboutTurn();
if(rt > 0) { if(rt > 0) {
@ -652,7 +652,7 @@ public class GeneralRouter implements VehicleRouter {
// more like UT // more like UT
if (diff > 2 * Math.PI / 3) { if (diff > 2 * Math.PI / 3) {
totalPenalty += getLeftTurn(); totalPenalty += getLeftTurn();
} else if (diff > Math.PI / 2.1) { } else if (diff > Math.PI / 3) {
totalPenalty += getRightTurn(); totalPenalty += getRightTurn();
} }
} }