Open dabele opened 2 years ago
A base for this discussion could be what we had implemented in the parameter DynamicInfectionFromContact
here:
for (auto i = AgeGroup(0); i < shared_params_model.parameters.get_num_groups(); ++i) {
shared_params_model.parameters.template get<BaseInfectiousnessB117>()[i] =
shared_params_model.parameters.template get<InfectionProbabilityFromContact>()[i];
shared_params_model.parameters.template get<BaseInfectiousnessB161>()[i] =
shared_params_model.parameters.template get<InfectionProbabilityFromContact>()[i] * delta_fac;
shared_params_model.parameters.template get<DynamicInfectionFromContact>()[i] = {};
for (size_t t = 0; t < (size_t)tmax; ++t) {
double share_new_variant = std::min(1.0, pow(2, (double)t / 7) / 100.0);
double new_transmission =
(1 - share_new_variant) * shared_params_model.parameters.template get<BaseInfectiousnessB117>()[(AgeGroup)i] +
share_new_variant * shared_params_model.parameters.template get<BaseInfectiousnessB161>()[(AgeGroup)i];
shared_params_model.parameters.template get<DynamicInfectionFromContact>()[i].push_back(
new_transmission);
}
}
Currently, vaccinations and virus variants are applied in
secirv::Simulation::apply
by modifying parameters or directly setting compartments. I think this is not ideal, as they could be included more elegantly insecirv::Model::get_derivatives
.In general we should limit the places in the code where compartments or parameters are modifed, otherwise the model becomes very hard to follow.
E.g., daily first vaccinations are the flow from compartment
Susceptible
toSusceptiblePartiallyImmune
.