Health-GPS
1.2.2.0
Global Health Policy Simulation model (Health-GPS)
|
Defines the Simulation runtime context data type. More...
#include <runtime_context.h>
Public Member Functions | |
RuntimeContext ()=delete | |
RuntimeContext (EventAggregator &bus, SimulationDefinition &definition) | |
Initialises a new instance of the RuntimeContext class. More... | |
int | time_now () const noexcept |
Gets the current simulation time. More... | |
int | start_time () const noexcept |
Gets the experiment start time. More... | |
unsigned int | current_run () const noexcept |
Gets the experiment current run number. More... | |
int | sync_timeout_millis () const noexcept |
Gets the data synchronisation timeout in milliseconds. More... | |
Population & | population () noexcept |
Gets a reference to the virtual population container. More... | |
RuntimeMetric & | metrics () noexcept |
Gets a reference to the runtime metrics container. More... | |
Scenario & | scenario () noexcept |
Gets a reference to the simulation experiment scenario. More... | |
Random & | random () noexcept |
Gets a reference to the engine random number generator. More... | |
const HierarchicalMapping & | mapping () const noexcept |
Gets a read-only reference to the hierarchical risk factors mapping. More... | |
const std::vector< core::DiseaseInfo > & | diseases () const noexcept |
Gets a read-only reference to the select diseases information. More... | |
const core::IntegerInterval & | age_range () const noexcept |
Gets a read-only reference to the population age range constraints. More... | |
const std::string | identifier () const noexcept |
Gets the simulation identifier for outside world messages. More... | |
void | set_current_time (const int time_now) noexcept |
Sets the current simulation time value. More... | |
void | set_current_run (const unsigned int run_number) noexcept |
Sets the current simulation run number. More... | |
void | reset_population (const std::size_t initial_pop_size, const int model_start_time) |
Resets the virtual population to an initial size, with only new individuals. More... | |
void | publish (std::unique_ptr< EventMessage > message) const noexcept |
Publishes a polymorphic new message to the outside world synchronously. More... | |
void | publish_async (std::unique_ptr< EventMessage > message) const noexcept |
Publishes a polymorphic new message to the outside world asynchronously. More... | |
Defines the Simulation runtime context data type.
The context holds the simulation runtime information, including the virtual population, and expose to all modules via the API calls. Only one context instance exists per simulation instance for internal use only by the engine algorithm.
|
delete |
hgps::RuntimeContext::RuntimeContext | ( | EventAggregator & | bus, |
SimulationDefinition & | definition | ||
) |
Initialises a new instance of the RuntimeContext class.
bus | The message bus instance for communication with the outside world |
definition | The simulation experiment definition. |
|
noexcept |
Gets a read-only reference to the population age range constraints.
|
noexcept |
Gets the experiment current run number.
|
noexcept |
Gets a read-only reference to the select diseases information.
|
noexcept |
Gets the simulation identifier for outside world messages.
|
noexcept |
Gets a read-only reference to the hierarchical risk factors mapping.
|
noexcept |
Gets a reference to the runtime metrics container.
|
noexcept |
Gets a reference to the virtual population container.
|
noexcept |
Publishes a polymorphic new message to the outside world synchronously.
message | The message instance to publish |
|
noexcept |
Publishes a polymorphic new message to the outside world asynchronously.
message | The message instance to publish |
|
noexcept |
Gets a reference to the engine random number generator.
void hgps::RuntimeContext::reset_population | ( | const std::size_t | initial_pop_size, |
const int | model_start_time | ||
) |
Resets the virtual population to an initial size, with only new individuals.
initial_pop_size | Initial population size |
model_start_time | Experiment start time |
|
noexcept |
Gets a reference to the simulation experiment scenario.
|
noexcept |
Sets the current simulation run number.
run_number | The new run number |
|
noexcept |
Sets the current simulation time value.
time_now | The new simulation time |
|
noexcept |
Gets the experiment start time.
|
noexcept |
Gets the data synchronisation timeout in milliseconds.
|
noexcept |
Gets the current simulation time.