Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::DiseaseModule Class Referencefinal

Defines the disease module container to hold disease models. More...

#include <disease.h>

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

Public Member Functions

 DiseaseModule ()=delete
 
 DiseaseModule (std::map< core::Identifier, std::shared_ptr< DiseaseModel >> &&models)
 Initialises a new instance of the DiseaseModule class. More...
 
SimulationModuleType type () const noexcept override
 Gets the module type identifier. More...
 
const std::string & name () const noexcept override
 Gets the module name. More...
 
std::size_t size () const noexcept override
 Gets the number of diseases model hosted. More...
 
bool contains (const core::Identifier &disease_id) const noexcept override
 Indicates whether the host contains an disease identified by code. More...
 
std::shared_ptr< DiseaseModel > & operator[] (const core::Identifier &disease_id)
 Gets the model for a given disease. More...
 
const std::shared_ptr< DiseaseModel > & operator[] (const core::Identifier &disease_id) const
 Gets the model for a given disease. More...
 
void initialise_population (RuntimeContext &context) override
 Initialises the virtual population. More...
 
void update_population (RuntimeContext &context) override
 Updates the virtual population status. More...
 
double get_excess_mortality (const core::Identifier &disease_code, const Person &entity) const noexcept override
 Gets the mortality rate associated with a disease for an individual. More...
 
- Public Member Functions inherited from hgps::SimulationModule
virtual ~SimulationModule ()=default
 Destroys a SimulationModule instance. More...
 

Detailed Description

Defines the disease module container to hold disease models.

Constructor & Destructor Documentation

◆ DiseaseModule() [1/2]

hgps::DiseaseModule::DiseaseModule ( )
delete

◆ DiseaseModule() [2/2]

hgps::DiseaseModule::DiseaseModule ( std::map< core::Identifier, std::shared_ptr< DiseaseModel >> &&  models)

Initialises a new instance of the DiseaseModule class.

Parameters
modelsCollection of disease model instances

Member Function Documentation

◆ contains()

bool hgps::DiseaseModule::contains ( const core::Identifier disease_id) const
overridevirtualnoexcept

Indicates whether the host contains an disease identified by code.

Parameters
disease_idThe disease unique identifier
Returns
true if the disease is found, otherwise false.

Implements hgps::DiseaseHostModule.

◆ get_excess_mortality()

double hgps::DiseaseModule::get_excess_mortality ( const core::Identifier disease_id,
const Person entity 
) const
overridevirtualnoexcept

Gets the mortality rate associated with a disease for an individual.

Parameters
disease_idThe disease unique identifier
entityThe entity associated with the mortality value
Returns
the mortality rate value, if found, otherwise zero.

Implements hgps::DiseaseHostModule.

◆ initialise_population()

void hgps::DiseaseModule::initialise_population ( RuntimeContext context)
overridevirtual

Initialises the virtual population.

Parameters
contextThe simulation shared runtime context instance

Implements hgps::SimulationModule.

◆ name()

const std::string & hgps::DiseaseModule::name ( ) const
overridevirtualnoexcept

Gets the module name.

Returns
The human-readable module name

Implements hgps::SimulationModule.

◆ operator[]() [1/2]

std::shared_ptr< DiseaseModel > & hgps::DiseaseModule::operator[] ( const core::Identifier disease_id)

Gets the model for a given disease.

Parameters
disease_idThe disease identifier
Returns
The disease model instance
Exceptions
std::out_of_rangeif the module does not have a model for the specified disease.

◆ operator[]() [2/2]

const std::shared_ptr< DiseaseModel > & hgps::DiseaseModule::operator[] ( const core::Identifier disease_id) const

Gets the model for a given disease.

Parameters
disease_idThe disease identifier
Returns
The disease model instance
Exceptions
std::out_of_rangeif the module does not have a model for the specified disease.

◆ size()

std::size_t hgps::DiseaseModule::size ( ) const
overridevirtualnoexcept

Gets the number of diseases model hosted.

Returns
Number of hosted diseases models

Implements hgps::DiseaseHostModule.

◆ type()

SimulationModuleType hgps::DiseaseModule::type ( ) const
overridevirtualnoexcept

Gets the module type identifier.

Returns
The module type identifier

Implements hgps::SimulationModule.

◆ update_population()

void hgps::DiseaseModule::update_population ( RuntimeContext context)
overridevirtual

Updates the virtual population status.

Parameters
contextThe simulation run-time context

Implements hgps::UpdatableModule.


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