Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1075 Let persons die from hospital (non ICU) in the ABM #1100

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
16 changes: 13 additions & 3 deletions cpp/models/abm/infection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ void Infection::draw_infection_course_forward(PersonalRandomNumberGenerator& rng
case InfectionState::InfectedSevere:
// roll out next infection step
v = uniform_dist(rng);
if (v < 0.5) { // TODO: subject to change
if (v < 0.25) { // TODO: subject to change
time_period = days(params.get<SevereToDead>()[{m_virus_variant, age}]); // TODO: subject to change
next_state = InfectionState::Dead;
} else if (v < 0.5) { // TODO: subject to change
reneSchm marked this conversation as resolved.
Show resolved Hide resolved
time_period = days(params.get<SevereToCritical>()[{m_virus_variant, age}]); // TODO: subject to change
next_state = InfectionState::InfectedCritical;
}
Expand Down Expand Up @@ -271,8 +274,15 @@ TimePoint Infection::draw_infection_course_backward(PersonalRandomNumberGenerato
break;

case InfectionState::Dead:
time_period = days(params.get<CriticalToDead>()[{m_virus_variant, age}]); // TODO: subject to change
previous_state = InfectionState::InfectedCritical;
v = uniform_dist(rng);
if (v < 0.5) {
time_period = days(params.get<SevereToDead>()[{m_virus_variant, age}]); // TODO: subject to change
previous_state = InfectionState::InfectedSevere;
}
else {
time_period = days(params.get<CriticalToDead>()[{m_virus_variant, age}]); // TODO: subject to change
previous_state = InfectionState::InfectedCritical;
}
break;

default:
Expand Down
20 changes: 19 additions & 1 deletion cpp/models/abm/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ struct SevereToRecovered {
}
};

struct SevereToDead {
reneSchm marked this conversation as resolved.
Show resolved Hide resolved
using Type = CustomIndexArray<UncertainValue<>, VirusVariant, AgeGroup>;
static Type get_default(AgeGroup size)
{
return Type({VirusVariant::Count, size}, 1.);
}
static std::string name()
{
return "SevereToDead";
}
};

struct CriticalToRecovered {
using Type = CustomIndexArray<UncertainValue<>, VirusVariant, AgeGroup>;
static Type get_default(AgeGroup size)
Expand Down Expand Up @@ -549,7 +561,7 @@ struct AgeGroupGotoWork {

using ParametersBase =
ParameterSet<IncubationPeriod, InfectedNoSymptomsToSymptoms, InfectedNoSymptomsToRecovered,
InfectedSymptomsToRecovered, InfectedSymptomsToSevere, SevereToCritical, SevereToRecovered,
InfectedSymptomsToRecovered, InfectedSymptomsToSevere, SevereToCritical, SevereToRecovered, SevereToDead,
CriticalToDead, CriticalToRecovered, RecoveredToSusceptible, ViralLoadDistributions,
InfectivityDistributions, DetectInfection, MaskProtection, AerosolTransmissionRates, LockdownDate,
QuarantineDuration, SocialEventRate, BasicShoppingRate, WorkRatio, SchoolRatio, GotoWorkTimeMinimum,
Expand Down Expand Up @@ -688,6 +700,12 @@ class Parameters : public ParametersBase
return true;
}

if (this->get<SevereToDead>()[{VirusVariant::Wildtype, i}] < 0.0) {
log_error("Constraint check: Parameter SevereToDead of age group {:.0f} smaller than {:d}",
(size_t)i, 0);
return true;
}

if (this->get<CriticalToDead>()[{VirusVariant::Wildtype, i}] < 0.0) {
log_error("Constraint check: Parameter CriticalToDead of age group {:.0f} smaller than {:d}", (size_t)i,
0);
Expand Down
12 changes: 12 additions & 0 deletions cpp/simulations/abm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.001;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.186;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.015;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.001;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.143;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.001;

Expand All @@ -491,6 +492,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.001;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.186;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.015;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.001;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.143;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.001;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.;
Expand All @@ -504,6 +506,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.003;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.157;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.013;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.021;
reneSchm marked this conversation as resolved.
Show resolved Hide resolved
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.126;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.021;

Expand All @@ -516,6 +519,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.009;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.113;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.02;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.008;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.05;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.008;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.;
Expand All @@ -529,6 +533,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.024;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.083;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.035;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.023;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.035;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.023;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.;
Expand All @@ -541,6 +546,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.033;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.055;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.036;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.052;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.035;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.052;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.;
Expand All @@ -555,6 +561,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.001;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.186;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.015;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.001;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.143;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.001;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_0_to_4}] = 0.0;
Expand All @@ -567,6 +574,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.001;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.186;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.015;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.001;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.143;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.001;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_5_to_14}] = 0.0;
Expand All @@ -580,6 +588,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.001;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.157;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.013;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.021;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.126;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.021;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_15_to_34}] = 0.0;
Expand All @@ -593,6 +602,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.003;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.113;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.02;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.008;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.05;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.008;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_35_to_59}] = 0.0;
Expand All @@ -606,6 +616,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.009;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.083;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.035;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.023;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.035;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.023;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_60_to_79}] = 0.0;
Expand All @@ -618,6 +629,7 @@ void set_parameters(mio::abm::Parameters params)
params.get<mio::abm::InfectedSymptomsToSevere>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.012;
params.get<mio::abm::SevereToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.055;
params.get<mio::abm::SevereToCritical>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.036;
params.get<mio::abm::SevereToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.052;
params.get<mio::abm::CriticalToRecovered>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.035;
params.get<mio::abm::CriticalToDead>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.052;
params.get<mio::abm::RecoveredToSusceptible>()[{mio::abm::VirusVariant::Wildtype, age_group_80_plus}] = 0.0;
Expand Down
Loading
Loading