Automation
This is a set of automation features for Monte-Carlo and batch runs.
Note
The automation part is still rudimentary in the current release.
Model Runner
- class sfctools.automation.runner.ModelRunner(settings_path, results_path, builder, iter)
Bases:
object
A model runner is a generic ‘frame’ for running a model file. It requires a specific folder structure (see constructor). The usage of this is optional and voluntary. However, this could be helpful when running Monte-Carlo batches.
- Parameters
settings_path – str or path to .yml file
results_path – str or path, dir where results are written
builder – callable, method to call when building agents
iter – callable, method to call when iterating one simulation, should have an argument N (for number of iterations) and must return a dataframe (or a comparable data structure which supports a to_csv method)
This runs a simulation and create logger files and data files
- run(M: int, N: int)
runs a monte-carlo simulation wih M monte carlo runs and N simulation periods per run. Outputs are written to logger files.
- Parameters
M – number of monte-carlo runs
N – number of time periods per monte-carlo run