Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update injection structure #294

Merged
merged 8 commits into from
Jan 22, 2025
Merged

Conversation

sebhoerl
Copy link
Collaborator

@sebhoerl sebhoerl commented Jan 21, 2025

From now on, multipurpose tools such as the scenario cutter or the standalone mode choice scripts will need to be told which EqasimConfiugurator to use. There is the IDFConfigurator, SwitzerlandConfigurator, etc. The reason is that routing and other components may be configured differently depending on the use case, and this should also be reflected when calling those tools.

In principle, there is nothing to be done, because the correct configurator is read from the eqasim.properties file in the resources of the JAR. This means that a JAR built for ile_de_france will define the correct configurator in that file, the same is true for the other currently existing cases. So calling RunScenarioCutter from a switzerland JAR will automatically make use of the SwitzerlandConfigurator.

There are cases where you might want to override the configurator. This can be done (for the time being) by passing the command line option --eqasim-configurator org.eqasim.etc.MyConfigurator, but we will phase out this option in the near future. Alternatively, the configurator can be overridden by defining the environment variable eqasim_configurator before running Java.

Development

  • Use Controler.getInjector to set up anything that needs injection (routing, mode choice, simulation, ...) to ensure the same set-up everywhere
  • Factor out mode-choice-specific configurator, use the general one instead
  • Enforce the use of a EqasimConfigurator that needs to be passed to the respective run scripts
  • Define some mechanism that avoids having to pass the configurator name to every script

@sebhoerl sebhoerl enabled auto-merge (squash) January 22, 2025 16:08
@sebhoerl sebhoerl changed the title chore: update injection structure feat: update injection structure Jan 22, 2025
@sebhoerl sebhoerl merged commit 350331e into develop Jan 22, 2025
1 check passed
@sebhoerl sebhoerl deleted the chore/injection-structure branch January 22, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant