model.h Source File
|
CPP API
|
sde_sirs/model.h
Go to the documentation of this file.
45 : public mio::StochasticModel<FP, InfectionState, mio::Populations<FP, InfectionState>, Parameters<FP>, Flows>
48 using Base = mio::StochasticModel<FP, InfectionState, mio::Populations<FP, InfectionState>, Parameters<FP>, Flows>;
55 void get_flows(Eigen::Ref<const Eigen::VectorX<FP>> pop, Eigen::Ref<const Eigen::VectorX<FP>> y, FP t,
62 sin(std::numbers::pi_v<ScalarType> * ((params.template get<StartDay<FP>>() + t) / 182.5 + 0.5)));
68 flows[this->template get_flat_flow_index<InfectionState::Susceptible, InfectionState::Infected>()] =
70 flows[this->template get_flat_flow_index<InfectionState::Infected, InfectionState::Recovered>()] =
72 flows[this->template get_flat_flow_index<InfectionState::Recovered, InfectionState::Susceptible>()] =
76 void get_noise(Eigen::Ref<const Eigen::VectorX<FP>> pop, Eigen::Ref<const Eigen::VectorX<FP>> y, FP t,
A CompartmentalModel with an additional get_noise member.
Definition: stochastic_model.h:35
auto white_noise(Eigen::Index size) const
Sample a vector of independent standard normal distributed values from the model's RNG.
Definition: stochastic_model.h:66
Definition: sde_sirs/model.h:46
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
Definition: sde_sirs/model.h:55
void get_noise(Eigen::Ref< const Eigen::VectorX< FP >> pop, Eigen::Ref< const Eigen::VectorX< FP >> y, FP t, Eigen::Ref< Eigen::VectorX< FP >> noise) const
Calculate random changes to the population at a certain time point.
Definition: sde_sirs/model.h:76
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_sin< AD_TAPE_REAL > > sin(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:913
@ Susceptible
@ Recovered
@ Infected
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
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
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
static constexpr size_t size()
returns the number of Types in TypeList
Definition: type_list.h:45
The start day in the SIRS model The start day defines in which season the simulation can be started I...
Definition: sde_sirs/parameters.h:108
Generated by