From 592da6995fbf3378bbad5e50dcd8d485423e7115 Mon Sep 17 00:00:00 2001 From: tschlenther Date: Fri, 2 Feb 2024 20:42:27 +0100 Subject: [PATCH] remove command line option --drt-modes, as those are read from shape file now --- src/main/java/org/matsim/run/prepare/NetworkOptions.java | 7 ++++--- src/main/java/org/matsim/run/prepare/PrepareNetwork.java | 2 +- .../java/org/matsim/run/RunLeipzigIntegrationTest.java | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/matsim/run/prepare/NetworkOptions.java b/src/main/java/org/matsim/run/prepare/NetworkOptions.java index 9b15beee..d195803a 100644 --- a/src/main/java/org/matsim/run/prepare/NetworkOptions.java +++ b/src/main/java/org/matsim/run/prepare/NetworkOptions.java @@ -18,8 +18,9 @@ public class NetworkOptions { @CommandLine.Option(names = "--drt-area", description = "Path to SHP file specifying where DRT mode is allowed") private Path drtArea; - @CommandLine.Option(names = "--drt-modes", description = "List of modes to add. Use comma as delimiter", defaultValue = TransportMode.drt) - private String drtModes; + //modes now have to be provided in the drt-area shape file, per 'mode' attribute with +// @CommandLine.Option(names = "--drt-modes", description = "List of modes to add. Use comma as delimiter", defaultValue = TransportMode.drt) +// private String drtModes; @CommandLine.Option(names = "--car-free-area", description = "Path to SHP file specifying car-free area") private Path carFreeArea; @CommandLine.Option(names = "--car-free-modes", description = "List of modes to remove. Use comma as delimiter", defaultValue = TransportMode.car) @@ -65,7 +66,7 @@ public void prepare(Network network) { if (!Files.exists(drtArea)) { throw new IllegalArgumentException("Path to drt area not found: " + drtArea); } else { - PrepareNetwork.prepareDRT(network, new ShpOptions(drtArea, null, null), drtModes); + PrepareNetwork.prepareDRT(network, new ShpOptions(drtArea, null, null)); } } diff --git a/src/main/java/org/matsim/run/prepare/PrepareNetwork.java b/src/main/java/org/matsim/run/prepare/PrepareNetwork.java index a1441a31..5a483e82 100644 --- a/src/main/java/org/matsim/run/prepare/PrepareNetwork.java +++ b/src/main/java/org/matsim/run/prepare/PrepareNetwork.java @@ -57,7 +57,7 @@ public Integer call() throws Exception { * Adapt network to one or more drt service areas. Therefore, a shape file of the wished service area + a list * of drt modes are needed. */ - static void prepareDRT(Network network, ShpOptions shp, String modes) { + static void prepareDRT(Network network, ShpOptions shp) { List features = shp.readFeatures(); Map modeGeoms = new HashMap<>(); diff --git a/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java b/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java index 299d6d5e..08abc846 100644 --- a/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java +++ b/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java @@ -90,6 +90,8 @@ public final void runOptDrtExamplePopulationTest() { ConfigUtils.addOrGetModule(config, SimWrapperConfigGroup.class).defaultDashboards = SimWrapperConfigGroup.Mode.disabled; + //modes now have to be provided in the drt-area shape file, per 'mode' attribute with + //TODO: fix test by providing service area shape file MATSimApplication.execute(RunLeipzigScenario.class, config, "run", "--1pct", "--drt-area", exampleShp, "--drt-modes", "drtNorth,drtSoutheast", "--waiting-time-threshold-optDrt", "600", "--post-processing", "disabled");