From 5de0c82525e2f0dc82d1e4e549aaa404c65e9fd9 Mon Sep 17 00:00:00 2001 From: ansons Date: Wed, 8 Nov 2023 18:09:37 -0500 Subject: [PATCH] Override default tightenExpiration method --- .../fare/ChicagoRTAInRoutingFareCalculator.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/conveyal/r5/analyst/fare/ChicagoRTAInRoutingFareCalculator.java b/src/main/java/com/conveyal/r5/analyst/fare/ChicagoRTAInRoutingFareCalculator.java index 0590251dc..08b7ee66b 100644 --- a/src/main/java/com/conveyal/r5/analyst/fare/ChicagoRTAInRoutingFareCalculator.java +++ b/src/main/java/com/conveyal/r5/analyst/fare/ChicagoRTAInRoutingFareCalculator.java @@ -58,6 +58,12 @@ private CTAPaceTransferAllowance (int value, int number, int expirationTime) { this.unlimited = false; } + private CTAPaceTransferAllowance (int value, int number, int expirationTime, boolean unlimited) { + super(value, number, expirationTime); + this.unlimited = unlimited; + } + + private CTAPaceTransferAllowance (boolean unlimited) { this.unlimited = unlimited; } @@ -67,6 +73,15 @@ private CTAPaceTransferAllowance redeem (int fareToBoard) { return new CTAPaceTransferAllowance(Math.max(fareToBoard, this.value), this.number - 1, this.expirationTime); } + + @Override + public CTAPaceTransferAllowance tightenExpiration (int maxClockTime) { + // copied from TransferAllowance but need to override so that everything stays a BostonTransferAllowance + int expirationTime = Math.min(this.expirationTime, maxClockTime); + return new CTAPaceTransferAllowance(this.value, this.number, expirationTime, this.unlimited); + } + + } // For now, there are no transfer allowances to/from Metra