model.h Source File
|
CPP API
|
ode_seirdb/model.h
Go to the documentation of this file.
55 : public FlowModel<FP, InfectionState, mio::Populations<FP, AgeGroup, InfectionState>, Parameters<FP>, Flows>
57 using Base = FlowModel<FP, InfectionState, mio::Populations<FP, AgeGroup, InfectionState>, Parameters<FP>, Flows>;
69 : Base(Populations({AgeGroup(num_agegroups), InfectionState::Count}), ParameterSet(AgeGroup(num_agegroups)))
73 void get_flows(Eigen::Ref<const Eigen::VectorX<FP>> pop, Eigen::Ref<const Eigen::VectorX<FP>> y, FP t,
95 const FP contact_rate = params.template get<ContactPatterns<FP>>().get_cont_freq_mat().get_matrix_at(
98 const FP coeffStoE = contact_rate * params.template get<TransmissionProbabilityOnContact<FP>>()[i];
99 const FP coeffStoEDead = contact_rate * params.template get<TransmissionProbabilityFromDead<FP>>()[i];
101 flows[Base::template get_flat_flow_index<InfectionState::Susceptible, InfectionState::Exposed>(i)] +=
104 flows[Base::template get_flat_flow_index<InfectionState::Exposed, InfectionState::Infected>(i)] =
110 flows[Base::template get_flat_flow_index<InfectionState::Infected, InfectionState::Recovered>(i)] =
mio::Index< Tag > size() const
returns the size along the dimension provided as template parameter
Definition: custom_index_array.h:204
size_t get_flat_index(Index const &index) const
get_flat_index returns the flat index into the stored array, given the indices of each category
Definition: custom_index_array.h:309
A FlowModel is a CompartmentalModel defined by the flows between compartments.
Definition: flow_model.h:74
Parameters of the simulation that are the same everywhere within the Model.
Definition: abm/parameters.h:764
Definition: ode_seirdb/model.h:56
void get_flows(Eigen::Ref< const Eigen::VectorX< FP >> pop, Eigen::Ref< const Eigen::VectorX< FP >> y, FP t, Eigen::Ref< Eigen::VectorX< FP >> flows) const override
Definition: ode_seirdb/model.h:73
Model(const Populations &pop, const ParameterSet ¶ms)
Definition: ode_seirdb/model.h:63
void serialize(IOContext &io) const
serialize this.
Definition: ode_seirdb/model.h:124
static IOResult< Model > deserialize(IOContext &io)
deserialize an object of this class.
Definition: ode_seirdb/model.h:136
Parameters of an age-resolved SEIRDB model.
Definition: ode_seirdb/parameters.h:161
@ Susceptible
@ Recovered
@ Infected
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
Range< MultiIndexIterator< Index< Categories... > > > make_index_range(Index< Categories... > dimensions)
Construct a range that can be used to iterate over all MultiIndices in the given dimensions.
Definition: index_range.h:168
boost::outcome_v2::in_place_type_t< T > Tag
Type that is used for overload resolution.
Definition: io.h:407
details::ApplyResultT< F, T... > apply(IOContext &io, F f, const IOResult< T > &... rs)
Evaluate a function with zero or more unpacked IOResults as arguments.
Definition: io.h:481
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
Populations populations
Definition: compartmental_model.h:156
mio::Populations< FP, AgeGroup, InfectionState > Populations
Definition: compartmental_model.h:62
Parameters< FP > ParameterSet
Definition: compartmental_model.h:63
ParameterSet parameters
Definition: compartmental_model.h:157
A Flow defines a possible transition between two Compartments in a FlowModel.
Definition: flow.h:33
Collection of types. Each type is mapped to an index of type size_t.
Definition: type_list.h:32
Generated by