Skip to content

Commit

Permalink
replace deprecated call to SpeedyGraphBuilder.build in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrieser committed Dec 29, 2023
1 parent 5445445 commit 5486fa6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.IdMap;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.Node;
Expand Down Expand Up @@ -66,7 +67,7 @@ public class OneToManyPathCalculatorTest {
private final IdMap<Node, Node> nodeMap = new IdMap<>(Node.class);

private final TravelTime travelTime = new FreeSpeedTravelTime();
private final LeastCostPathTree dijkstraTree = new LeastCostPathTree(SpeedyGraphBuilder.build(network), travelTime,
private final LeastCostPathTree dijkstraTree = new LeastCostPathTree(SpeedyGraphBuilder.build(network, TransportMode.car), travelTime,
new TimeAsTravelDisutility(travelTime));

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.Node;
Expand Down Expand Up @@ -74,7 +75,7 @@ public class SpeedyMultiSourceALTBackwardTest {

private final TravelTime travelTime = new FreeSpeedTravelTime();
private final TravelDisutility travelDisutility = new TimeAsTravelDisutility(travelTime);
private final SpeedyGraph speedyGraph = SpeedyGraphBuilder.build(network);
private final SpeedyGraph speedyGraph = SpeedyGraphBuilder.build(network, TransportMode.car);
private final SpeedyALTData landmarks = new SpeedyALTData(speedyGraph, 3, travelDisutility);
private final SpeedyMultiSourceALT multiSourceALT = new SpeedyMultiSourceALT(landmarks, travelTime,
travelDisutility);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.Node;
Expand Down Expand Up @@ -72,7 +73,7 @@ public class SpeedyMultiSourceALTForwardTest {

private final TravelTime travelTime = new FreeSpeedTravelTime();
private final TravelDisutility travelDisutility = new TimeAsTravelDisutility(travelTime);
private final SpeedyGraph speedyGraph = SpeedyGraphBuilder.build(network);
private final SpeedyGraph speedyGraph = SpeedyGraphBuilder.build(network, TransportMode.car);
private final SpeedyALTData landmarks = new SpeedyALTData(speedyGraph, 3, travelDisutility);
private final SpeedyMultiSourceALT multiSourceALT = new SpeedyMultiSourceALT(landmarks, travelTime,
travelDisutility);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package org.matsim.core.router.speedy;

import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Network;
import org.matsim.core.config.groups.ScoringConfigGroup;
import org.matsim.core.router.AbstractLeastCostPathCalculatorTest;
Expand All @@ -34,7 +35,7 @@ public class SpeedyALTTest extends AbstractLeastCostPathCalculatorTest {
@Override
protected LeastCostPathCalculator getLeastCostPathCalculator(final Network network) {
FreespeedTravelTimeAndDisutility travelTimeCostCalculator = new FreespeedTravelTimeAndDisutility(new ScoringConfigGroup());
SpeedyGraph g = SpeedyGraphBuilder.build(network);
SpeedyGraph g = SpeedyGraphBuilder.build(network, TransportMode.car);
SpeedyALTData altData = new SpeedyALTData(g, 16, travelTimeCostCalculator);
return new SpeedyALT(altData, travelTimeCostCalculator, travelTimeCostCalculator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package org.matsim.core.router.speedy;

import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Network;
import org.matsim.core.config.groups.ScoringConfigGroup;
import org.matsim.core.router.AbstractLeastCostPathCalculatorTest;
Expand All @@ -34,7 +35,7 @@ public class SpeedyDijkstraTest extends AbstractLeastCostPathCalculatorTest {
@Override
protected LeastCostPathCalculator getLeastCostPathCalculator(final Network network) {
FreespeedTravelTimeAndDisutility travelTimeCostCalculator = new FreespeedTravelTimeAndDisutility(new ScoringConfigGroup());
SpeedyGraph g = SpeedyGraphBuilder.build(network);
SpeedyGraph g = SpeedyGraphBuilder.build(network, TransportMode.car);
return new SpeedyDijkstra(g, travelTimeCostCalculator, travelTimeCostCalculator);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.NetworkFactory;
Expand All @@ -23,7 +24,7 @@ void testConstruction() {
Fixture f = new Fixture();
Network network = f.network;

SpeedyGraph graph = SpeedyGraphBuilder.build(network);
SpeedyGraph graph = SpeedyGraphBuilder.build(network, TransportMode.car);

// test out-links

Expand Down

0 comments on commit 5486fa6

Please sign in to comment.