nismod/smif

Run decision agent with `smif decide` subcommand over multiple iterations

tomalrussell opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
smif decide runs the decision agent, with an argument provided for the decision iteration of interest. This currently works fine for pre-planned interventions, where the decision agent only needs to run once to set up the whole modelrun.

When running a rule-based decision agent using smif decide, an implementation may fail to move past the first iteration, if it doesn't recognise that the model run has already made some progress.

Describe the solution you'd like
The design of individual decision agents should allow for resuming after an iteration has been run.

This might look like persisting relevant (internal?) state after emitting a bundle as part of the decision loop, and resuming from that checkpoint when run.

Describe alternatives you've considered
These seem like architectural choices - more design options probably available:

  • insist that the decision agent always exists with the main smif process, and lives as long as it (maybe not possible to break down the model run into steps if we go this way)
  • allow decision agent to run as a server, serving decisions in response to simulation requests (smif decide then acts as a client?)

Additional context
Arising from unpacking the steps through a model run in #404. Might need stronger motivation for running decision agents from NISMOD/other example modelling problem.