Skip to content

Commit

Permalink
remove command line option --drt-modes, as those are read from shape …
Browse files Browse the repository at this point in the history
…file now
  • Loading branch information
tschlenther committed Feb 2, 2024
1 parent 4fb3e6e commit 592da69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/matsim/run/prepare/NetworkOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/run/prepare/PrepareNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<SimpleFeature> features = shp.readFeatures();
Map<String, Geometry> modeGeoms = new HashMap<>();
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 592da69

Please sign in to comment.