smif.controller.execute_step module

Execute a single step directly

Summary

Data:

execute_decision_step Request the next set of decisions from the decision manager, including the bundle of timesteps and decision iterations to simulate next.
execute_model_before_step Runs model initialisation
execute_model_step Runs a single step of a model run

Reference

smif.controller.execute_step.execute_model_before_step(model_run_id, model_name, store, dry_run=False)[source]

Runs model initialisation

This method

smif.controller.execute_step.execute_model_step(model_run_id, model_name, timestep, decision, store, dry_run=False)[source]

Runs a single step of a model run

This method is designed to be the single place where smif actually calls wrapped models.

Loading model wrapper implementations (via ModelLoader) is also deferred to this method, so that the smif scheduler environment need not have all the python dependencies of all wrapped models.

For example, in a scheduled containerised environment, the model run can be configured and set running (smif run modelrun_name) in one environment, and individual models can run (smif run modelrun_name –model model_name –timestep 2050) in their own environments.

Parameters:
  • model_run_id (str) – Modelrun id of overarching model run
  • model_name (str) – Model to run
  • timestep (int) – Timestep to run
  • decision (int) – Decision to run
  • store (Store) –
smif.controller.execute_step.execute_decision_step(model_run_id, decision, store)[source]

Request the next set of decisions from the decision manager, including the bundle of timesteps and decision iterations to simulate next.

Parameters:
  • model_run_id (str) – Modelrun id of overarching model run
  • decision (int) – Decision to run - should be 0 to start, or n+1 where n is the max decision executed so far
  • store (Store) –