Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
hgps::KevinHallModel Class Referencefinal

Implements the energy balance model type. More...

#include <kevin_hall_model.h>

Inheritance diagram for hgps::KevinHallModel:
[legend]
Collaboration diagram for hgps::KevinHallModel:
[legend]

Public Member Functions

 KevinHallModel (std::shared_ptr< RiskFactorSexAgeTable > expected, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_trend, std::shared_ptr< std::unordered_map< core::Identifier, int > > trend_steps, const std::unordered_map< core::Identifier, double > &energy_equation, const std::unordered_map< core::Identifier, core::DoubleInterval > &nutrient_ranges, const std::unordered_map< core::Identifier, std::map< core::Identifier, double > > &nutrient_equations, const std::unordered_map< core::Identifier, std::optional< double > > &food_prices, const std::unordered_map< core::Gender, std::vector< std::vector< double > > > &weight_quantiles_by_stratum, const std::vector< double > &epa_quantiles, std::unordered_map< core::Gender, std::vector< HeightModelParams > > height_params)
 Initialises a new instance of the KevinHallModel class.
 
RiskFactorModelType type () const noexcept override
 Gets the model type identifier.
 
std::string name () const noexcept override
 Gets the model name.
 
void generate_risk_factors (RuntimeContext &context) override
 Generates the initial risk factors for a population and newborns.
 
void update_risk_factors (RuntimeContext &context) override
 Update risk factors for population.
 
void validate_weight_in_config_range (const RuntimeContext &context, const Person &person, std::string_view phase) const
 Checks person weight against modelling.risk_factors.Weight range from config. Below minimum: throws and stops the run. Above maximum: prints a console warning and continues (weight is not modified).
 
- Public Member Functions inherited from hgps::RiskFactorAdjustableModel
 RiskFactorAdjustableModel (std::shared_ptr< RiskFactorSexAgeTable > expected, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_trend, std::shared_ptr< std::unordered_map< core::Identifier, int > > trend_steps, TrendType trend_type=TrendType::Null, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_income_trend=nullptr, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_income_trend_decay_factors=nullptr)
 Constructs a new RiskFactorAdjustableModel instance.
 
void adjust_risk_factors (RuntimeContext &context, const std::vector< core::Identifier > &factors, OptionalRanges ranges, bool apply_trend, const RiskFactorSexAgeTable *expected_override=nullptr, std::optional< std::size_t > income_stratum_filter=std::nullopt, std::vector< IncomeStratumAdjustmentExampleRow > *debug_example_rows=nullptr) const
 Adjust risk factors such that mean sim value matches expected value.
 
int get_trend_steps (const core::Identifier &factor) const
 Gets the number of time steps to apply the trend.
 
const std::shared_ptr< std::unordered_map< core::Identifier, double > > & get_expected_trend () const noexcept
 Gets the expected trend values.
 
void set_logistic_factors (const std::unordered_set< core::Identifier > &logistic_factors)
 Sets the logistic factors for simulated mean calculation.
 
- Public Member Functions inherited from hgps::RiskFactorModel
virtual ~RiskFactorModel ()=default
 Destroys a RiskFactorModel instance.
 

Detailed Description

Implements the energy balance model type.

The dynamic model is used to advance the virtual population over time.

Constructor & Destructor Documentation

◆ KevinHallModel()

hgps::KevinHallModel::KevinHallModel ( std::shared_ptr< RiskFactorSexAgeTable expected,
std::shared_ptr< std::unordered_map< core::Identifier, double > >  expected_trend,
std::shared_ptr< std::unordered_map< core::Identifier, int > >  trend_steps,
const std::unordered_map< core::Identifier, double > &  energy_equation,
const std::unordered_map< core::Identifier, core::DoubleInterval > &  nutrient_ranges,
const std::unordered_map< core::Identifier, std::map< core::Identifier, double > > &  nutrient_equations,
const std::unordered_map< core::Identifier, std::optional< double > > &  food_prices,
const std::unordered_map< core::Gender, std::vector< std::vector< double > > > &  weight_quantiles_by_stratum,
const std::vector< double > &  epa_quantiles,
std::unordered_map< core::Gender, std::vector< HeightModelParams > >  height_params 
)

Initialises a new instance of the KevinHallModel class.

Parameters
expectedThe risk factor expected values by sex and age
expected_trendThe expected trend of risk factor values
trend_stepsThe number of time steps to apply the trend
energy_equationThe energy coefficients for each nutrient
nutrient_rangesThe interval boundaries for nutrient values
nutrient_equationsThe nutrient coefficients for each food group
food_pricesThe unit price for each food group
weight_quantiles_by_stratumWeight quantiles by gender and income adjustment stratum (each inner vector must be sorted).
epa_quantilesThe Energy / Physical Activity quantiles (must be sorted)
height_paramsHeight model parameters by gender and income adjustment stratum. Index 0 is the fallback/default stratum used for legacy scalar config.

Member Function Documentation

◆ generate_risk_factors()

void hgps::KevinHallModel::generate_risk_factors ( RuntimeContext context)
overridevirtual

Generates the initial risk factors for a population and newborns.

Parameters
contextThe simulation run-time context

Implements hgps::RiskFactorModel.

Here is the call graph for this function:

◆ name()

std::string hgps::KevinHallModel::name ( ) const
overridevirtualnoexcept

Gets the model name.

Returns
The human-readable model name

Implements hgps::RiskFactorModel.

◆ type()

RiskFactorModelType hgps::KevinHallModel::type ( ) const
overridevirtualnoexcept

Gets the model type identifier.

Returns
The module type identifier

Implements hgps::RiskFactorModel.

◆ update_risk_factors()

void hgps::KevinHallModel::update_risk_factors ( RuntimeContext context)
overridevirtual

Update risk factors for population.

Parameters
contextThe simulation run-time context

Implements hgps::RiskFactorModel.

Here is the call graph for this function:

◆ validate_weight_in_config_range()

void hgps::KevinHallModel::validate_weight_in_config_range ( const RuntimeContext context,
const Person person,
std::string_view  phase 
) const

Checks person weight against modelling.risk_factors.Weight range from config. Below minimum: throws and stops the run. Above maximum: prints a console warning and continues (weight is not modified).

Here is the call graph for this function:
Here is the caller graph for this function:

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