|
Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
|
#include <jacardi_education_lifecycle.h>
Classes | |
| struct | Stratum |
| One empirical stratum: sorted education ids + matching probabilities (sum ≈ 1). More... | |
Public Member Functions | |
| void | set_lookup (std::unordered_map< std::uint64_t, Stratum > table) |
| void | set_draw_at_19 (std::unordered_map< std::uint64_t, Stratum > table) |
| void | set_upgrades (std::unordered_map< std::uint64_t, Stratum > table) |
| bool | has_lookup () const noexcept |
| bool | has_draw_at_19 () const noexcept |
| bool | has_upgrades () const noexcept |
| double | initialise (unsigned int age, core::Gender gender, Random &rng) const |
| Part A — assign education once for a person at a given age. | |
| double | update (unsigned int age, core::Gender gender, int year, double current, Random &rng) const |
| Part B — yearly step after ageing. current may be NaN (missing). | |
Static Public Member Functions | |
| static int | gender_code (core::Gender gender) |
| static std::uint64_t | key_age_gender (int age, int gender) noexcept |
| static std::uint64_t | key_year_gender (int year, int gender) noexcept |
| static std::uint64_t | key_upgrade (int year, int age, int gender, int from_id) noexcept |
| static int | draw (const Stratum &stratum, Random &rng) |
| Inverse-CDF draw over a stratum (ids sorted ascending). | |
Static Public Attributes | |
| static constexpr double | missing = std::numeric_limits<double>::quiet_NaN() |
| static constexpr int | max_lookup_age = 110 |
| static constexpr int | max_update_year = 2110 |
| static constexpr unsigned int | age_missing_max = 18U |
| static constexpr unsigned int | age_draw = 19U |
| static constexpr unsigned int | age_upgrade_max = 30U |
MAHIMA: Slovenia-style education lifecycle for JACARDI (partner algo 15 Oct 2026).
Two phases (same tables object, different call sites):
Values live on Person.risk_factors["Education"] as education_id 1..7. Ages 0–18 use NaN (= missing). CSV gender codes: 1 = male, 0 = female.
Threading: tables are immutable after load → safe for concurrent reads. Do NOT parallelise the person loops while they share one Random — RNG is not thread-safe. Per-person work is a map lookup + a few compares; analysis/disease paths dominate runtime, so leave these loops serial until we have thread-local RNG.
Age thresholds are named constants below so partners can retune rules without hunting magic numbers.
Inverse-CDF draw over a stratum (ids sorted ascending).
|
static |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| double hgps::EducationLifecycleTables::initialise | ( | unsigned int | age, |
| core::Gender | gender, | ||
| Random & | rng ) const |
Part A — assign education once for a person at a given age.
|
staticnoexcept |
|
staticnoexcept |
|
staticnoexcept |
| void hgps::EducationLifecycleTables::set_draw_at_19 | ( | std::unordered_map< std::uint64_t, Stratum > | table | ) |
| void hgps::EducationLifecycleTables::set_lookup | ( | std::unordered_map< std::uint64_t, Stratum > | table | ) |
| void hgps::EducationLifecycleTables::set_upgrades | ( | std::unordered_map< std::uint64_t, Stratum > | table | ) |
| double hgps::EducationLifecycleTables::update | ( | unsigned int | age, |
| core::Gender | gender, | ||
| int | year, | ||
| double | current, | ||
| Random & | rng ) const |
Part B — yearly step after ageing. current may be NaN (missing).
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |