diff --git a/docs/source/usage/how_to_run.rst b/docs/source/usage/how_to_run.rst index f852044f..98b6d274 100644 --- a/docs/source/usage/how_to_run.rst +++ b/docs/source/usage/how_to_run.rst @@ -204,6 +204,8 @@ The following inputs specify the disease parameters: Probability of death when in hospital, in the ICU, for age groups: 0-4, 5-17, 18-29, 30-49, 50-64, 65 and over. * ``disease.ventCVF`` (`list of float`, default ``0.20 0.20 0.20 0.45 0.45 1.0``) Probability of death when in hospital, on ventilator, for age groups: 0-4, 5-17, 18-29, 30-49, 50-64, 65 and over. +* ``disease.unhospCVF`` (`list of float`, default ``0.0 0.0 0.0 0.0 0.0 0.0``) + Probability of death when not in hospital, for age groups: 0-4, 5-17, 18-29, 30-49, 50-64, 65 and over. `Note`: for ``agent.number_of_diseases > 1``, the disease parameters that are common to all the diseases can be specified as above. Any parameter that is `different for a specific disease` diff --git a/examples/inputs.defaults b/examples/inputs.defaults index a5a84139..64e73eb6 100644 --- a/examples/inputs.defaults +++ b/examples/inputs.defaults @@ -153,3 +153,5 @@ disease.hospCVF = 0 0 0 0 0 0 disease.icuCVF = 0 0 0 0 0 0.26 # Probability of death when on a ventilator, for age groups 0-4, 5-17, 18-29, 30-49, 50-64, 64+ disease.ventCVF = 0.20 0.20 0.20 0.45 0.45 1.0 +# Probability of death when not in hospital, for age groups 0-4, 5-17, 18-29, 30-49, 50-64, 64+ +disease.unhospCVF = 0.0 0.0 0.0 0.0 0.0 0.0 diff --git a/src/DiseaseParm.H b/src/DiseaseParm.H index bc9ccdae..823e2eb0 100644 --- a/src/DiseaseParm.H +++ b/src/DiseaseParm.H @@ -113,6 +113,8 @@ struct DiseaseParm { {Real(0), Real(0), Real(0), Real(0), Real(0), Real(0.26)}, {Real(0.20), Real(0.20), Real(0.20), Real(0.45), Real(0.45), Real(1.0)}}; + /*! Probabilites of dying while *not* in hospital for age groups */ + Real m_unhospToDeath[AgeGroups::total] = {Real(0), Real(0), Real(0), Real(0), Real(0), Real(0)}; DiseaseParm (const std::string& dname) { memset(disease_name, 0, 50); diff --git a/src/DiseaseParm.cpp b/src/DiseaseParm.cpp index a503da5f..855d0b3b 100644 --- a/src/DiseaseParm.cpp +++ b/src/DiseaseParm.cpp @@ -95,6 +95,7 @@ void DiseaseParm::readInputs (const std::string& a_pp_str /*!< Parmparse string queryArray(pp, "CHR", m_CHR, AgeGroups::total); queryArray(pp, "CIC", m_CIC, AgeGroups::total); queryArray(pp, "CVE", m_CVE, AgeGroups::total); + queryArray(pp, "unhospCVF", m_unhospToDeath, AgeGroups::total); queryArray(pp, "hospCVF", m_hospToDeath[DiseaseStats::hospitalization], AgeGroups::total); queryArray(pp, "icuCVF", m_hospToDeath[DiseaseStats::ICU], AgeGroups::total); queryArray(pp, "ventCVF", m_hospToDeath[DiseaseStats::ventilator], AgeGroups::total); diff --git a/src/HospitalModel.H b/src/HospitalModel.H index 5d9fdfc8..1e6b19ec 100644 --- a/src/HospitalModel.H +++ b/src/HospitalModel.H @@ -123,6 +123,12 @@ void HospitalModel::treatAgents (PCType& a_agents, /*!< ParallelForRNG(np, [=] AMREX_GPU_DEVICE (int i, RandomEngine const& engine) noexcept { if (!inHospital(i, ptd)) { // agent is not in hospital + // determine if agent dies anyway. + if (Random(engine) < disease_parm_d->m_unhospToDeath[age_group_ptr[i]]) { + is_alive_ptr[i] = 0; + flag_status_ptr[i] *= -1; + status_ptrs[d][i] = Status::dead; + } return; } if (counter_ptrs[d][i] == Math::floor(incubation_per_ptrs[d][i])) {