automatic file loading for non-core config groups?


Our current design is that files that are named in the config group (e.g. "households") is read by ScenarioLoader, but there is no promise that the code will do anything with it.

However, the same is not true for files named in non-core config groups – since the current ScenarioLoader does not know about them.

Would anybody have an idea how this could be overcome? E.g. annotate getters in some way so that `ScenarioLoader` could know about them?

This would also help with path conventions, extending the "relative to config file location" convention to contrib input files.




Marcel Rieser
August 22, 2019, 8:24 AM

(just thinking aloud)

  • If ScenarioLoader would load such non-core files, ScenarioLoader would have to know which Reader/Parser it needs to use. And then these Readers/Parser would have to follow a certain convention (i.e. some interface plus a default no-args constructor). This would likely be possible with Annotations.

  • Also, it would be interesting to also provide writers for output files in a similar way.

  • Where would the ScenarioLoader store the loaded data? As a custom scenario element? And would the ScenarioLoader store it, or would it be the responsibility of the Reader? Would an injector already be available, such that the read data could simply be bound to a class or interface?

Kai Nagel
August 22, 2019, 3:44 PM

Thanks for thinking about this. In our (or my?) standard loading sequence, ScenarioLoader is before injection. So it would have to be a ScenarioElement. Except if we somehow extend injection to scenario loading, but somehow my feeling is that we should stay away from any more large design jumps for the time being.

So it would have to look like this

I.e. information both about the reader and about the name of the scenario element would be in the annotation.




Kai Nagel