parameter_space.h Source File
|
CPP API
|
ode_secir/parameter_space.h
Go to the documentation of this file.
52 auto lower_bound = min<FP>(max<FP>(min_val, (1 - dev_rel * 2.6) * v), 0.1 * std::numeric_limits<FP>::max());
53 auto upper_bound = min<FP>(max<FP>(min_val, (1 + dev_rel * 2.6) * v), 0.5 * std::numeric_limits<FP>::max());
55 if (mio::floating_point_equal<FP>(lower_bound, upper_bound, mio::Limits<FP>::zero_tolerance())) {
57 mio::log_debug("Bounded ParameterDistribution has standard deviation close to zero. Therefore constant "
64 //add add limits for nonsense big values. Also mscv has a problem with a few doubles so this fixes it
65 lower_bound, upper_bound, min<FP>(max<FP>(min_val, v.value()), 0.3 * std::numeric_limits<FP>::max()),
110 for (size_t i = 0; i < model.parameters.template get<ContactPatterns<FP>>().get_cont_freq_mat().get_num_matrices();
114 auto groups = Eigen::VectorX<FP>::Constant(Eigen::Index(model.parameters.get_num_groups().get()), 1.0);
118 set_distribution(model.parameters.template get<ContactPatterns<FP>>().get_dampings()[0].get_value(), 0.0);
144 model.populations.template set_difference_from_group_total<AgeGroup>({i, InfectionState::Susceptible},
146 model.populations.template set_difference_from_group_total<AgeGroup>({i, InfectionState::Susceptible},
166 model.parameters.template get<MaxRiskOfInfectionFromSymptomatic<FP>>()[AgeGroup(0)].draw_sample();
208 Graph<Model<FP>, MobilityParameters<FP>> draw_sample(Graph<Model<FP>, MobilityParameters<FP>>& graph)
217 auto& shared_dynamic_npis = shared_params_model.parameters.template get<DynamicNPIsInfectedSymptoms<FP>>();
219 auto& shared_dynamic_npis_delay = shared_params_model.parameters.template get<DynamicNPIsImplementationDelay<FP>>();
232 auto local_holidays = node_model.parameters.template get<ContactPatterns<FP>>().get_school_holidays();
236 node_model.parameters.template get<ContactPatterns<FP>>().get_school_holidays() = local_holidays;
246 apply_dampings(edge_params.get_coefficients(), shared_contacts.get_dampings(), [&edge_params](auto& v) {
requires std::constructible_from< EdgePropertyT, Args... > void add_edge(size_t start_node_idx, size_t end_node_idx, Args &&... args)
add an edge to the graph.
Definition: graph.h:238
requires std::constructible_from< NodePropertyT, Args... > void add_node(int id, Args &&... args)
add a node to the graph.
Definition: graph.h:223
An Index with more than one template parameter combines several Index objects.
Definition: index.h:181
parameters that influence mobility.
Definition: metapopulation_mobility_instant.h:123
Definition: parameter_distributions.h:813
Definition: parameter_distributions.h:160
Definition: ode_secir/model.h:64
FP value() const
Conversion to scalar by returning the scalar contained in UncertainValue.
Definition: uncertain_value.h:118
static min_max_return_type< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > >::type min(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &a, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &b)
Definition: ad.hpp:2599
static min_max_return_type< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > >::type max(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &a, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &b)
Definition: ad.hpp:2596
void draw_sample(Model< FP > &model)
Draws a sample from Model parameter distributions and stores sample values as SecirParams parameter v...
Definition: ode_secir/parameter_space.h:199
@ InfectedSevere
@ Susceptible
@ InfectedCritical
@ Recovered
@ Exposed
@ InfectedSymptoms
@ InfectedNoSymptoms
void draw_sample_demographics(Model< FP > &model)
draws a sample from the specified distributions for all parameters related to the demographics,...
Definition: ode_secir/parameter_space.h:126
void set_params_distributions_normal(Model< FP > &model, FP t0, FP tmax, FP dev_rel)
Sets alls SecirParams parameters normally distributed, using the current value and a given standard d...
Definition: ode_secir/parameter_space.h:47
void draw_sample_infection(Model< FP > &model)
draws a sample from the specified distributions for all parameters related to the infection.
Definition: ode_secir/parameter_space.h:156
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
void apply_dampings(DampingExpression &damping_expression, const DampingSamplings &dampings, F make_matrix)
add sampled dampings to a damping expression.
Definition: damping_sampling.h:256
void log_debug(spdlog::string_view_t fmt, const Args &... args)
Definition: logging.h:118
constexpr std::tuple_element< I, std::tuple< Index< CategoryTags >... > >::type & get(Index< CategoryTags... > &i) noexcept
Retrieves the Index (by reference) at the Ith position of a MultiIndex.
Definition: index.h:294
The AgeGroup struct is used as a dynamically sized tag for all age dependent categories.
Definition: age_group.h:32
bool apply_constraints()
Checks whether the model satisfies all constraints.
Definition: compartmental_model.h:131
the contact patterns within the society are modelled using an UncertainContactMatrix
Definition: ode_secir/parameters.h:308
the percentage of ICU patients per hospitalized patients in the SECIR model
Definition: ode_secir/parameters.h:276
the percentage of dead patients per ICU patients in the SECIR model
Definition: ode_secir/parameters.h:292
The delay with which DynamicNPIs are implemented and enforced after exceedance of threshold.
Definition: ode_secir/parameters.h:340
risk of infection from symptomatic cases increases as test and trace capacity is exceeded.
Definition: ode_secir/parameters.h:244
the percentage of asymptomatic cases in the SECIR model
Definition: ode_secir/parameters.h:212
the relative InfectedNoSymptoms infectability
Definition: ode_secir/parameters.h:196
the risk of infection from symptomatic cases in the SECIR model
Definition: ode_secir/parameters.h:228
the seasonality in the SECIR model the seasonality is given as (1+k*sin()) where the sine curve is be...
Definition: ode_secir/parameters.h:64
the percentage of hospitalized patients per infected patients in the SECIR model
Definition: ode_secir/parameters.h:260
capacity to test and trace contacts of infected for quarantine per day.
Definition: ode_secir/parameters.h:356
the time people are treated by ICU before returning home in the SECIR model in day unit
Definition: ode_secir/parameters.h:164
the (mean) time in day unit for asymptomatic cases that are infectious but have not yet developed sym...
Definition: ode_secir/parameters.h:113
the time people are 'simply' hospitalized before returning home in the SECIR model in day unit
Definition: ode_secir/parameters.h:147
the infectious time for symptomatic cases that are infected but who do not need to be hsopitalized in...
Definition: ode_secir/parameters.h:130
probability of getting infected from a contact
Definition: ode_secir/parameters.h:180
Generated by