atomica.model.run_model

atomica.model.run_model(settings, framework, parset, progset=None, program_instructions=None, name=None)[source]

Build and process model

Running simulations is accomplished via the Model object in two steps

  1. The Model object is build, and all variables are initialized

  2. The integration is carried out

run_model serves as a wrapper for both of these steps, which are commonly performed together. However, in some cases it may be desired to split the operations. For example

  • In optimization, the same Model is used at each iteration, but with different instructions. To save time, the model is built just once, and deep-copied after building but before processing

  • Sometimes it may be required to make changes to the model’s structure e.g. to implement exotic cross-population interactions that cannot be expressed via the Excel inputs. In that case, it may again be necessary

Parameters:
  • settings – Project settings defining simulation time span and time step

  • framework – A ProjectFramework instance

  • parset (ParameterSet) – A ParameterSet instance

  • progset (ProgramSet) – Optionally provide a ProgramSet instance to use programs

  • program_instructions (ProgramInstructions) – Optional ProgramInstructions instance. If progset is specified, then instructions must be provided

  • name (str) – Optionally specify the name to assign to the output result

Returns:

A Result object containing the processed model