Skip to content

Commit

Permalink
Fix behind-gate transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
ansoncfit committed Nov 16, 2023
1 parent 2805225 commit 33b1481
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,19 @@ public FareBounds calculateFare(McRaptorSuboptimalPathProfileRouter.McRaptorStat
if (ride > 0) {
// If we have already taken a ride, check whether we can do an in-system (behind fare gate)
// transfer
int fromStopIndex = alightStops.get(ride - 1);
String fromStation = transitLayer.parentStationIdForStop.get(fromStopIndex);
if (platformsConnected(fromStopIndex, fromStation, boardStopIndex, boardStation)) {
// Transfer behind gates, no Ventra tap or change in transfer allowance
continue;
int prevPattern = patterns.get(ride - 1);
RouteInfo prevRoute =
transitLayer.routes.get(transitLayer.tripPatterns.get(prevPattern).routeIndex);
if (prevRoute.route_type == 1) {
int fromStopIndex = alightStops.get(ride - 1);
String fromStation = transitLayer.parentStationIdForStop.get(fromStopIndex);
if (platformsConnected(fromStopIndex, fromStation, boardStopIndex, boardStation)) {
// Transfer behind gates, no Ventra tap or change in transfer allowance
break;
}
}
}
else {
fareToPay = CTA_L_FARE;
}
fareToPay = CTA_L_FARE;
}
else fareToPay = CTA_BUS_FARE;
}
Expand Down

0 comments on commit 33b1481

Please sign in to comment.