Skip to content

Commit dc15b31

Browse files
authored
fix: properly considering the --plans-path argument (#261)
1 parent f527a86 commit dc15b31

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/src/main/java/org/eqasim/core/scenario/cutter/RunScenarioCutterV2.java

+11
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ static public void main(String[] args)
7878
scenario.getPopulation().getPersons().values().stream().map(Person::getId).forEach(personIds::add);
7979

8080
// We now read the data from the original scenario
81+
// Before we need to check if we are reading a file other than what's in the config
82+
if (cmd.hasOption("plans-path")) {
83+
File plansFile = new File(cmd.getOptionStrict("plans-path"));
84+
85+
if (!plansFile.exists()) {
86+
throw new IllegalStateException("Plans file does not exist: " + plansFile.getPath());
87+
} else {
88+
config.plans().setInputFile(plansFile.getAbsolutePath());
89+
}
90+
}
91+
8192
scenario = ScenarioUtils.createScenario(config);
8293
eqasimConfigurator.configureScenario(scenario);
8394
ScenarioUtils.loadScenario(scenario);

0 commit comments

Comments
 (0)