diff --git a/src/main/java/org/matsim/run/RunLausitzDrtScenario.java b/src/main/java/org/matsim/run/RunLausitzDrtScenario.java index bbf4b9f..75ec333 100644 --- a/src/main/java/org/matsim/run/RunLausitzDrtScenario.java +++ b/src/main/java/org/matsim/run/RunLausitzDrtScenario.java @@ -40,15 +40,14 @@ import picocli.CommandLine; import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; +import java.util.*; /** * Run the Lausitz scenario including a regional DRT service. * All necessary configs will be made in this class. */ public final class RunLausitzDrtScenario extends MATSimApplication { +// TODO: upload correct service area shp file to git @CommandLine.Option(names = "--drt-shp", description = "Path to shp file for adding drt not network links as an allowed mode.", defaultValue = "./input/shp/lausitz.shp") private String drtAreaShp; @@ -88,8 +87,6 @@ protected Config prepareConfig(Config config) { DvrpConfigGroup dvrpConfigGroup = ConfigUtils.addOrGetModule(config, DvrpConfigGroup.class); dvrpConfigGroup.networkModes = Set.of(TransportMode.drt); - - MultiModeDrtConfigGroup multiModeDrtConfigGroup = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class); if (multiModeDrtConfigGroup.getModalElements().isEmpty()) { @@ -130,7 +127,7 @@ protected Config prepareConfig(Config config) { SubtourModeChoiceConfigGroup smc = ConfigUtils.addOrGetModule(config, SubtourModeChoiceConfigGroup.class); - if (String.join(",", smc.getModes()).contains(TransportMode.drt)) { + if (!String.join(",", smc.getModes()).contains(TransportMode.drt)) { String[] modes = Arrays.copyOf(smc.getModes(), smc.getModes().length + 1); modes[modes.length - 1] = TransportMode.drt; diff --git a/src/test/java/org/matsim/run/RunIntegrationTest.java b/src/test/java/org/matsim/run/RunIntegrationTest.java index 3224e0a..e0b2eac 100644 --- a/src/test/java/org/matsim/run/RunIntegrationTest.java +++ b/src/test/java/org/matsim/run/RunIntegrationTest.java @@ -56,6 +56,9 @@ void runScenario() { @Test void runScenarioIncludingDrt() { + +// TODO: add dummy drt person. +// TODO: test smc with drt. THere has to be some person changing to drt before iteration1 Config config = ConfigUtils.loadConfig(String.format("input/v%s/lausitz-v%s-10pct.config.xml", LausitzScenario.VERSION, LausitzScenario.VERSION)); ConfigUtils.addOrGetModule(config, SimWrapperConfigGroup.class).defaultDashboards = SimWrapperConfigGroup.Mode.disabled;