Skip to content

Commit

Permalink
fix: properly considering the --plans-path argument (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkchouaki authored Sep 27, 2024
1 parent f527a86 commit dc15b31
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ static public void main(String[] args)
scenario.getPopulation().getPersons().values().stream().map(Person::getId).forEach(personIds::add);

// We now read the data from the original scenario
// Before we need to check if we are reading a file other than what's in the config
if (cmd.hasOption("plans-path")) {
File plansFile = new File(cmd.getOptionStrict("plans-path"));

if (!plansFile.exists()) {
throw new IllegalStateException("Plans file does not exist: " + plansFile.getPath());
} else {
config.plans().setInputFile(plansFile.getAbsolutePath());
}
}

scenario = ScenarioUtils.createScenario(config);
eqasimConfigurator.configureScenario(scenario);
ScenarioUtils.loadScenario(scenario);
Expand Down

0 comments on commit dc15b31

Please sign in to comment.