@@ -471,6 +471,25 @@ struct CriticalPerSevere {
471471 }
472472};
473473
474+ /* *
475+ * @brief The percentage of dead patients per hospitalized patients.
476+ * This is a direct mortality probability from the InfectedSevere compartments,
477+ * independent of ICU capacity.
478+ * @tparam FP The floating-point type (default: double).
479+ */
480+ template <typename FP>
481+ struct DeathsPerSevere {
482+ using Type = CustomIndexArray<UncertainValue<FP>, AgeGroup>;
483+ static Type get_default (AgeGroup size)
484+ {
485+ return Type (size, 0 .);
486+ }
487+ static std::string name ()
488+ {
489+ return " DeathsPerSevere" ;
490+ }
491+ };
492+
474493/* *
475494* @brief The percentage of dead patients per ICU patients in the SECIRTS model.
476495* @tparam FP The floating-point type (default: double).
@@ -751,7 +770,7 @@ using ParametersBase = ParameterSet<
751770 TimeWaningPartialImmunity<FP>, TimeWaningImprovedImmunity<FP>, TimeTemporaryImmunityPI<FP>,
752771 TimeTemporaryImmunityII<FP>, TransmissionProbabilityOnContact<FP>, RelativeTransmissionNoSymptoms<FP>,
753772 RecoveredPerInfectedNoSymptoms<FP>, RiskOfInfectionFromSymptomatic<FP>, MaxRiskOfInfectionFromSymptomatic<FP>,
754- SeverePerInfectedSymptoms<FP>, CriticalPerSevere<FP>, DeathsPerCritical<FP>,
773+ SeverePerInfectedSymptoms<FP>, CriticalPerSevere<FP>, DeathsPerSevere<FP>, DeathsPerCritical<FP>,
755774 DaysUntilEffectivePartialVaccination<FP>, DaysUntilEffectiveImprovedVaccination<FP>,
756775 DaysUntilEffectiveBoosterImmunity<FP>, DailyFullVaccinations<FP>, DailyPartialVaccinations<FP>,
757776 DailyBoosterVaccinations<FP>, ReducExposedPartialImmunity<FP>, ReducExposedImprovedImmunity<FP>,
@@ -1019,6 +1038,22 @@ class Parameters : public ParametersBase<FP>
10191038 corrected = true ;
10201039 }
10211040
1041+ if (this ->template get <DeathsPerSevere<FP>>()[i] < 0.0 ||
1042+ this ->template get <DeathsPerSevere<FP>>()[i] > 1.0 ) {
1043+ log_warning (" Constraint check: Parameter DeathsPerSevere changed from {} to {}" ,
1044+ this ->template get <DeathsPerSevere<FP>>()[i], 0 );
1045+ this ->template get <DeathsPerSevere<FP>>()[i] = 0 ;
1046+ corrected = true ;
1047+ }
1048+
1049+ if (this ->template get <CriticalPerSevere<FP>>()[i] + this ->template get <DeathsPerSevere<FP>>()[i] > 1.0 ) {
1050+ log_warning (" Constraint check: CriticalPerSevere + DeathsPerSevere exceed 1.0 for age group {}. "
1051+ " DeathsPerSevere changed from {} to 0." ,
1052+ static_cast <size_t >(i), this ->template get <DeathsPerSevere<FP>>()[i]);
1053+ this ->template get <DeathsPerSevere<FP>>()[i] = 0 ;
1054+ corrected = true ;
1055+ }
1056+
10221057 if (this ->template get <DeathsPerCritical<FP>>()[i] < 0.0 ||
10231058 this ->template get <DeathsPerCritical<FP>>()[i] > 1.0 ) {
10241059 log_warning (" Constraint check: Parameter DeathsPerCritical changed from {} to {}" ,
@@ -1256,6 +1291,18 @@ class Parameters : public ParametersBase<FP>
12561291 return true ;
12571292 }
12581293
1294+ if (this ->template get <DeathsPerSevere<FP>>()[i] < 0.0 ||
1295+ this ->template get <DeathsPerSevere<FP>>()[i] > 1.0 ) {
1296+ log_error (" Constraint check: Parameter DeathsPerSevere smaller {} or larger {}" , 0 , 1 );
1297+ return true ;
1298+ }
1299+
1300+ if (this ->template get <CriticalPerSevere<FP>>()[i] + this ->template get <DeathsPerSevere<FP>>()[i] > 1.0 ) {
1301+ log_error (" Constraint check: CriticalPerSevere + DeathsPerSevere exceed 1.0 for age group {}." ,
1302+ static_cast <size_t >(i));
1303+ return true ;
1304+ }
1305+
12591306 if (this ->template get <DeathsPerCritical<FP>>()[i] < 0.0 ||
12601307 this ->template get <DeathsPerCritical<FP>>()[i] > 1.0 ) {
12611308 log_error (" Constraint check: Parameter DeathsPerCritical smaller {} or larger {}" , 0 , 1 );
0 commit comments