Skip to content

Commit

Permalink
reduced bicycle test
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Oct 20, 2021
1 parent feac2f8 commit 6761278
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/test/java/org/matsim/run/TestBicycleRouting.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public void testElevationRouting() {

var outputDir = testUtils.getOutputDirectory();

MATSimApplication.execute(TestApplication.class, "run", "--output=" + outputDir + "withElevation", "--useElevation=true", "--download-input");
MATSimApplication.execute(TestApplication.class, "run", "--output=" + outputDir + "withoutElevation", "--useElevation=false", "--download-input");
MATSimApplication.execute(TestApplication.class, "--output=" + outputDir + "withElevation", "--useElevation=true", "--download-input", "--1pct");
MATSimApplication.execute(TestApplication.class, "--output=" + outputDir + "withoutElevation", "--useElevation=false", "--download-input", "--1pct");

// load output of both runs
var scenarioWithElevation = ScenarioUtils.createScenario(ConfigUtils.createConfig());
Expand Down Expand Up @@ -77,10 +77,17 @@ public static class TestApplication extends RunMetropoleRuhrScenario {
@Override
public Config prepareConfig(Config config) {
var preparedConfig = super.prepareConfig(config);

preparedConfig.global().setNumberOfThreads(1);
preparedConfig.qsim().setNumberOfThreads(1);
preparedConfig.plans().setInputFile(null);
preparedConfig.controler().setLastIteration(0);
preparedConfig.controler().setRunId(RUN_ID);

// Disable PT
preparedConfig.transit().setVehiclesFile(null);
preparedConfig.transit().setTransitScheduleFile(null);

var bikeConfig = ((BicycleConfigGroup) config.getModules().get("bicycle"));
// set an insanely high disutility for gradients
bikeConfig.setMarginalUtilityOfGradient_m_100m(-1000);
Expand All @@ -91,6 +98,9 @@ public Config prepareConfig(Config config) {
public void prepareScenario(Scenario scenario) {
super.prepareScenario(scenario);

// Other agents are not needed for the test
scenario.getPopulation().getPersons().clear();

// add single person with two activities
var factory = scenario.getPopulation().getFactory();
var plan = factory.createPlan();
Expand Down

0 comments on commit 6761278

Please sign in to comment.