Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void allowOTPFeaturesToBeConfigurableFromJSON() {
{
otpFeatures : {
APIBikeRental : false,
MinimumTransferTimeIsDefinitive : true
FaresV2 : true
}
}
""";
Expand All @@ -67,7 +67,7 @@ public void allowOTPFeaturesToBeConfigurableFromJSON() {

// Then
assertTrue(OTPFeature.APIBikeRental.isOff());
assertTrue(OTPFeature.MinimumTransferTimeIsDefinitive.isOn());
assertTrue(OTPFeature.FaresV2.isOn());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ConstrainedTransfer> constraints,
Expand Down
1 change: 0 additions & 1 deletion doc/user/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | ✓️ | |
Expand Down
Loading