43 std::shared_ptr<RiskFactorSexAgeTable> expected,
44 std::shared_ptr<std::unordered_map<core::Identifier, double>> expected_trend,
45 std::shared_ptr<std::unordered_map<core::Identifier, int>> trend_steps,
46 const std::unordered_map<core::Identifier, double> &energy_equation,
47 const std::unordered_map<core::Identifier, core::DoubleInterval> &nutrient_ranges,
48 const std::unordered_map<
core::Identifier, std::map<core::Identifier, double>>
50 const std::unordered_map<
core::Identifier, std::optional<double>> &food_prices,
51 const std::unordered_map<
core::Gender, std::vector<std::vector<double>>>
52 &weight_quantiles_by_stratum,
53 const std::vector<double> &epa_quantiles,
54 std::unordered_map<
core::Gender, std::vector<HeightModelParams>> height_params);
58 std::string
name()
const noexcept override;
68 std::string_view phase)
const;
81 void initialise_nutrient_intakes(
Person &person)
const;
85 void update_nutrient_intakes(
Person &person)
const;
89 void compute_nutrient_intakes(
Person &person)
const;
93 void initialise_energy_intake(
Person &person)
const;
97 void update_energy_intake(
Person &person)
const;
101 void compute_energy_intake(
Person &person)
const;
108 double compute_G(
double CI,
double CI_0,
double G_0)
const;
116 double compute_ECF(
double delta_Na,
double CI,
double CI_0,
double ECF_0)
const;
125 double compute_delta(
int age,
core::Gender sex,
double PAL,
double BW,
double H)
const;
136 double compute_EE(
double BW,
double F,
double L,
double EI,
double K,
double delta,
141 void compute_bmi(
Person &person)
const;
153 std::optional<double> adjustment = std::nullopt)
const;
183 std::optional<unsigned> age = std::nullopt)
const;
195 bool apply_trend)
const override;
200 double get_weight_quantile(
double epa_quantile,
const std::vector<double> &quantiles)
const;
209 std::optional<std::unordered_map<core::Gender, double>> power = std::nullopt,
210 std::optional<unsigned> age = std::nullopt)
const;
212 compute_mean_weight_for_height(
Population &population,
213 std::optional<unsigned> age = std::nullopt)
const;
230 void print_height_summary_tables(
RuntimeContext &context, std::string_view phase)
const;
233 void print_weight_summary_tables(
RuntimeContext &context, std::string_view phase)
const;
237 const std::unordered_map<core::Identifier, double> &energy_equation_;
238 const std::unordered_map<core::Identifier, core::DoubleInterval> &nutrient_ranges_;
239 const std::unordered_map<core::Identifier, std::map<core::Identifier, double>>
240 &nutrient_equations_;
241 const std::unordered_map<core::Identifier, std::optional<double>> &food_prices_;
242 const std::unordered_map<core::Gender, std::vector<std::vector<double>>>
243 &weight_quantiles_by_stratum_;
244 const std::vector<double> &epa_quantiles_;
246 std::unordered_map<core::Gender, std::vector<HeightModelParams>> height_params_;
249 static constexpr int kevin_hall_age_min = 19;
250 static constexpr double rho_F = 39.5e3;
251 static constexpr double rho_L = 7.6e3;
252 static constexpr double rho_G = 17.6e3;
253 static constexpr double gamma_F = 13.0;
254 static constexpr double gamma_L = 92.0;
255 static constexpr double eta_F = 750.0;
256 static constexpr double eta_L = 960.0;
257 static constexpr double beta_TEF = 0.1;
258 static constexpr double beta_AT = 0.14;
259 static constexpr double xi_Na = 3000.0;
260 static constexpr double xi_CI = 4000.0;
280 std::unique_ptr<RiskFactorSexAgeTable> expected,
281 std::unique_ptr<std::unordered_map<core::Identifier, double>> expected_trend,
282 std::unique_ptr<std::unordered_map<core::Identifier, int>> trend_steps,
283 std::unordered_map<core::Identifier, double> energy_equation,
284 std::unordered_map<core::Identifier, core::DoubleInterval> nutrient_ranges,
285 std::unordered_map<
core::Identifier, std::map<core::Identifier, double>> nutrient_equations,
287 std::unordered_map<
core::Gender, std::vector<std::vector<double>>>
288 weight_quantiles_by_stratum,
289 std::vector<double> epa_quantiles,
290 std::unordered_map<
core::Gender, std::vector<HeightModelParams>> height_params);
294 std::unique_ptr<RiskFactorModel>
create_model()
const override;
297 std::unordered_map<core::Identifier, double> energy_equation_;
298 std::unordered_map<core::Identifier, core::DoubleInterval> nutrient_ranges_;
299 std::unordered_map<core::Identifier, std::map<core::Identifier, double>> nutrient_equations_;
300 std::unordered_map<core::Identifier, std::optional<double>> food_prices_;
301 std::unordered_map<core::Gender, std::vector<std::vector<double>>> weight_quantiles_by_stratum_;
302 std::vector<double> epa_quantiles_;
303 std::unordered_map<core::Gender, std::vector<HeightModelParams>> height_params_;
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 a...
Definition kevin_hall_model.cpp:1164
Defines the Simulation runtime context data type.
Definition runtime_context.h:22