From c3309e96728e69b2a3c07b1ed45d0361cc667bcc Mon Sep 17 00:00:00 2001 From: Marcel Rieser Date: Thu, 12 Oct 2023 18:59:58 +0200 Subject: [PATCH] fix tests after switching to SwissRailRaptor --- .../examples/TestSiouxFalls.java | 6 ++--- .../minibus/integration/SubsidyTestIT.java | 2 +- .../vsp/pt/ptdisturbances/EditTripsTest.java | 24 ++++++++----------- .../matsim/examples/simple/PtScoringTest.java | 4 ---- .../TransitScheduleReprojectionIOTest.java | 1 + 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/contribs/discrete_mode_choice/src/test/java/org/matsim/contrib/discrete_mode_choice/examples/TestSiouxFalls.java b/contribs/discrete_mode_choice/src/test/java/org/matsim/contrib/discrete_mode_choice/examples/TestSiouxFalls.java index 302643c1aa8..567d5fb1fe4 100644 --- a/contribs/discrete_mode_choice/src/test/java/org/matsim/contrib/discrete_mode_choice/examples/TestSiouxFalls.java +++ b/contribs/discrete_mode_choice/src/test/java/org/matsim/contrib/discrete_mode_choice/examples/TestSiouxFalls.java @@ -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")); diff --git a/contribs/minibus/src/test/java/org/matsim/contrib/minibus/integration/SubsidyTestIT.java b/contribs/minibus/src/test/java/org/matsim/contrib/minibus/integration/SubsidyTestIT.java index 04d3e7eacad..b2c7576ae7e 100644 --- a/contribs/minibus/src/test/java/org/matsim/contrib/minibus/integration/SubsidyTestIT.java +++ b/contribs/minibus/src/test/java/org/matsim/contrib/minibus/integration/SubsidyTestIT.java @@ -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 diff --git a/contribs/vsp/src/test/java/playground/vsp/pt/ptdisturbances/EditTripsTest.java b/contribs/vsp/src/test/java/playground/vsp/pt/ptdisturbances/EditTripsTest.java index d8b04ba4662..c9e063abf12 100644 --- a/contribs/vsp/src/test/java/playground/vsp/pt/ptdisturbances/EditTripsTest.java +++ b/contribs/vsp/src/test/java/playground/vsp/pt/ptdisturbances/EditTripsTest.java @@ -170,20 +170,16 @@ public void testAgentLeavesStop() { double travelTime = arrivalTimes.get(person.getId()) - activityEndTime; List 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)); } @@ -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)); @@ -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)); diff --git a/matsim/src/test/java/org/matsim/examples/simple/PtScoringTest.java b/matsim/src/test/java/org/matsim/examples/simple/PtScoringTest.java index f0f1a89bab5..3789e469a25 100644 --- a/matsim/src/test/java/org/matsim/examples/simple/PtScoringTest.java +++ b/matsim/src/test/java/org/matsim/examples/simple/PtScoringTest.java @@ -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)){ @@ -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)) @@ -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)){ @@ -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)) diff --git a/matsim/src/test/java/org/matsim/pt/transitSchedule/TransitScheduleReprojectionIOTest.java b/matsim/src/test/java/org/matsim/pt/transitSchedule/TransitScheduleReprojectionIOTest.java index 2f5bd1afd14..526fefcb1d2 100644 --- a/matsim/src/test/java/org/matsim/pt/transitSchedule/TransitScheduleReprojectionIOTest.java +++ b/matsim/src/test/java/org/matsim/pt/transitSchedule/TransitScheduleReprojectionIOTest.java @@ -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 );