Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::ModelRunner Class Reference

Defines the simulation executive data type class. More...

#include <modelrunner.h>

Public Member Functions

 ModelRunner ()=delete
 
 ModelRunner (EventAggregator &bus, std::unique_ptr< RandomBitGenerator > generator) noexcept
 Initialises a new instance of the ModelRunner class. More...
 
double run (Simulation &baseline, const unsigned int trial_runs)
 Run an experiment for baseline scenario only. More...
 
double run (Simulation &baseline, Simulation &intervention, const unsigned int trial_runs)
 Run an experiment for baseline and intervention scenarios. More...
 
bool is_running () const noexcept
 Gets a value indicating whether an experiment is current running. More...
 
void cancel () noexcept
 Cancel a running experiment. More...
 

Detailed Description

Defines the simulation executive data type class.

The simulation executive holds the simulation engine instances and manages the execution of experiments by completing multiple runs of the same scenario. The executive controls the number of runs required, current run number, progress notifications, random number generator seeds for each run, and the parallel evaluation for the two scenarios..

Health-GPS uses a simpler version of adevs (A Discrete EVent System simulator) library (https://sourceforge.net/projects/bdevs), which contain only four header files, but provides an intuitive modelling interface for agent-based models, without requiring familiarity with the full aspects of the DEVS formalism.

Constructor & Destructor Documentation

◆ ModelRunner() [1/2]

hgps::ModelRunner::ModelRunner ( )
delete

◆ ModelRunner() [2/2]

hgps::ModelRunner::ModelRunner ( EventAggregator bus,
std::unique_ptr< RandomBitGenerator generator 
)
noexcept

Initialises a new instance of the ModelRunner class.

Parameters
busThe message bus instance to use for notification
generatorRandom number generator for runs management

Member Function Documentation

◆ cancel()

void hgps::ModelRunner::cancel ( )
noexcept

Cancel a running experiment.

Here is the call graph for this function:

◆ is_running()

bool hgps::ModelRunner::is_running ( ) const
noexcept

Gets a value indicating whether an experiment is current running.

Returns
true, if a experiment is underway; otherwise, false.
Here is the caller graph for this function:

◆ run() [1/2]

double hgps::ModelRunner::run ( Simulation baseline,
const unsigned int  trial_runs 
)

Run an experiment for baseline scenario only.

Parameters
baselineThe simulation engine instance
trial_runsExperiment number of runs
Returns
The experiment total elapsed time, in milliseconds
Exceptions
std::invalid_argumentfor non-baseline scenario type or negative number of runs.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run() [2/2]

double hgps::ModelRunner::run ( Simulation baseline,
Simulation intervention,
const unsigned int  trial_runs 
)

Run an experiment for baseline and intervention scenarios.

Parameters
baselineThe simulation engine instance for baseline scenario
interventionThe simulation engine instance for intervention scenario
trial_runsExperiment number of runs
Returns
The experiment total elapsed time, in milliseconds
Exceptions
std::invalid_argumentfor scenario type mismatch or negative number of runs.
Here is the call graph for this function:

The documentation for this class was generated from the following files: