From 8ccb8f12ce5126ed2c18e1c180c5acc074826291 Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Mon, 27 Jan 2025 20:15:06 -0800 Subject: [PATCH] Allow for agents to die directly (without hospitalization) --- src/DiseaseParm.H | 4 ++++ src/DiseaseParm.cpp | 1 + src/HospitalModel.H | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/DiseaseParm.H b/src/DiseaseParm.H index 5479fff..0b3cebb 100644 --- a/src/DiseaseParm.H +++ b/src/DiseaseParm.H @@ -115,6 +115,10 @@ 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 8f6b16c..ef397ce 100644 --- a/src/DiseaseParm.cpp +++ b/src/DiseaseParm.cpp @@ -94,6 +94,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 692b778..f570960 100644 --- a/src/HospitalModel.H +++ b/src/HospitalModel.H @@ -132,6 +132,12 @@ void HospitalModel::treatAgents(PCType& a_agents, /*!< A { 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])) {