8 #include <unordered_map>
38 if (rates.size() != 2) {
39 throw std::invalid_argument(
40 "The number of transfer coefficients must be 2 (short, long) term.");
67 if (values.size() != 4) {
68 throw std::out_of_range(
"The number of transfer coefficients must be 4.");
139 void clear() noexcept override;
142 const core::Identifier &risk_factor_key,
double value) override;
151 std::set<core::Identifier> factor_impact_;
152 std::unordered_map<
std::
size_t,
int> interventions_book_{};
154 double calculate_policy_impact(
const Person &entity)
const noexcept;
Thread-safe communication channel data type.
Definition: channel.h:24
Implements the food labelling intervention scenario.
Definition: food_labelling_scenario.h:126
const PolicyInterval & active_period() const noexcept override
Gets the intervention active period.
Definition: food_labelling_scenario.cpp:68
void clear() noexcept override
Clear the scenario log book data.
Definition: food_labelling_scenario.cpp:31
const std::vector< PolicyImpact > & impacts() const noexcept override
Gets the intervention impacts by risk factor and age range.
Definition: food_labelling_scenario.cpp:72
FoodLabellingScenario()=delete
double apply(Random &generator, Person &entity, int time, const core::Identifier &risk_factor_key, double value) override
Applies this Scenario to the Person instance.
Definition: food_labelling_scenario.cpp:33
SyncChannel & channel() override
Gets the Scenario communication channel.
Definition: food_labelling_scenario.cpp:29
Health-GPS scripted intervention policy scenario interface.
Definition: intervention_scenario.h:19
General purpose Random number generator algorithms.
Definition: random_algorithm.h:8
Gender
Enumerates gender types.
Definition: forward_type.h:18
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
Global namespace.
Definition: jsonparser.h:88
Defined the risk factor adjustment data type.
Definition: food_labelling_scenario.h:14
double adjustment
The adjustment value.
Definition: food_labelling_scenario.h:25
AdjustmentFactor(std::string factor_name, double value)
Initialise a new instance of the AdjustmentFactor structure.
Definition: food_labelling_scenario.h:18
core::Identifier identifier
The risk factor identifier.
Definition: food_labelling_scenario.h:22
Food labelling intervention definition data type.
Definition: food_labelling_scenario.h:108
PolicyInterval active_period
Intervention active period.
Definition: food_labelling_scenario.h:110
TransferCoefficient transfer_coefficient
The transfer coefficient values.
Definition: food_labelling_scenario.h:122
AdjustmentFactor adjustment_risk_factor
The adjustments on risk factors.
Definition: food_labelling_scenario.h:116
PolicyCoverage coverage
The intervention population coverage.
Definition: food_labelling_scenario.h:119
std::vector< PolicyImpact > impacts
Intervention impacts on risk factors.
Definition: food_labelling_scenario.h:113
T females
Females value.
Definition: gender_value.h:23
T males
Males value.
Definition: gender_value.h:20
Defines a virtual population person data type.
Definition: person.h:40
Define the policy population coverage data type.
Definition: food_labelling_scenario.h:29
PolicyCoverage(const std::vector< double > &rates, unsigned int effect_time)
Initialise a new instance of the PolicyCoverage structure.
Definition: food_labelling_scenario.h:36
unsigned int cutoff_time
The coverage effect cut-off time.
Definition: food_labelling_scenario.h:54
double short_term_rate
The short term transfer coefficient value.
Definition: food_labelling_scenario.h:48
double long_term_rate
The long term transfer coefficient value.
Definition: food_labelling_scenario.h:51
Defines the policy impact on risk factors data structure.
Definition: intervention_scenario.h:49
Defines the policy active interval.
Definition: intervention_scenario.h:97
Define the transfer coefficient data type.
Definition: food_labelling_scenario.h:58
unsigned int child_cutoff_age
The child cut-off age (before adult)
Definition: food_labelling_scenario.h:84
double get_value(core::Gender gender, unsigned int age) const noexcept
Gets the transfer coefficient value for a given gender and age.
Definition: food_labelling_scenario.h:90
DoubleGenderValue child
Children transfer coefficient values.
Definition: food_labelling_scenario.h:78
TransferCoefficient()=delete
DoubleGenderValue adult
Adult transfer coefficient values.
Definition: food_labelling_scenario.h:81
TransferCoefficient(std::vector< double > values, unsigned int child_age)
Initialise a new instance of the TransferCoefficient structure.
Definition: food_labelling_scenario.h:65
Entity unique identifier data type.
Definition: identifier.h:17