Skip to content

Commit

Permalink
TEST: #181 - Add test for delayed intitial transfer relaxation.
Browse files Browse the repository at this point in the history
  • Loading branch information
clukas1 committed Feb 5, 2025
1 parent 65f367d commit a6ff697
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ void connectBetweenStops_withoutInitialFootpathRelaxation(RaptorRouterTestBuilde
assertEquals(1, connection.getRouteLegs().size());
assertEquals(0, connection.getWalkTransfers().size());
}

@Test
void connectBetweenStops_withoutInitialFootpathRelaxationOnlyByTransfer(RaptorRouterTestBuilder builder) {
RaptorAlgorithm router = TransferBehaviorHelpers.prepareRouter(builder, 5, 30);
QueryConfig config = new QueryConfig();
config.setDoInitialTransferRelaxation(false);

// ensure that no routes are active anymore
LocalDateTime startTime = LocalDateTime.of(2000, 1, 1, DAY_END_HOUR + 1, 0);

List<Connection> connections = TransferBehaviorHelpers.routeBetweenStops(router, "A", "B", startTime, config);

// even though initial transfer relaxation is turned off, in round 1 transfer relaxation should be performed
// from source stops (after no faster route trips were found!).
assertEquals(1, connections.size());
Connection connection = connections.getFirst();
assertEquals(0, connection.getRouteLegs().size());
assertEquals(1, connection.getWalkTransfers().size());
}
}

static class TransferBehaviorHelpers {
Expand Down

0 comments on commit a6ff697

Please sign in to comment.