Skip to content

Commit 31a621b

Browse files
committed
Fix: Make pass-trough override transit-group-priority
1 parent 77c8307 commit 31a621b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/RaptorRequestMapper.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,14 @@ private RaptorRequest<TripSchedule> doMap() {
119119
builder.withMultiCriteria(mcBuilder -> {
120120
var pt = preferences.transit();
121121
var r = pt.raptor();
122-
if (!pt.relaxTransitGroupPriority().isNormal()) {
123-
mcBuilder.withTransitPriorityCalculator(TransitGroupPriority32n.priorityCalculator());
124-
mcBuilder.withRelaxC1(mapRelaxCost(pt.relaxTransitGroupPriority()));
125-
} else {
122+
123+
// Note! If a pass-through-point exists, then the transit-group-priority feature is disabled
124+
if (!request.getPassThroughPoints().isEmpty()) {
126125
mcBuilder.withPassThroughPoints(mapPassThroughPoints());
127126
r.relaxGeneralizedCostAtDestination().ifPresent(mcBuilder::withRelaxCostAtDestination);
127+
} else if (!pt.relaxTransitGroupPriority().isNormal()) {
128+
mcBuilder.withTransitPriorityCalculator(TransitGroupPriority32n.priorityCalculator());
129+
mcBuilder.withRelaxC1(mapRelaxCost(pt.relaxTransitGroupPriority()));
128130
}
129131
});
130132

0 commit comments

Comments
 (0)