Skip to content

Commit

Permalink
fix tests after switching to SwissRailRaptor
Browse files Browse the repository at this point in the history
  • Loading branch information
mrieser committed Oct 12, 2023
1 parent 7a80a68 commit c3309e9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public void install() {

controller.run();

assertEquals(42395, (int) listener.counts.get("pt"));
assertEquals(132284, (int) listener.counts.get("car"));
assertEquals(78809, (int) listener.counts.get("walk"));
assertEquals(44196, (int) listener.counts.get("pt"));
assertEquals(132316, (int) listener.counts.get("car"));
assertEquals(82140, (int) listener.counts.get("walk"));
// assertEquals(42520, (int) listener.counts.get("pt"));
// assertEquals(132100, (int) listener.counts.get("car"));
// assertEquals(79106, (int) listener.counts.get("walk"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public final void testSubsidyPControler() {
new TabularFileParser().parse(tabFileParserConfig, this);

// Check final iteration
Assert.assertEquals("Number of budget (final iteration)", "202319997.4909444700", this.pStatsResults.get(2)[9]);
Assert.assertEquals("Number of budget (final iteration)", "174413625.6239444000", this.pStatsResults.get(2)[9]);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,16 @@ public void testAgentLeavesStop() {
double travelTime = arrivalTimes.get(person.getId()) - activityEndTime;
List<String> trip = trips.get(person.getId());

assertEquals("Travel time has changed", 2990.0, travelTime, MatsimTestUtils.EPSILON);
assertEquals("Number of trip elements has changed", 11 ,trip.size());
assertEquals("Travel time has changed", 1344.0, travelTime, MatsimTestUtils.EPSILON);
assertEquals("Number of trip elements has changed", 7 ,trip.size());

assertEquals("Trip element has changed", "dummy@car_17bOut", trip.get(0));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(1));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(2));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(3));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(4));
assertEquals("Trip element has changed", "pt interaction@pt7", trip.get(5));
assertEquals("Trip element has changed", "pt interaction@pt7", trip.get(6));
assertEquals("Trip element has changed", "tr_334", trip.get(7));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(8));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(9));
assertEquals("Trip element has changed", "dummy@work0", trip.get(10));
assertEquals("Trip element has changed", "tr_333", trip.get(3));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(4));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(5));
assertEquals("Trip element has changed", "dummy@work0", trip.get(6));

}

Expand Down Expand Up @@ -294,8 +290,8 @@ public void testAgentIsAtTeleportLegAndLeavesStop() {
assertEquals("Trip element has changed", "dummy@car_17bOut", trip.get(0));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(1));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(2));
assertEquals("Trip element has changed", "pt interaction@pt7", trip.get(3));
assertEquals("Trip element has changed", "pt interaction@pt7", trip.get(4));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(3));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(4));
assertEquals("Trip element has changed", "tr_334", trip.get(5));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(6));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(7));
Expand Down Expand Up @@ -372,8 +368,8 @@ public void testAgentIsAtTeleportLegAndWaitsAtStop() {
assertEquals("Trip element has changed", "dummy@car_17bOut", trip.get(0));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(1));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(2));
assertEquals("Trip element has changed", "pt interaction@pt7", trip.get(3));
assertEquals("Trip element has changed", "pt interaction@pt7", trip.get(4));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(3));
assertEquals("Trip element has changed", "pt interaction@pt6c", trip.get(4));
assertEquals("Trip element has changed", "tr_334", trip.get(5));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(6));
assertEquals("Trip element has changed", "pt interaction@pt8", trip.get(7));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public static Object[] testParameters() {
@Test
public void test_PtScoringLineswitch() {
Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("pt-simple-lineswitch"), "config.xml"));
config.transit().setRoutingAlgorithmType(TransitRoutingAlgorithmType.DijkstraBased);
ScoringConfigGroup pcs = config.scoring() ;

if(this.typicalDurationScoreComputation.equals(TypicalDurationScoreComputation.uniform)){
Expand Down Expand Up @@ -219,7 +218,6 @@ public void test_PtScoringLineswitch() {
@Test
public void test_PtScoringLineswitchAndPtConstant() {
Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("pt-simple-lineswitch"), "config.xml"));
config.transit().setRoutingAlgorithmType(TransitRoutingAlgorithmType.DijkstraBased);
ScoringConfigGroup pcs = config.scoring() ;

if(this.typicalDurationScoreComputation.equals(TypicalDurationScoreComputation.uniform))
Expand Down Expand Up @@ -375,7 +373,6 @@ public void test_PtScoringLineswitchAndPtConstant() {
@Test
public void test_PtScoring_Wait() {
Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("pt-simple"), "config.xml"));
config.transit().setRoutingAlgorithmType(TransitRoutingAlgorithmType.DijkstraBased);
ScoringConfigGroup pcs = config.scoring();

if(this.typicalDurationScoreComputation.equals(TypicalDurationScoreComputation.uniform)){
Expand Down Expand Up @@ -462,7 +459,6 @@ public void test_PtScoring_Wait() {
@Test
public void test_PtScoring() {
Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("pt-simple"), "config.xml"));
config.transit().setRoutingAlgorithmType(TransitRoutingAlgorithmType.DijkstraBased);
ScoringConfigGroup pcs = config.scoring() ;

if(this.typicalDurationScoreComputation.equals(TypicalDurationScoreComputation.uniform))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public void testWithControlerAndAttributes() {
config.transit().setTransitScheduleFile( withAttributes );
config.transit().setUseTransit( true );
config.transit().setInputScheduleCRS( INITIAL_CRS );
config.network().setInputFile("multimodalnetwork.xml");
// yyyyyy Is it so plausible that this is given here when the test is about having this in the file? kai, sep'18
config.global().setCoordinateSystem( TARGET_CRS );
config.controller().setLastIteration( -1 );
Expand Down

0 comments on commit c3309e9

Please sign in to comment.