Skip to content

Commit 6c469c7

Browse files
committed
Ensure less walking wins when two paths have equal weight
1 parent 392dfc6 commit 6c469c7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/MultiCriteriaLabelSetting.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ public MultiCriteriaLabelSetting(GraphExplorer explorer, PtFlagEncoder flagEncod
7474

7575
queueComparator = Comparator
7676
.comparingLong(this::weight)
77-
.thenComparingLong(l1 -> l1.nTransfers)
77+
.thenComparingLong(l -> l.nTransfers)
78+
.thenComparingLong(l -> l.walkTime)
7879
.thenComparingLong(l -> departureTimeCriterion(l) != null ? departureTimeCriterion(l) : 0)
79-
.thenComparingLong(l2 -> l2.impossible ? 1 : 0);
80+
.thenComparingLong(l -> l.impossible ? 1 : 0);
8081
fromHeap = new PriorityQueue<>(queueComparator);
8182
fromMap = new IntObjectHashMap<>();
8283
}

0 commit comments

Comments
 (0)