model.h Source File
|
CPP API
|
ide_secir/model.h
Go to the documentation of this file.
42 IOResult<void> set_initial_flows(Model& model, const ScalarType dt, const std::vector<EntryType> rki_data,
68 CustomIndexArray<ScalarType, AgeGroup> total_confirmed_cases_init = CustomIndexArray<ScalarType, AgeGroup>());
90 return (static_cast<int>(size_t(agegroup)) * int(InfectionTransition::Count) + int(transition_idx));
163 // Attention: populations and transitions do not necessarily have the same number of time points due to the
197 void compute_compartment_from_flows(ScalarType dt, Eigen::Index idx_InfectionState, AgeGroup group,
257 void compute_flow(Eigen::Index idx_InfectionTransitions, Eigen::Index idx_IncomingFlow, ScalarType dt,
273 void compute_flow(Eigen::Index idx_InfectionTransitions, Eigen::Index idx_IncomingFlow, ScalarType dt,
318 // ---- Functionality to set vectors with necessary information regarding TransitionDistributions. ----
363 // of Type AgeGroup containing a Vector containing the support_max for all TransitionDistributions.
366 //of Type AgeGroup containing a Vector containing the approximated derivative for all TransitionDistributions for
370 // of Type AgeGroup containing a Vector containing the weighted TransitionDistributions for all necessary time
374 // In the Simulation class, the actual simulation is performed which is why it needs access to the here
377 // In set_initial_flows(), we compute initial flows based on RKI data using the (private) compute_flow() function
380 friend IOResult<void> set_initial_flows(Model& model, const ScalarType dt, const std::vector<EntryType> rki_data,
A class template for an array with custom indices.
Definition: custom_index_array.h:136
Definition: ide_secir/model.h:46
void initial_compute_compartments_infection(ScalarType dt)
Computes the values of the infection compartments subset at initialization.
Definition: ide_secir/model.cpp:232
void flows_current_timestep(ScalarType dt)
Sets all required flows for the current last timestep in transitions.
Definition: ide_secir/model.cpp:474
void set_transitiondistributions_derivative(ScalarType dt)
Setter for the vector m_transitiondistributions_derivative that contains the approximated derivative ...
Definition: ide_secir/model.cpp:677
ScalarType m_tol
Tolerance used to calculate the maximum support of the TransitionDistributions.
Definition: ide_secir/model.h:358
void compute_flow(Eigen::Index idx_InfectionTransitions, Eigen::Index idx_IncomingFlow, ScalarType dt, Eigen::Index current_time_index, AgeGroup group)
Computes size of a flow.
Definition: ide_secir/model.cpp:438
void set_transitiondistributions_support_max(ScalarType dt)
Setter for the vector m_transitiondistributions_support_max that contains the support_max for all Tra...
Definition: ide_secir/model.cpp:664
void compute_forceofinfection(ScalarType dt, bool initialization=false)
Computes force of infection for the current last time in transitions.
Definition: ide_secir/model.cpp:582
bool check_constraints(ScalarType dt) const
Checks constraints on model parameters and initial data.
Definition: ide_secir/model.cpp:75
int get_state_flat_index(Eigen::Index state_idx, AgeGroup agegroup) const
Returns a flat index for the TimeSeries populations which contains values for the InfectionStates.
Definition: ide_secir/model.h:103
void set_transitiondistributions_in_forceofinfection(ScalarType dt)
Setter for the vector m_transitiondistributions_in_forceofinfection.
Definition: ide_secir/model.cpp:705
int get_transition_flat_index(Eigen::Index transition_idx, AgeGroup agegroup) const
Returns a flat index for the TimeSeries transitions which contains values for the InfectionTransition...
Definition: ide_secir/model.h:88
void initial_compute_compartments(ScalarType dt)
Computes the values of compartments at initialization.
Definition: ide_secir/model.cpp:263
CustomIndexArray< ScalarType, AgeGroup > m_N
Vector containing the total population size of the considered region for every AgeGroup.
Definition: ide_secir/model.h:357
void set_tol_for_support_max(ScalarType new_tol)
Setter for the tolerance used to calculate the maximum support of the TransitionDistributions.
Definition: ide_secir/model.h:156
int get_initialization_method_compartments() const
Returns the index of the automatically selected initialization method.
Definition: ide_secir/model.h:136
CustomIndexArray< ScalarType, AgeGroup > m_forceofinfection
Force of infection term needed for numerical scheme.
Definition: ide_secir/model.h:355
TimeSeries< ScalarType > transitions
TimeSeries containing points of time and the corresponding number of individuals transitioning from.
Definition: ide_secir/model.h:166
Model(TimeSeries< ScalarType > &&transitions_init, CustomIndexArray< ScalarType, AgeGroup > N_init, CustomIndexArray< ScalarType, AgeGroup > deaths_init, size_t num_agegroups, CustomIndexArray< ScalarType, AgeGroup > total_confirmed_cases_init=CustomIndexArray< ScalarType, AgeGroup >())
Constructor to create an IDE-SECIR model.
Definition: ide_secir/model.cpp:39
TimeSeries< ScalarType > populations
TimeSeries containing points of time and the corresponding number of.
Definition: ide_secir/model.h:168
CustomIndexArray< ScalarType, AgeGroup > total_confirmed_cases
CustomIndexArray that contains the total number of confirmed cases at time t0 for every AgeGroup.
Definition: ide_secir/model.h:171
CustomIndexArray< std::vector< ScalarType >, AgeGroup > m_transitiondistributions_support_max
CustomIndexArray.
Definition: ide_secir/model.h:362
friend IOResult< void > set_initial_flows(Model &model, const ScalarType dt, const std::vector< EntryType > rki_data, const Date date, const CustomIndexArray< ScalarType, AgeGroup > scale_confirmed_cases)
ParameterSet parameters
ParameterSet of Model Parameters.
Definition: ide_secir/model.h:162
void update_compartment_from_flow(InfectionState infectionState, std::vector< InfectionTransition > const &IncomingFlows, std::vector< InfectionTransition > const &OutgoingFlows, AgeGroup group)
Updates the values of one compartment using flows.
Definition: ide_secir/model.cpp:515
CustomIndexArray< std::vector< std::vector< ScalarType > >, AgeGroup > m_transitiondistributions_derivative
CustomIndexArray.
Definition: ide_secir/model.h:365
void compute_compartment_from_flows(ScalarType dt, Eigen::Index idx_InfectionState, AgeGroup group, Eigen::Index idx_IncomingFlow, int idx_TransitionDistribution1, int idx_TransitionDistribution2=0)
Compute the compartment specified in idx_InfectionState at the current time – only using historic flo...
Definition: ide_secir/model.cpp:193
ScalarType get_global_support_max(ScalarType dt) const
Getter for the global support_max, i.e.
Definition: ide_secir/model.cpp:150
void compute_susceptibles(ScalarType dt)
Computes number of Susceptibles for the current last time in populations.
Definition: ide_secir/model.cpp:426
size_t get_num_agegroups() const
Getter for number of age groups.
Definition: ide_secir/model.h:146
void update_compartments()
Updates the values of all compartments except Susceptible at initialization.
Definition: ide_secir/model.cpp:534
CustomIndexArray< std::vector< std::vector< ScalarType > >, AgeGroup > m_transitiondistributions_in_forceofinfection
CustomIndexArray.
Definition: ide_secir/model.h:369
size_t m_num_agegroups
Number of Age Groups.
Definition: ide_secir/model.h:359
int m_initialization_method
Gives the index of the method used for the initialization of the model.
Definition: ide_secir/model.h:360
Parameters of an age-resolved SECIR/SECIHURD model.
Definition: ide_secir/parameters.h:212
run the simulation in discrete steps and report results.
Definition: models/ide_secir/simulation.h:38
InfectionState
The InfectionState enum describes the possible categories for the infectious state of persons.
Definition: ide_secir/infection_state.h:36
IOResult< void > set_initial_flows(Model &model, const ScalarType dt, const std::vector< EntryType > rki_data, const Date date, const CustomIndexArray< ScalarType, AgeGroup > scale_confirmed_cases)
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
boost::outcome_v2::unchecked< T, IOStatus > IOResult
Value-or-error type for operations that return a value but can fail.
Definition: io.h:353
The AgeGroup struct is used as a dynamically sized tag for all age dependent categories.
Definition: age_group.h:32
Generated by