Skip to content

Commit

Permalink
checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
simei94 committed Oct 10, 2024
1 parent 7723460 commit 589925f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/run/DrtOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
12 changes: 3 additions & 9 deletions src/test/java/org/matsim/run/RunIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 589925f

Please sign in to comment.