Skip to content

Commit

Permalink
add simpler turn restriction test case
Browse files Browse the repository at this point in the history
  • Loading branch information
paulheinr committed Sep 24, 2024
1 parent 0c13c74 commit 473aeb7
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ void testCalcLeastCostPath_TurnRestrictions_IntermediateNode() {
Assertions.assertNotNull(path);
}

@Test
void testCalcLeastCostPath_TurnRestrictions_simple() {
Network network = createTurnRestrictionsTestNetwork();

Node nodeS = network.getNodes().get(Id.create("S", Node.class));
Node node1 = network.getNodes().get(Id.create("1", Node.class));

LeastCostPathCalculator routerAlgo = getLeastCostPathCalculator(network);
Path path = routerAlgo.calcLeastCostPath(nodeS, node1, 8.0 * 3600, null, null);
Assertions.assertNotNull(path);
}

@Test
void testCalcLeastCostPath_noTurnRestrictions_simple() {
Network network = createTurnRestrictionsTestNetwork();

Node nodeS = network.getNodes().get(Id.create("5", Node.class));
Node node1 = network.getNodes().get(Id.create("T", Node.class));

LeastCostPathCalculator routerAlgo = getLeastCostPathCalculator(network);
Path path = routerAlgo.calcLeastCostPath(nodeS, node1, 8.0 * 3600, null, null);
Assertions.assertNotNull(path);
}

//@formatter:off
/**
* Creates a test network where the shortest path is impossible due to turn restrictions
Expand Down

0 comments on commit 473aeb7

Please sign in to comment.