diff --git a/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java b/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java index 6631287613b..897b9ef7cb6 100644 --- a/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java +++ b/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java @@ -55,21 +55,6 @@ public enum OTPFeature { false, "Does vehicleRentalStation query also allow ids that are not feed scoped." ), - /** - * If this feature flag is switched on, then the minimum transfer time is not the minimum transfer - * time, but the definitive transfer time. Use this to override what we think the transfer will - * take according to OSM data, for example if you want to set a very low transfer time like 1 - * minute, when walking the distance take 1m30s. - * - * TODO Harmonize the JavaDoc with the user doc and delete JavaDoc - */ - MinimumTransferTimeIsDefinitive( - false, - false, - "If the minimum transfer time is a lower bound (default) or the definitive time for the " + - "transfer. Set this to `true` if you want to set a transfer time lower than what OTP derives " + - "from OSM data." - ), OptimizeTransfers( true, diff --git a/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java b/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java index e6509c7d8ca..7f0e9f5aac1 100644 --- a/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java +++ b/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java @@ -9,7 +9,6 @@ import java.util.Objects; import java.util.function.IntSupplier; import javax.annotation.Nullable; -import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.utils.tostring.ToStringBuilder; @@ -225,14 +224,10 @@ public int calculateTransferTargetTime( int minTransferTime = getMinTransferTime() + transferSlack; if (direction.isForward()) { int minTransferBoardTime = sourceTransitArrivalTime + minTransferTime; - return OTPFeature.MinimumTransferTimeIsDefinitive.isOn() - ? minTransferBoardTime - : Math.max(minTransferBoardTime, calcRegularTransferTargetTime.getAsInt()); + return Math.max(minTransferBoardTime, calcRegularTransferTargetTime.getAsInt()); } else { int minTransferBoardTime = sourceTransitArrivalTime - minTransferTime; - return OTPFeature.MinimumTransferTimeIsDefinitive.isOn() - ? minTransferBoardTime - : Math.min(minTransferBoardTime, calcRegularTransferTargetTime.getAsInt()); + return Math.min(minTransferBoardTime, calcRegularTransferTargetTime.getAsInt()); } } // Transfers with priority only apply to the cost not the transfer time diff --git a/application/src/test/java/org/opentripplanner/framework/application/OTPFeatureTest.java b/application/src/test/java/org/opentripplanner/framework/application/OTPFeatureTest.java index 0f814b302d7..903ac559cd8 100644 --- a/application/src/test/java/org/opentripplanner/framework/application/OTPFeatureTest.java +++ b/application/src/test/java/org/opentripplanner/framework/application/OTPFeatureTest.java @@ -55,7 +55,7 @@ public void allowOTPFeaturesToBeConfigurableFromJSON() { { otpFeatures : { APIBikeRental : false, - MinimumTransferTimeIsDefinitive : true + FaresV2 : true } } """; @@ -67,7 +67,7 @@ public void allowOTPFeaturesToBeConfigurableFromJSON() { // Then assertTrue(OTPFeature.APIBikeRental.isOff()); - assertTrue(OTPFeature.MinimumTransferTimeIsDefinitive.isOn()); + assertTrue(OTPFeature.FaresV2.isOn()); } @Test diff --git a/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java b/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java index 47ff414790e..545f0975eec 100644 --- a/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java +++ b/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java @@ -3,7 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.application.OTPFeature.MinimumTransferTimeIsDefinitive; import static org.opentripplanner.model.transfer.TransferPriority.ALLOWED; import static org.opentripplanner.raptor.api.model.SearchDirection.FORWARD; import static org.opentripplanner.raptor.api.model.SearchDirection.REVERSE; @@ -150,15 +149,8 @@ public void calculateConstrainedTransferTargetTimeForwardSearch() { assertEquals(t0, GUARANTEED.calculateTransferTargetTime(t0, dt, txMinusOp, FORWARD)); assertEquals(t0, STAY_SEATED.calculateTransferTargetTime(t0, dt, txMinusOp, FORWARD)); assertEquals(t0, EVERYTHING.calculateTransferTargetTime(t0, dt, txMinusOp, FORWARD)); - - MinimumTransferTimeIsDefinitive.testOn(() -> { - assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txMinusOp, FORWARD)); - assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txPlusOp, FORWARD)); - }); - MinimumTransferTimeIsDefinitive.testOff(() -> { - assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txMinusOp, FORWARD)); - assertEquals(txPlus, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txPlusOp, FORWARD)); - }); + assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txMinusOp, FORWARD)); + assertEquals(txPlus, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txPlusOp, FORWARD)); } @Test @@ -181,14 +173,7 @@ public void calculateConstrainedTransferTargetTimeReverseSearch() { assertEquals(t0, GUARANTEED.calculateTransferTargetTime(t0, dt, txMinusOp, REVERSE)); assertEquals(t0, STAY_SEATED.calculateTransferTargetTime(t0, dt, txMinusOp, REVERSE)); assertEquals(t0, EVERYTHING.calculateTransferTargetTime(t0, dt, txMinusOp, REVERSE)); - - MinimumTransferTimeIsDefinitive.testOn(() -> { - assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txMinusOp, REVERSE)); - assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txPlusOp, REVERSE)); - }); - MinimumTransferTimeIsDefinitive.testOff(() -> { - assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txMinusOp, REVERSE)); - assertEquals(txPlus, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txPlusOp, REVERSE)); - }); + assertEquals(expAt, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txMinusOp, REVERSE)); + assertEquals(txPlus, MIN_TX_TIME.calculateTransferTargetTime(t0, dt, txPlusOp, REVERSE)); } } diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedBoardingSearchTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedBoardingSearchTest.java index 80ec5de7ed4..282afd61c9f 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedBoardingSearchTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedBoardingSearchTest.java @@ -15,7 +15,6 @@ import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.model.transfer.RouteStationTransferPoint; import org.opentripplanner.model.transfer.RouteStopTransferPoint; @@ -321,28 +320,6 @@ void findMinimumTimeTransfer() { ); } - @Test - void findDefinitiveMinTimeTransfer() { - OTPFeature.MinimumTransferTimeIsDefinitive.testOn(() -> { - // we set a very low minimum transfer time of 0 seconds. we expect this to work similar - // to a guaranteed transfer and hence it has the same expectation. - var txMinTransferTime = new ConstrainedTransfer( - ID, - STOP_B_TX_POINT, - STOP_B_TX_POINT, - MIN_TRANSFER_TIME_0_MIN_CONSTRAINT - ); - - testTransferSearch( - STOP_B, - List.of(txMinTransferTime), - TRIP_1_INDEX, - TRIP_2_INDEX, - MIN_TRANSFER_TIME_0_MIN_CONSTRAINT - ); - }); - } - void testTransferSearch( RegularStop transferStop, List constraints, diff --git a/doc/user/Configuration.md b/doc/user/Configuration.md index f80966b8cb3..5a7392ba45a 100644 --- a/doc/user/Configuration.md +++ b/doc/user/Configuration.md @@ -231,7 +231,6 @@ Here is a list of all features which can be toggled on/off and their default val | `FloatingBike` | Enable floating bike routing. | ✓️ | | | `GtfsGraphQlApi` | Enable the [GTFS GraphQL API](apis/GTFS-GraphQL-API.md). | ✓️ | | | `GtfsGraphQlApiRentalStationFuzzyMatching` | Does vehicleRentalStation query also allow ids that are not feed scoped. | | | -| `MinimumTransferTimeIsDefinitive` | If the minimum transfer time is a lower bound (default) or the definitive time for the transfer. Set this to `true` if you want to set a transfer time lower than what OTP derives from OSM data. | | | | `OptimizeTransfers` | OTP will inspect all itineraries found and optimize where (which stops) the transfer will happen. Waiting time, priority and guaranteed transfers are taken into account. | ✓️ | | | `ParallelRouting` | Enable performing parts of the trip planning in parallel. | | | | `TransferConstraints` | Enforce transfers to happen according to the _transfers.txt_ (GTFS) and Interchanges (NeTEx). Turning this _off_ will increase the routing performance a little. | ✓️ | |