Note: This is documentation for version 5.20 of Source. For a different version of Source, select the relevant space by using the Spaces menu in the toolbar above
Plugin Phase Details
In TIME.Scenario management we provide the following plugin hooks to allow a plugin to be called during model execution:
- IPluginPreInitialise: Gets called before any other subsystems get initialized - this is currently used for recorder set. Occurs before network and node reset methods
- IPluginInitialise: Gets called before the scenario is initialised (including its subsystems - e.g. data source etc..). This occurs before network and node reset methods. Input Sets use this hook. Functions with TimeOfEvaluation.InitializeRun will run after these plugins. Plugins will be executed in the following order:
- IAddProvenance plugins
- Plugins with type names alphabetically before ParameterSetManager (i.e. Scenario Input Sets)
- Input Sets
- Plugins with type names alphabetically after ParameterSetManager (i.e. Scenario Input Sets)
- IPluginRunStart: Called after Initialise, Scenario.Initialise, InputSets, network and node reset events. This is run after TimeOfEvaluation.InitializeRun but before TimeOfEvaluation.StartOfRun functions.
- IPluginBeforeStep: Called at the beginning of each time step but after TimeOfEvaluation.StartOfTimeStep functions
- IPluginAfterStep: Called at the end of each time step as the last thing executed (i.e. after subsystem post timesteps, after recorders and after TimeOfEvaluation.EndOfTimeStep
- IPluginRunEnd: Run at the very end of a run - only Finalize runs after this step. Run in the following order:
- IStoreProvenance
- IAddProvenance
- then by type name
- IPluginFinalise: Run in the following order:
- IStoreProvenance
- IAddProvenance
- then by type name
IPluginFinalise is really only used in the Provenance context. The idea is for plugins to create their provenance in the IPluginRunEnd step, then in the IPluginFinalise to write them out to disk.
Generally, plugins should use the IPluginRunEnd step unless you need specific dependent functionality like the provenance case.