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

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

#include <healthgps.h>

Inheritance diagram for hgps::HealthGPS:
[legend]
Collaboration diagram for hgps::HealthGPS:
[legend]

Public Member Functions

 HealthGPS ()=delete
 
 HealthGPS (SimulationDefinition &&definition, SimulationModuleFactory &factory, EventAggregator &bus)
 Initialises a new instance of the HealthGPS class. More...
 
void initialize () override
 Initialises the simulation experiment. More...
 
void terminate () override
 Terminates the simulation experiment. More...
 
adevs::Time init (adevs::SimEnv< int > *env) override
 Called when the model is added to the simulation executive. More...
 
adevs::Time update (adevs::SimEnv< int > *env) override
 Called to assign a new state to the model at current time. More...
 
adevs::Time update (adevs::SimEnv< int > *env, std::vector< int > &x) override
 Called to assign a new state to the model at current time, when input is present. More...
 
void fini (adevs::Time clock) override
 Called after the model has been removed from the simulation executive. More...
 
void setup_run (unsigned int run_number) noexcept override
 Set-up a new simulation run with default seed. More...
 
void setup_run (unsigned int run_number, unsigned int seed) noexcept override
 Set-up a new simulation run. More...
 
- Public Member Functions inherited from hgps::Simulation
 Simulation ()=delete
 
 Simulation (SimulationDefinition &&definition)
 Initialises a new instance of the Simulation class. More...
 
virtual ~Simulation ()=default
 Destroys a simulation instance. More...
 
ScenarioType type () noexcept
 Gets the simulation type. More...
 
std::string name () override
 Gets the simulation name. More...
 

Additional Inherited Members

- Protected Attributes inherited from hgps::Simulation
SimulationDefinition definition_
 

Detailed Description

Defines the simulation engine data type class.

The simulation engine holds the modules instances and run-time context, manages the simulation clock and core algorithm sequencing.

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

◆ HealthGPS() [1/2]

hgps::HealthGPS::HealthGPS ( )
delete

◆ HealthGPS() [2/2]

hgps::HealthGPS::HealthGPS ( SimulationDefinition &&  definition,
SimulationModuleFactory factory,
EventAggregator bus 
)
explicit

Initialises a new instance of the HealthGPS class.

Parameters
definitionThe simulation definition instance
factoryThe simulation modules factory instance
busThe message bus instance to use
Here is the call graph for this function:

Member Function Documentation

◆ fini()

void hgps::HealthGPS::fini ( adevs::Time  clock)
override

Called after the model has been removed from the simulation executive.

Parameters
clockThe time at which the model no longer exists.
Here is the call graph for this function:

◆ init()

adevs::Time hgps::HealthGPS::init ( adevs::SimEnv< int > *  env)
override

Called when the model is added to the simulation executive.

Parameters
envThe simulation executive environment
Returns
The time of the next event
Here is the call graph for this function:

◆ initialize()

void hgps::HealthGPS::initialize ( )
overridevirtual

Initialises the simulation experiment.

Implements hgps::Simulation.

Here is the call graph for this function:

◆ setup_run() [1/2]

void hgps::HealthGPS::setup_run ( unsigned int  run_number)
overridevirtualnoexcept

Set-up a new simulation run with default seed.

Parameters
run_numberThe run number

Implements hgps::Simulation.

◆ setup_run() [2/2]

void hgps::HealthGPS::setup_run ( unsigned int  run_number,
unsigned int  run_seed 
)
overridevirtualnoexcept

Set-up a new simulation run.

Parameters
run_numberThe run number
run_seedThe custom seed for random number generation

Implements hgps::Simulation.

◆ terminate()

void hgps::HealthGPS::terminate ( )
overridevirtual

Terminates the simulation experiment.

Implements hgps::Simulation.

Here is the call graph for this function:

◆ update() [1/2]

adevs::Time hgps::HealthGPS::update ( adevs::SimEnv< int > *  env)
override

Called to assign a new state to the model at current time.

Parameters
envThe simulation executive environment
Returns
The time of the next call to update.
Here is the call graph for this function:

◆ update() [2/2]

adevs::Time hgps::HealthGPS::update ( adevs::SimEnv< int > *  env,
std::vector< int > &  x 
)
override

Called to assign a new state to the model at current time, when input is present.

This is not used with Health-GPS, the individuals are independent and nobody sends messages. If needed by future scenarios, e.g., agent-based models, the input was generated in the previous simulation instant and so this calculates the new state using state information from the previous instant.

Parameters
envThe simulation executive environment
xMessages sent to the model.
Returns
The time of the next call to update.

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