Skip to content

Commit

Permalink
Merge pull request #60 from naviqore/NAV-95-Raptor-not-handling-two-w…
Browse files Browse the repository at this point in the history
…alk-transfers-in-sequence-correctly

Nav 95 raptor not handling two walk transfers in sequence correctly
  • Loading branch information
munterfi authored Jun 12, 2024
2 parents 3d2ba3c + e2cde79 commit 056a873
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public ServiceConfigParser(@Value("${gtfs.static.url}") String gtfsUrl,
@Value("${transfer.time.minimum:120}") int minimumTransferTime,
@Value("${transfer.defaultSameStationTransferTime:120}") int sameStationTransferTime,
@Value("${walking.distance.maximum:500}") int maxWalkingDistance,
@Value("${walking.speed:3500}") int walkingSpeed,
@Value("${walking.speed:2500}") int walkingSpeed,
@Value("${walking.calculator.type:BEE_LINE_DISTANCE}") String walkCalculatorTypeStr) {
ServiceConfig.WalkCalculatorType walkCalculatorType = ServiceConfig.WalkCalculatorType.valueOf(
walkCalculatorTypeStr.toUpperCase());
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/ch/naviqore/raptor/Raptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,14 @@ private void expandFootpathsFromStop(int stopIdx, int[] earliestArrivals, List<L
return;
}
Stop sourceStop = stops[stopIdx];
int arrivalTime = earliestArrivals[stopIdx];
Leg previousLeg = earliestArrivalsPerRound.get(round)[stopIdx];

// do not relax footpath from stop that was only reached by footpath in the same round
if (previousLeg == null || previousLeg.type == ArrivalType.TRANSFER) {
return;
}

int arrivalTime = previousLeg.arrivalTime();

for (int i = sourceStop.transferIdx(); i < sourceStop.transferIdx() + sourceStop.numberOfTransfers(); i++) {
Transfer transfer = transfers[i];
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ gtfs.static.update.interval.hours=${GTFS_STATIC_UPDATE_INTERVAL:24}
transfer.time.minimum=${TRANSFER_TIME_MINIMUM:120}
# walking
walking.calculator.type=${WALKING_CALCULATOR_TYPE:BEE_LINE_DISTANCE}
walking.speed=${WALKING_SPEED:3500}
walking.speed=${WALKING_SPEED:2500}
walking.distance.maximum=${WALKING_DISTANCE_MAXIMUM:500}

0 comments on commit 056a873

Please sign in to comment.