From ed9ee16645fcffbab4ee9f09a5485d9ee8dab8c0 Mon Sep 17 00:00:00 2001 From: rakow Date: Wed, 20 Mar 2024 13:48:15 +0100 Subject: [PATCH 1/2] Railsim maintenance (#3179) * cosmetics - Write debug files of RailsimEngineTest to test output directory. - Add some comments to clarify steps in the engine. * add some comments * comments and typo * add integration test for train following case with fixed block and moving block logic * adjust integration test: fixed block vs. moving block logic - Replace small segments in moving block track with a few long segments. * adjust integration test: regularize fixed block vs. moving block segments * adjust integration test: use same link lengths for fixed block vs. moving block segments --------- Co-authored-by: Merlin Unterfinger --- .../railsim/qsimengine/RailsimEngine.java | 9 +- .../railsim/qsimengine/UpdateEvent.java | 3 + .../deadlocks/SimpleDeadlockAvoidance.java | 4 +- .../disposition/SimpleDisposition.java | 2 +- .../qsimengine/resources/RailLink.java | 2 +- .../resources/RailResourceManager.java | 2 +- .../integration/RailsimIntegrationTest.java | 5 + .../qsimengine/RailsimDeadlockTest.java | 14 +- .../RailsimEngineMovingBlockTest.java | 45 ++---- .../railsim/qsimengine/RailsimEngineTest.java | 18 ++- .../config.xml | 39 +++++ .../trainNetwork.xml | 144 ++++++++++++++++++ .../transitSchedule.xml | 60 ++++++++ .../transitVehicles.xml | 48 ++++++ 14 files changed, 348 insertions(+), 47 deletions(-) create mode 100644 contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/config.xml create mode 100644 contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/trainNetwork.xml create mode 100644 contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitSchedule.xml create mode 100644 contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitVehicles.xml diff --git a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngine.java b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngine.java index ff98123051a..3b20be8ca7c 100644 --- a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngine.java +++ b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngine.java @@ -55,7 +55,7 @@ final class RailsimEngine implements Steppable { * Additional safety distance in meter that is added to the reservation distance. * Ensure that trains always have enough distance to progress. */ - private static double SAFETY_DIST = 10; + private static final double SAFETY_DIST = 10; private static final Logger log = LogManager.getLogger(RailsimEngine.class); private final EventsManager eventsManager; private final RailsimConfigGroup config; @@ -193,7 +193,7 @@ private void blockTrack(double time, UpdateEvent event) { updatePosition(time, event); if (!blockLinkTracks(time, state)) { - + // train needs to stop decideTargetSpeed(event, state); event.checkReservation = time + config.pollInterval; @@ -388,7 +388,7 @@ private void enterLink(double time, UpdateEvent event) { return; } - // Train stopped and reserves next links + // Train stopped exactly at the end of the link and tries to enter the next link if (FuzzyUtils.equals(state.speed, 0) && !blockLinkTracks(time, state)) { RailLink currentLink = state.route.get(state.routeIdx); @@ -766,6 +766,7 @@ private double retrieveAllowedMaxSpeed(TrainState state) { double maxSpeed = resources.getLink(state.headLink).getAllowedFreespeed(state.driver); + // get minium allowed speed on all links occupied by the train for (int i = state.routeIdx - 1; i >= 0; i--) { RailLink link = state.route.get(i); maxSpeed = Math.min(maxSpeed, link.getAllowedFreespeed(state.driver)); @@ -780,7 +781,7 @@ private double retrieveAllowedMaxSpeed(TrainState state) { /** * Remove all trains from simulation and generate events at the end of the day. * - * @param now end of day time + * @param now end of daytime */ void clearTrains(double now) { diff --git a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/UpdateEvent.java b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/UpdateEvent.java index a8a2c246ddd..1fc5a29b1ef 100644 --- a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/UpdateEvent.java +++ b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/UpdateEvent.java @@ -55,6 +55,9 @@ final class UpdateEvent implements Comparable { this.unblockLink = null; } + /** + * Update event to unblock a link after minimum headway time. + */ UpdateEvent(TrainState state, RailLink unblockLink, double time) { this.state = state; this.unblockLink = unblockLink; diff --git a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/deadlocks/SimpleDeadlockAvoidance.java b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/deadlocks/SimpleDeadlockAvoidance.java index 6ad95f76623..c92e0788325 100644 --- a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/deadlocks/SimpleDeadlockAvoidance.java +++ b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/deadlocks/SimpleDeadlockAvoidance.java @@ -43,14 +43,15 @@ public void onReserve(double time, RailResource resource, TrainPosition position RailLink link = position.getRoute(i); RailResource r = link.getResource(); // // Iterate through route until requested resource is present - if (r == resource) { resourceFound = true; } + // all resources before requested resource can be ignored if (!resourceFound) continue; + // check for all conflict points at and beyond the resource if (isConflictPoint(r)) { Reservation reservation = conflictPoints.computeIfAbsent(r, k -> new Reservation()); @@ -63,6 +64,7 @@ public void onReserve(double time, RailResource resource, TrainPosition position reservation.trains.add(position.getDriver()); } else + // as soon as we find an avoidance point we can stop reserving break; } diff --git a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/disposition/SimpleDisposition.java b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/disposition/SimpleDisposition.java index 7bb0642bfad..3e1094fc776 100644 --- a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/disposition/SimpleDisposition.java +++ b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/disposition/SimpleDisposition.java @@ -111,7 +111,7 @@ public DispositionResponse requestNextSegment(double time, TrainPosition positio } } - return new DispositionResponse(reserveDist, stop ? 0 : Double.POSITIVE_INFINITY, detour); + return new DispositionResponse(reserveDist, stop ? 0 : Double.POSITIVE_INFINITY, null); } private Detour checkDetour(double time, List segment, TrainPosition position) { diff --git a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailLink.java b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailLink.java index 06be3f5556e..8702b955afa 100644 --- a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailLink.java +++ b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailLink.java @@ -28,7 +28,7 @@ import java.util.Objects; /** - * Rail links which can has multiple tracks and corresponds to exactly one link. + * Rail links can have multiple tracks and corresponds to exactly one link. */ public final class RailLink implements HasLinkId { private final Id id; diff --git a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailResourceManager.java b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailResourceManager.java index 9a04894bf00..14b90ad151d 100644 --- a/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailResourceManager.java +++ b/contribs/railsim/src/main/java/ch/sbb/matsim/contrib/railsim/qsimengine/resources/RailResourceManager.java @@ -47,7 +47,7 @@ public final class RailResourceManager { public static final int ANY_TRACK = -1; /** - * Constant to indicate than any track is allowed as long as the opposing direction is not blocked. + * Constant to indicate that any track is allowed as long as the opposing direction is not blocked. */ public static final int ANY_TRACK_NON_BLOCKING = -2; diff --git a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/integration/RailsimIntegrationTest.java b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/integration/RailsimIntegrationTest.java index 6a61f5d0f16..b139bfd423b 100644 --- a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/integration/RailsimIntegrationTest.java +++ b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/integration/RailsimIntegrationTest.java @@ -243,6 +243,11 @@ void testMicroTrainFollowingVaryingSpeed() { EventsCollector collector = runSimulation(new File(utils.getPackageInputDirectory(), "microTrainFollowingVaryingSpeed")); } + @Test + void testMicroTrainFollowingFixedVsMovingBlock() { + EventsCollector collector = runSimulation(new File(utils.getPackageInputDirectory(), "microTrainFollowingFixedVsMovingBlock")); + } + @Test void testMicroStationSameLink() { EventsCollector collector = runSimulation(new File(utils.getPackageInputDirectory(), "microStationSameLink")); diff --git a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimDeadlockTest.java b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimDeadlockTest.java index ddd998ee3f1..bc7d7cfca00 100644 --- a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimDeadlockTest.java +++ b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimDeadlockTest.java @@ -67,7 +67,7 @@ public void deadlock() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "HG", "DC"); test.doSimStepUntil(250); -// test.debugFiles(collector, "deadLock"); + test.debugFiles(collector, utils.getOutputDirectory() + "/deadLock"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio", 240, "y1y", 0) @@ -93,7 +93,7 @@ public void deadLockAvoidancePoint() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "HG", "CD"); test.doSimStepUntil(250); -// test.debugFiles(collector, "deadLockAvoidancePoint"); + test.debugFiles(collector, utils.getOutputDirectory() + "/deadLockAvoidancePoint"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio", 240, "y1y", 0) @@ -118,7 +118,7 @@ public void avoidancePoint() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "HG", "CD"); test.doSimStepUntil(800); - test.debugFiles(collector, "avoidancePoint"); + test.debugFiles(collector, utils.getOutputDirectory() + "/avoidancePoint"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio", 420, "EF", 0) @@ -147,7 +147,7 @@ public void tooSmall() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2b", 0, "HG", "CD"); test.doSimStepUntil(1500); -// test.debugFiles(collector, "tooSmall"); + test.debugFiles(collector, utils.getOutputDirectory() + "/tooSmall"); RailsimTestUtils.assertThat(collector) @@ -166,7 +166,7 @@ public void oneWay() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "HG", "CD"); test.doSimStepUntil(800); -// test.debugFiles(collector, "oneWay"); + test.debugFiles(collector, utils.getOutputDirectory() + "/oneWay"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio", 350, "EF", 0) @@ -185,7 +185,7 @@ public void twoWay() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2b", 0, "HG", "CD"); test.doSimStepUntil(800); -// test.debugFiles(collector, "twoWay"); + test.debugFiles(collector, utils.getOutputDirectory() + "/twoWay"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio1a", 350, "EF", 0) @@ -217,7 +217,7 @@ public void movingBlock() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2b", 0, "HG", "CD"); test.doSimStepUntil(1500); -// test.debugFiles(collector, "movingBlock"); + test.debugFiles(collector, utils.getOutputDirectory() + "/movingBlock"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio1a", 670, "EF", 0) diff --git a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineMovingBlockTest.java b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineMovingBlockTest.java index ae31cac7539..134959bb6a2 100644 --- a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineMovingBlockTest.java +++ b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineMovingBlockTest.java @@ -71,11 +71,9 @@ public void multipleTrains() { test.doSimStepUntil(5_000); -// test.debugFiles(collector, "movingBlock"); + test.debugFiles(collector, utils.getOutputDirectory() + "/movingBlock"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("regio", 2370, 200, 0) - .hasTrainState("cargo", 3268, 200, 0) + RailsimTestUtils.assertThat(collector).hasTrainState("regio", 2370, 200, 0).hasTrainState("cargo", 3268, 200, 0) .hasTrainState("sprinter", 3345, 200, 0); test = getTestEngine("networkMovingBlocks.xml"); @@ -84,10 +82,9 @@ public void multipleTrains() { RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter", 120, "l1-2", "l6-7"); test.doStateUpdatesUntil(5_000, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/movingBlock_detailed"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("regio", 2370, 200, 0) - .hasTrainState("cargo", 3268, 200, 0) + RailsimTestUtils.assertThat(collector).hasTrainState("regio", 2370, 200, 0).hasTrainState("cargo", 3268, 200, 0) .hasTrainState("sprinter", 3345, 200, 0); } @@ -100,22 +97,18 @@ public void opposite() { RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter2", 400, "l6-5", "l2-1"); test.doSimStepUntil(2_000); -// test.debugFiles(collector, "opposite"); + test.debugFiles(collector, utils.getOutputDirectory() + "/opposite"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("sprinter2", 1368, 200, 0) - .hasTrainState("sprinter", 1559, 200, 0); + RailsimTestUtils.assertThat(collector).hasTrainState("sprinter2", 1368, 200, 0).hasTrainState("sprinter", 1559, 200, 0); test = getTestEngine("networkMovingBlocks.xml"); RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter", 0, "l1-2", "l6-7"); RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter2", 400, "l6-5", "l2-1"); test.doStateUpdatesUntil(2_000, 5); -// test.debugFiles(collector, "opposite_detailed"); + test.debugFiles(collector, utils.getOutputDirectory() + "/opposite_detailed"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("sprinter2", 1368, 200, 0) - .hasTrainState("sprinter", 1559, 200, 0); + RailsimTestUtils.assertThat(collector).hasTrainState("sprinter2", 1368, 200, 0).hasTrainState("sprinter", 1559, 200, 0); } @@ -130,11 +123,9 @@ public void multiTrack() { RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter", 120, "l1-2", "l6-7"); test.doSimStepUntil(5_000); -// test.debugFiles(collector, "multiTrack"); + test.debugFiles(collector, utils.getOutputDirectory() + "/multiTrack"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("regio", 2370, 200, 0) - .hasTrainState("cargo", 3268, 200, 0) + RailsimTestUtils.assertThat(collector).hasTrainState("regio", 2370, 200, 0).hasTrainState("cargo", 3268, 200, 0) .hasTrainState("sprinter", 1984, 200, 0); test = getTestEngine("networkMovingBlocks.xml", l -> RailsimUtils.setTrainCapacity(l, 3)); @@ -144,10 +135,9 @@ public void multiTrack() { RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter", 120, "l1-2", "l6-7"); test.doStateUpdatesUntil(5_000, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/multiTrack_detailed"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("regio", 2370, 200, 0) - .hasTrainState("cargo", 3268, 200, 0) + RailsimTestUtils.assertThat(collector).hasTrainState("regio", 2370, 200, 0).hasTrainState("cargo", 3268, 200, 0) .hasTrainState("sprinter", 1984, 200, 0); } @@ -162,11 +152,9 @@ public void mixed() { RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter", 0, "1-2", "20-21"); test.doSimStepUntil(2_000); - test.debugFiles(collector, "mixed"); + test.debugFiles(collector, utils.getOutputDirectory() + "/mixed"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("regio", 1418, 1000, 0) - .hasTrainState("cargo", 1241, 1000, 0) + RailsimTestUtils.assertThat(collector).hasTrainState("regio", 1418, 1000, 0).hasTrainState("cargo", 1241, 1000, 0) .hasTrainState("sprinter", 1324, 1000, 0); test = getTestEngine("networkMixedTypes.xml"); @@ -175,10 +163,9 @@ public void mixed() { RailsimTestUtils.createDeparture(test, TestVehicle.Sprinter, "sprinter", 0, "1-2", "20-21"); test.doStateUpdatesUntil(2_000, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/mixed_detailed"); - RailsimTestUtils.assertThat(collector) - .hasTrainState("regio", 1418, 1000, 0) - .hasTrainState("cargo", 1241, 1000, 0) + RailsimTestUtils.assertThat(collector).hasTrainState("regio", 1418, 1000, 0).hasTrainState("cargo", 1241, 1000, 0) .hasTrainState("sprinter", 1324, 1000, 0); } diff --git a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineTest.java b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineTest.java index 6d0d67ad81b..cd25d4536ac 100644 --- a/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineTest.java +++ b/contribs/railsim/src/test/java/ch/sbb/matsim/contrib/railsim/qsimengine/RailsimEngineTest.java @@ -42,7 +42,7 @@ public class RailsimEngineTest { @RegisterExtension - private MatsimTestUtils utils = new MatsimTestUtils(); + private final MatsimTestUtils utils = new MatsimTestUtils(); private EventsManager eventsManager; private RailsimTestUtils.EventCollector collector; @@ -84,6 +84,7 @@ void testSimple() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "train", 0, "l1-2", "l5-6"); test.doSimStepUntil(400); + test.debugFiles(collector, utils.getOutputDirectory() + "/simple"); RailsimTestUtils.assertThat(collector) .hasSizeGreaterThan(5) @@ -94,6 +95,7 @@ void testSimple() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "train", 0, "l1-2", "l5-6"); test.doStateUpdatesUntil(400, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/simple_detailed"); RailsimTestUtils.assertThat(collector) .hasSizeGreaterThan(5) @@ -111,6 +113,7 @@ void testCongested() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio", 60, "l1-2", "l5-6"); test.doSimStepUntil(600); + test.debugFiles(collector, utils.getOutputDirectory() + "/congested"); RailsimTestUtils.assertThat(collector) .hasTrainState("cargo", 359, 2000, 0) @@ -127,6 +130,7 @@ void testCongestedWithHeadway() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio", 60, "l1-2", "l5-6"); test.doSimStepUntil(600); + test.debugFiles(collector, utils.getOutputDirectory() + "/congestedWithHeadway"); RailsimTestUtils.assertThat(collector) .hasTrainState("cargo", 359, 2000, 0) @@ -144,6 +148,7 @@ void testOpposite() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "l8-7", "l2-1"); test.doSimStepUntil(600); + test.debugFiles(collector, utils.getOutputDirectory() + "/opposite"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio1", 293, 600, 0) @@ -156,6 +161,7 @@ void testOpposite() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "l8-7", "l2-1"); test.doStateUpdatesUntil(600, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/opposite_detailed"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio1", 293, 600, 0) @@ -171,6 +177,7 @@ void testVaryingSpeedOne() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio", 0, "t1_IN-t1_OUT", "t3_IN-t3_OUT"); test.doSimStepUntil(10000); + test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedOne"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio", 7599, 0, 2.7777777) @@ -181,6 +188,7 @@ void testVaryingSpeedOne() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio", 0, "t1_IN-t1_OUT", "t3_IN-t3_OUT"); test.doStateUpdatesUntil(10000, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedOne_detailed"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio", 7599, 0, 2.7777777) @@ -198,6 +206,7 @@ void testVaryingSpeedMany() { } test.doSimStepUntil(30000); + test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedMany"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio0", 7599, 0, 2.7777777) @@ -212,6 +221,7 @@ void testVaryingSpeedMany() { } test.doStateUpdatesUntil(30000, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/varyingSpeedMany_detailed"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio0", 7599, 0, 2.7777777) @@ -229,6 +239,7 @@ void testTrainFollowing() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "1-2", "20-21"); test.doSimStepUntil(5000); + test.debugFiles(collector, utils.getOutputDirectory() + "/trainFollowing"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio1", 1138, 1000, 0) @@ -239,6 +250,7 @@ void testTrainFollowing() { RailsimTestUtils.createDeparture(test, TestVehicle.Regio, "regio2", 0, "1-2", "20-21"); test.doStateUpdatesUntil(5000, 1); + test.debugFiles(collector, utils.getOutputDirectory() + "/trainFollowing_detailed"); RailsimTestUtils.assertThat(collector) .hasTrainState("regio1", 1138, 1000, 0) @@ -254,7 +266,7 @@ void testMicroTrainFollowingVaryingSpeed() { RailsimTestUtils.createDeparture(test, TestVehicle.Cargo, "cargo2", 15, "1-2", "20-21"); test.doSimStepUntil(3000); -// test.debugFiles(collector, "microVarying"); + test.debugFiles(collector, utils.getOutputDirectory() + "/microVarying"); RailsimTestUtils.assertThat(collector) .hasTrainState("cargo1", 1278, 1000, 0) @@ -265,7 +277,7 @@ void testMicroTrainFollowingVaryingSpeed() { RailsimTestUtils.createDeparture(test, TestVehicle.Cargo, "cargo1", 0, "1-2", "20-21"); RailsimTestUtils.createDeparture(test, TestVehicle.Cargo, "cargo2", 15, "1-2", "20-21"); test.doStateUpdatesUntil(3000, 1); -// test.debugFiles(collector, "microVarying_detailed"); + test.debugFiles(collector, utils.getOutputDirectory() + "/microVarying_detailed"); RailsimTestUtils.assertThat(collector) .hasTrainState("cargo1", 1278, 1000, 0) diff --git a/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/config.xml b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/config.xml new file mode 100644 index 00000000000..da3761b5c4e --- /dev/null +++ b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/config.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/trainNetwork.xml b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/trainNetwork.xml new file mode 100644 index 00000000000..9787942945a --- /dev/null +++ b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/trainNetwork.xml @@ -0,0 +1,144 @@ + + + + + + Atlantis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixedBlock + 5 + + + + + fixedBlock + 1 + + + + + fixedBlock + 1 + + + + + fixedBlock + 1 + + + + + fixedBlock + 1 + + + + + fixedBlock + 1 + + + + + fixedBlock + 5 + + + + + + + movingBlock + 5 + + + + + movingBlock + 1 + + + + + movingBlock + 1 + + + + + movingBlock + 1 + + + + + movingBlock + 1 + + + + + movingBlock + 1 + + + + + movingBlock + 5 + + + + + + + + diff --git a/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitSchedule.xml b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitSchedule.xml new file mode 100644 index 00000000000..104bc96ace6 --- /dev/null +++ b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitSchedule.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + rail + + + + + + + + + + + + + + + + + + + + + + rail + + + + + + + + + + + + + + + + + + + + diff --git a/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitVehicles.xml b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitVehicles.xml new file mode 100644 index 00000000000..5e4675ae4ae --- /dev/null +++ b/contribs/railsim/test/input/ch/sbb/matsim/contrib/railsim/integration/microTrainFollowingFixedVsMovingBlock/transitVehicles.xml @@ -0,0 +1,48 @@ + + + + + + + 0.1 + 0.1 + + + + + + + + + + + + + + + + + + 0.4 + 0.1 + + + + + + + + + + + + + + + + + + + + + From 2e85ac920356af4de1744a449fd3b83f404210f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:18:22 +0000 Subject: [PATCH 2/2] build(deps): bump org.openjfx:javafx-graphics from 21.0.2 to 22 Bumps org.openjfx:javafx-graphics from 21.0.2 to 22. --- updated-dependencies: - dependency-name: org.openjfx:javafx-graphics dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- contribs/vsp/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contribs/vsp/pom.xml b/contribs/vsp/pom.xml index 701d3de1b86..c871cf3ebd9 100644 --- a/contribs/vsp/pom.xml +++ b/contribs/vsp/pom.xml @@ -184,7 +184,7 @@ org.openjfx javafx-graphics - 21.0.2 + 22 com.graphhopper