Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
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.
 
SimulationModuleType type () const noexcept override
 Gets the module type identifier.
 
const std::string & name () const noexcept override
 Gets the module name.
 
std::size_t size () const noexcept
 Gets the number of diseases models hosted.
 
bool contains (const core::Identifier &disease_id) const noexcept
 Indicates whether the host contains an disease identified by code.
 
std::shared_ptr< DiseaseModel > & operator[] (const core::Identifier &disease_id)
 Gets the model for a given disease.
 
const std::shared_ptr< DiseaseModel > & operator[] (const core::Identifier &disease_id) const
 Gets the model for a given disease.
 
void initialise_population (RuntimeContext &context) override
 Initialises the virtual population status.
 
void update_population (RuntimeContext &context) override
 Updates the virtual population status.
 
double get_excess_mortality (const core::Identifier &disease_code, const Person &entity) const noexcept
 Gets the mortality rate associated with a disease for an individual.
 
- Public Member Functions inherited from hgps::SimulationModule
virtual ~SimulationModule ()=default
 Destroys a SimulationModule instance.
 

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
noexcept

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.

◆ get_excess_mortality()

double hgps::DiseaseModule::get_excess_mortality ( const core::Identifier disease_code,
const Person entity 
) const
noexcept

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

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

◆ initialise_population()

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

Initialises the virtual population status.

Parameters
contextThe simulation run-time context

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
noexcept

Gets the number of diseases models hosted.

Returns
Number of hosted diseases models

◆ 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: