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

Ordered Init/Step/Exit/ExitCondition Functions #707

Closed
ptheywood opened this issue Oct 7, 2021 · 0 comments · Fixed by #708
Closed

Ordered Init/Step/Exit/ExitCondition Functions #707

ptheywood opened this issue Oct 7, 2021 · 0 comments · Fixed by #708

Comments

@ptheywood
Copy link
Member

Init/Step/Exit/ExitCondition functions are all (mostly?) stored in unordered data structures, so the execution order of them is undefined.

Previous decisision was to just document this (#270).

It would be useful in many models for the order to be defined and controllable by the user.

This could be done in several ways:

  1. Ordered data structures, where the order is handlede by insertion order during model definitions
  2. Ordered data structure, combined with layer / dependency options

Insertion order change will be much less effort, but providing a non-insertion-order based approach might be useful in some edge cases, although this would be achievable if required by providing a single init function, which internally calls other local functions in whichever order is desired.

There may also be some scope to consider how init functions interact with file io. (currently io occurs earyl before init functions, anything prior to this is done outside of the simulation execution phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant