51 std::size_t
id()
const noexcept;
105 void emigrate(const
unsigned int time);
110 void die(const
unsigned int time);
117 bool is_alive_{
true};
118 bool has_emigrated_{
false};
119 unsigned int time_of_death_{};
120 unsigned int time_of_migration_{};
122 static std::atomic<std::size_t> newUID;
123 static std::map<core::Identifier, std::function<double(
const Person &)>> current_dispatcher;
Gender
Enumerates gender types.
Definition: forward_type.h:18
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
DiseaseStatus
Disease status enumeration.
Definition: person.h:12
@ free
Declared free from condition.
@ active
Current with the condition.
Global namespace.
Definition: jsonparser.h:88
Defines the disease history data type.
Definition: person.h:21
DiseaseStatus status
The disease current status.
Definition: person.h:23
int start_time
Disease start time.
Definition: person.h:26
Disease clone() const noexcept
Clone a disease history entry.
Definition: person.h:33
int time_since_onset
Disease time since onset (cancer disease only)
Definition: person.h:29
Defines a virtual population person data type.
Definition: person.h:40
static void reset_id()
Resets the unique identifier sequence to zero.
Definition: person.cpp:81
bool has_emigrated() const noexcept
Determine if a Person has emigrated from the population.
Definition: person.cpp:25
std::map< core::Identifier, Disease > diseases
Diseases history and current status.
Definition: person.h:66
unsigned int time_of_death() const noexcept
Gets the time of death, for dead, non-alive individuals only.
Definition: person.cpp:27
core::Gender gender
The assigned gender.
Definition: person.h:54
double ses
Social-economic status (SES) assigned value.
Definition: person.h:60
std::size_t id() const noexcept
Gets this instance unique identifier.
Definition: person.cpp:21
bool is_alive() const noexcept
Determine if a Person is current alive.
Definition: person.cpp:23
void emigrate(const unsigned int time)
Emigrate this instance from the virtual population.
Definition: person.cpp:63
std::string gender_to_string() const noexcept
Gets the gender enumeration name string.
Definition: person.cpp:55
double get_risk_factor_value(const core::Identifier &key) const noexcept
Gets a risk factor current value.
Definition: person.cpp:33
unsigned int time_of_migration() const noexcept
Gets the time of migration, for emigrated individuals only.
Definition: person.cpp:29
std::map< core::Identifier, double > risk_factors
Current risk factors values.
Definition: person.h:63
bool is_active() const noexcept
Gets a value indicating whether a Person is current active in the population.
Definition: person.cpp:31
unsigned int age
Current age in years.
Definition: person.h:57
Person()
Initialise a new instance of the Person structure.
Definition: person.cpp:16
float gender_to_value() const noexcept
Gets the gender enumeration as a number for analysis.
Definition: person.cpp:47
void die(const unsigned int time)
Mark this instance as dead.
Definition: person.cpp:72