|
Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
|
Defines a virtual population person data type. More...
#include <person.h>
Public Member Functions | |
| Person () | |
| Initialise a new instance without an assigned ID (unassigned_id). | |
| Person (const core::Gender gender) noexcept | |
| Initialise a new instance with gender; ID remains unassigned_id until Population placement. | |
| Person (std::size_t id) noexcept | |
| Initialise a new instance with an explicit ID (Population initial cohort / entrants). | |
| Person (const core::Gender gender, std::size_t id) noexcept | |
| Initialise a new instance with gender and explicit ID (Population newborns). | |
| void | set_id (std::size_t id) noexcept |
| Set the person identifier (Population use when placing or recycling slots). | |
| bool | has_assigned_id () const noexcept |
| Whether Population has assigned a lifetime ID to this instance. | |
| std::size_t | id () const noexcept |
| Gets this instance unique identifier. | |
| bool | is_alive () const noexcept |
| Determine if a Person is current alive. | |
| bool | has_emigrated () const noexcept |
| Determine if a Person has emigrated from the population. | |
| unsigned int | time_of_death () const noexcept |
| Gets the time of death, for dead, non-alive individuals only. | |
| unsigned int | time_of_migration () const noexcept |
| Gets the time of migration, for emigrated individuals only. | |
| bool | is_active () const noexcept |
| Gets a value indicating whether a Person is current active in the population. | |
| double | get_risk_factor_value (const core::Identifier &key) const |
| Gets a risk factor current value. | |
| float | gender_to_value () const |
| Gets the gender enumeration as a number for analysis. | |
| std::string | gender_to_string () const |
| Gets the gender enumeration name string. | |
| bool | over_18 () const noexcept |
| Check if person is an adult (18 or over) | |
| float | sector_to_value () const |
| Gets the sector enumeration as a number. | |
| float | income_to_value () const |
| Gets the income enumeration as a number. | |
| float | region_to_value () const |
| Gets the region as a numeric value for analysis. | |
| float | ethnicity_to_value () const |
| Gets the ethnicity as a numeric value for analysis. | |
| void | emigrate (const unsigned int time) |
| Emigrate this instance from the virtual population. | |
| void | die (const unsigned int time) |
| Mark this instance as dead. | |
Static Public Member Functions | |
| static float | gender_to_value (core::Gender gender) |
| Gets the gender enumeration as a number for analysis. | |
Public Attributes | |
| core::Gender | gender {core::Gender::unknown} |
| The assigned gender. | |
| unsigned int | age {} |
| Current age in years. | |
| core::Sector | sector {core::Sector::unknown} |
| Sector (region) assigned value. | |
| std::string | region {"unknown"} |
| Region category (dynamically assigned from CSV) | |
| std::string | ethnicity {"unknown"} |
| Ethnicity category (dynamically assigned from CSV) | |
| core::Income | income {core::Income::unknown} |
| Income category. | |
| double | income_continuous {0.0} |
| Continuous income value (for FINCH approach) | |
| std::size_t | income_adjustment_stratum {0} |
| Income adjustment stratum index (0..N-1) for optional stratum-specific factors mean. | |
| bool | has_income_adjustment_stratum {false} |
| Whether income_adjustment_stratum has been assigned for this simulation step. | |
| double | physical_activity {0.0} |
| Physical activity level. | |
| double | ses {} |
| Social-economic status (SES) assigned value. | |
| std::map< core::Identifier, double > | risk_factors |
| Current risk factors values. | |
| std::map< core::Identifier, Disease > | diseases |
| Diseases history and current status. | |
Static Public Attributes | |
| static constexpr std::size_t | unassigned_id = 0 |
| Sentinel returned by default constructors until Population assigns an ID. | |
Defines a virtual population person data type.
|
default |
Initialise a new instance without an assigned ID (unassigned_id).
|
noexcept |
Initialise a new instance with gender; ID remains unassigned_id until Population placement.
| gender | The new person gender |
|
noexcept |
Initialise a new instance with an explicit ID (Population initial cohort / entrants).
| id | Lifetime-unique identifier assigned by Population. |
|
noexcept |
Initialise a new instance with gender and explicit ID (Population newborns).
| gender | The new person gender |
| id | Lifetime-unique identifier assigned by Population. |
| void hgps::Person::die | ( | const unsigned int | time | ) |
Mark this instance as dead.
| time | Death time |
| std::logic_error | for attempting to set to non-active individuals. |
| void hgps::Person::emigrate | ( | const unsigned int | time | ) |
Emigrate this instance from the virtual population.
| time | Migration time |
| std::logic_error | for attempting to set to non-active individuals. |
| float hgps::Person::ethnicity_to_value | ( | ) | const |
Gets the ethnicity as a numeric value for analysis.
| HgpsException | if ethnicity is unknown |
| std::string hgps::Person::gender_to_string | ( | ) | const |
Gets the gender enumeration name string.
| HgpsException | if gender is unknown |
| float hgps::Person::gender_to_value | ( | ) | const |
Gets the gender enumeration as a number for analysis.
| HgpsException | if gender is unknown |
|
static |
Gets the gender enumeration as a number for analysis.
| gender | The gender to convert to a value |
| HgpsException | if gender is unknown |
| double hgps::Person::get_risk_factor_value | ( | const core::Identifier & | key | ) | const |
Gets a risk factor current value.
| key | The risk factor identifier |
| std::out_of_range | for unknown risk factor |
|
inlinenoexcept |
Whether Population has assigned a lifetime ID to this instance.
|
noexcept |
Determine if a Person has emigrated from the population.
|
noexcept |
Gets this instance unique identifier.
| float hgps::Person::income_to_value | ( | ) | const |
Gets the income enumeration as a number.
| HgpsException | if income is unknown |
|
noexcept |
Gets a value indicating whether a Person is current active in the population.
|
noexcept |
Determine if a Person is current alive.
|
noexcept |
Check if person is an adult (18 or over)
| float hgps::Person::region_to_value | ( | ) | const |
Gets the region as a numeric value for analysis.
| HgpsException | if region is unknown |
| float hgps::Person::sector_to_value | ( | ) | const |
Gets the sector enumeration as a number.
| HgpsException | if sector is unknown |
|
noexcept |
Set the person identifier (Population use when placing or recycling slots).
| id | Lifetime-unique identifier; must not reuse a previously assigned population ID. |
|
noexcept |
Gets the time of death, for dead, non-alive individuals only.
|
noexcept |
Gets the time of migration, for emigrated individuals only.
| unsigned int hgps::Person::age {} |
Current age in years.
| std::map<core::Identifier, Disease> hgps::Person::diseases |
Diseases history and current status.
| std::string hgps::Person::ethnicity {"unknown"} |
Ethnicity category (dynamically assigned from CSV)
| core::Gender hgps::Person::gender {core::Gender::unknown} |
The assigned gender.
| bool hgps::Person::has_income_adjustment_stratum {false} |
Whether income_adjustment_stratum has been assigned for this simulation step.
| core::Income hgps::Person::income {core::Income::unknown} |
Income category.
| std::size_t hgps::Person::income_adjustment_stratum {0} |
Income adjustment stratum index (0..N-1) for optional stratum-specific factors mean.
This is separate from final income categories (3/4) used for reporting.
| double hgps::Person::income_continuous {0.0} |
Continuous income value (for FINCH approach)
| double hgps::Person::physical_activity {0.0} |
Physical activity level.
| std::string hgps::Person::region {"unknown"} |
Region category (dynamically assigned from CSV)
| std::map<core::Identifier, double> hgps::Person::risk_factors |
Current risk factors values.
| core::Sector hgps::Person::sector {core::Sector::unknown} |
Sector (region) assigned value.
| double hgps::Person::ses {} |
Social-economic status (SES) assigned value.
|
staticconstexpr |
Sentinel returned by default constructors until Population assigns an ID.