Merge pull request #10934 from osmandapp/T10736

T10736
This commit is contained in:
vshcherb 2021-02-19 17:42:12 +02:00 committed by GitHub
commit face01f6b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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) {