diff --git a/src/main/java/org/matsim/run/DrtOptions.java b/src/main/java/org/matsim/run/DrtOptions.java index 38fe1e9..749b6f0 100644 --- a/src/main/java/org/matsim/run/DrtOptions.java +++ b/src/main/java/org/matsim/run/DrtOptions.java @@ -254,7 +254,7 @@ private void checkServiceAreaShapeFile(Config config, DrtConfigGroup drtConfigGr Path.of(IOUtils.extendUrl(config.getContext(), getDrtAreaShp()).toURI()).getFileName().toString().split(".shp")[0] + "-with-waiting-time.shp"); newServiceAreaPath = file.getAbsolutePath(); } catch (URISyntaxException e) { - throw new RuntimeException(e); + throw new IllegalArgumentException("Error handling the Drt service area shapefile URI.", e); } diff --git a/src/test/java/org/matsim/run/RunIntegrationTest.java b/src/test/java/org/matsim/run/RunIntegrationTest.java index 6158007..d3a0b0b 100644 --- a/src/test/java/org/matsim/run/RunIntegrationTest.java +++ b/src/test/java/org/matsim/run/RunIntegrationTest.java @@ -80,14 +80,12 @@ void runScenarioIncludingDrt() { 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; - Path inputPath = p.resolve("drt-test-population.xml.gz"); - createDrtTestPopulation(inputPath); assert MATSimApplication.execute(LausitzDrtScenario.class, config, "--1pct", "--iterations", "0", - "--config:plans.inputPlansFile", inputPath.toString(), + "--config:plans.inputPlansFile", inputPath, "--output", utils.getOutputDirectory(), "--config:controller.overwriteFiles=deleteDirectoryIfExists", "--emissions", "DO_NOT_PERFORM_EMISSIONS_ANALYSIS") == 0 : "Must return non error code"; @@ -140,7 +138,7 @@ void runScenarioIncludingAdditionalPtLine() { } - private void createDrtTestPopulation(Path inputPath) { + private void createDrtTestPopulation(String inputPath) { Random random = new Random(1); Config config = ConfigUtils.createConfig(); Scenario scenario = ScenarioUtils.loadScenario(config); @@ -153,16 +151,12 @@ private void createDrtTestPopulation(Path inputPath) { Plan plan = populationFactory.createPlan(); // a random location in the Hoyerswerda town center Activity fromAct = populationFactory.createActivityFromCoord("home_2400", new Coord(863949.91, 5711547.75)); - // Somewhere near Ruhland Hbf -// Activity fromAct = populationFactory.createActivityFromCoord("home_2400", new Coord(838213.25, 5711776.54)); // a random time between 6:00-9:00 fromAct.setEndTime(21600 + random.nextInt(10800)); // set the link to PT, such that agent could find a potential intermodal trip Leg leg = populationFactory.createLeg(TransportMode.pt); // a location close to Cottbus Hbf Activity toAct = populationFactory.createActivityFromCoord("work_2400", new Coord(867341.75, 5746965.87)); -// somewhere near ruhland hbf -// Activity toAct = populationFactory.createActivityFromCoord("work_2400", new Coord(838646.6900000001, 5711749.89)); plan.addActivity(fromAct); plan.addLeg(leg); @@ -191,7 +185,7 @@ private void createDrtTestPopulation(Path inputPath) { population.addPerson(drtOnly); - new PopulationWriter(population).write(inputPath.toString()); + new PopulationWriter(population).write(inputPath); } @Test void runSpeedReductionScenario() {