Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::Person Struct Reference

Defines a virtual population person data type. More...

#include <person.h>

Public Member Functions

 Person ()
 Initialise a new instance of the Person structure. More...
 
 Person (const core::Gender gender) noexcept
 Initialise a new instance of the Person structure. More...
 
std::size_t id () const noexcept
 Gets this instance unique identifier. More...
 
bool is_alive () const noexcept
 Determine if a Person is current alive. More...
 
bool has_emigrated () const noexcept
 Determine if a Person has emigrated from the population. More...
 
unsigned int time_of_death () const noexcept
 Gets the time of death, for dead, non-alive individuals only. More...
 
unsigned int time_of_migration () const noexcept
 Gets the time of migration, for emigrated individuals only. More...
 
bool is_active () const noexcept
 Gets a value indicating whether a Person is current active in the population. More...
 
double get_risk_factor_value (const core::Identifier &key) const noexcept
 Gets a risk factor current value. More...
 
float gender_to_value () const noexcept
 Gets the gender enumeration as a number for analysis. More...
 
std::string gender_to_string () const noexcept
 Gets the gender enumeration name string. More...
 
void emigrate (const unsigned int time)
 Emigrate this instance from the virtual population. More...
 
void die (const unsigned int time)
 Mark this instance as dead. More...
 

Static Public Member Functions

static void reset_id ()
 Resets the unique identifier sequence to zero. More...
 

Public Attributes

core::Gender gender {core::Gender::unknown}
 The assigned gender. More...
 
unsigned int age {}
 Current age in years. More...
 
double ses {}
 Social-economic status (SES) assigned value. More...
 
std::map< core::Identifier, double > risk_factors
 Current risk factors values. More...
 
std::map< core::Identifier, Diseasediseases
 Diseases history and current status. More...
 

Detailed Description

Defines a virtual population person data type.

Constructor & Destructor Documentation

◆ Person() [1/2]

hgps::Person::Person ( )

Initialise a new instance of the Person structure.

◆ Person() [2/2]

hgps::Person::Person ( const core::Gender  gender)
noexcept

Initialise a new instance of the Person structure.

Parameters
genderThe new person gender

Member Function Documentation

◆ die()

void hgps::Person::die ( const unsigned int  time)

Mark this instance as dead.

Parameters
timeDeath time
Exceptions
std::logic_errorfor attempting to set to non-active individuals.
Here is the call graph for this function:

◆ emigrate()

void hgps::Person::emigrate ( const unsigned int  time)

Emigrate this instance from the virtual population.

Parameters
timeMigration time
Exceptions
std::logic_errorfor attempting to set to non-active individuals.
Here is the call graph for this function:

◆ gender_to_string()

std::string hgps::Person::gender_to_string ( ) const
noexcept

Gets the gender enumeration name string.

Returns
The gender name

◆ gender_to_value()

float hgps::Person::gender_to_value ( ) const
noexcept

Gets the gender enumeration as a number for analysis.

Returns
The gender associated value

◆ get_risk_factor_value()

double hgps::Person::get_risk_factor_value ( const core::Identifier key) const
noexcept

Gets a risk factor current value.

Parameters
keyThe risk factor identifier
Returns
Current risk factor value, if found; otherwise, NaN
Here is the caller graph for this function:

◆ has_emigrated()

bool hgps::Person::has_emigrated ( ) const
noexcept

Determine if a Person has emigrated from the population.

Returns
true for current emigrated; otherwise, false.

◆ id()

std::size_t hgps::Person::id ( ) const
noexcept

Gets this instance unique identifier.

Note
The identifier is unique within a virtual population only, not global unique.
Returns
Unique identifier
Here is the caller graph for this function:

◆ is_active()

bool hgps::Person::is_active ( ) const
noexcept

Gets a value indicating whether a Person is current active in the population.

Note
A person is active only if still alive and has not emigrated.
Returns
true for active; otherwise, false.
Here is the caller graph for this function:

◆ is_alive()

bool hgps::Person::is_alive ( ) const
noexcept

Determine if a Person is current alive.

Returns
true for alive; otherwise, false

◆ reset_id()

void hgps::Person::reset_id ( )
static

Resets the unique identifier sequence to zero.

◆ time_of_death()

unsigned int hgps::Person::time_of_death ( ) const
noexcept

Gets the time of death, for dead, non-alive individuals only.

Returns
Time of death value

◆ time_of_migration()

unsigned int hgps::Person::time_of_migration ( ) const
noexcept

Gets the time of migration, for emigrated individuals only.

Returns
Time of emigration value

Member Data Documentation

◆ age

unsigned int hgps::Person::age {}

Current age in years.

◆ diseases

std::map<core::Identifier, Disease> hgps::Person::diseases

Diseases history and current status.

◆ gender

core::Gender hgps::Person::gender {core::Gender::unknown}

The assigned gender.

◆ risk_factors

std::map<core::Identifier, double> hgps::Person::risk_factors

Current risk factors values.

◆ ses

double hgps::Person::ses {}

Social-economic status (SES) assigned value.


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