@@ -119,6 +119,38 @@ struct TestAndTraceCapacity {
119119 }
120120};
121121
122+ /* *
123+ * @brief Multiplier for the test and trace capacity to determine when it is considered overloaded from cases without symptoms.
124+ */
125+ template <typename FP = double >
126+ struct TestAndTraceCapacityMaxRiskNoSymptoms {
127+ using Type = UncertainValue<FP>;
128+ static Type get_default (AgeGroup)
129+ {
130+ return Type (2.0 );
131+ }
132+ static std::string name ()
133+ {
134+ return " TestAndTraceCapacityMaxRiskNoSymptoms" ;
135+ }
136+ };
137+
138+ /* *
139+ * @brief Multiplier for the test and trace capacity to determine when it is considered overloaded by symptomatic cases.
140+ */
141+ template <typename FP = double >
142+ struct TestAndTraceCapacityMaxRiskSymptoms {
143+ using Type = UncertainValue<FP>;
144+ static Type get_default (AgeGroup)
145+ {
146+ return Type (15.0 );
147+ }
148+ static std::string name ()
149+ {
150+ return " TestAndTraceCapacityMaxRiskSymptoms" ;
151+ }
152+ };
153+
122154/* *
123155 * @brief the contact patterns within the society are modelled using an UncertainContactMatrix
124156 */
@@ -573,19 +605,18 @@ struct InfectiousnessNewVariant {
573605};
574606
575607template <typename FP = double >
576- using ParametersBase =
577- ParameterSet<StartDay, Seasonality<FP>, ICUCapacity<FP>, TestAndTraceCapacity<FP>, ContactPatterns<FP>,
578- DynamicNPIsInfectedSymptoms<FP>, TimeExposed<FP>, TimeInfectedNoSymptoms<FP>, TimeInfectedSymptoms<FP>,
579- TimeInfectedSevere<FP>, TimeInfectedCritical<FP>, TransmissionProbabilityOnContact<FP>,
580- RelativeTransmissionNoSymptoms<FP>, RecoveredPerInfectedNoSymptoms<FP>,
581- RiskOfInfectionFromSymptomatic<FP>, MaxRiskOfInfectionFromSymptomatic<FP>,
582- SeverePerInfectedSymptoms<FP>, CriticalPerSevere<FP>, DeathsPerCritical<FP>, VaccinationGap<FP>,
583- DaysUntilEffectivePartialImmunity<FP>, DaysUntilEffectiveImprovedImmunity<FP>,
584- DailyFullVaccination<FP>, DailyFirstVaccination<FP>, ReducExposedPartialImmunity<FP>,
585- ReducExposedImprovedImmunity<FP>, ReducInfectedSymptomsPartialImmunity<FP>,
586- ReducInfectedSymptomsImprovedImmunity<FP>, ReducInfectedSevereCriticalDeadPartialImmunity<FP>,
587- ReducInfectedSevereCriticalDeadImprovedImmunity<FP>, ReducTimeInfectedMild<FP>,
588- InfectiousnessNewVariant<FP>, StartDayNewVariant>;
608+ using ParametersBase = ParameterSet<
609+ StartDay, Seasonality<FP>, ICUCapacity<FP>, TestAndTraceCapacity<FP>, TestAndTraceCapacityMaxRiskNoSymptoms<FP>,
610+ TestAndTraceCapacityMaxRiskSymptoms<FP>, ContactPatterns<FP>, DynamicNPIsInfectedSymptoms<FP>, TimeExposed<FP>,
611+ TimeInfectedNoSymptoms<FP>, TimeInfectedSymptoms<FP>, TimeInfectedSevere<FP>, TimeInfectedCritical<FP>,
612+ TransmissionProbabilityOnContact<FP>, RelativeTransmissionNoSymptoms<FP>, RecoveredPerInfectedNoSymptoms<FP>,
613+ RiskOfInfectionFromSymptomatic<FP>, MaxRiskOfInfectionFromSymptomatic<FP>, SeverePerInfectedSymptoms<FP>,
614+ CriticalPerSevere<FP>, DeathsPerCritical<FP>, VaccinationGap<FP>, DaysUntilEffectivePartialImmunity<FP>,
615+ DaysUntilEffectiveImprovedImmunity<FP>, DailyFullVaccination<FP>, DailyFirstVaccination<FP>,
616+ ReducExposedPartialImmunity<FP>, ReducExposedImprovedImmunity<FP>, ReducInfectedSymptomsPartialImmunity<FP>,
617+ ReducInfectedSymptomsImprovedImmunity<FP>, ReducInfectedSevereCriticalDeadPartialImmunity<FP>,
618+ ReducInfectedSevereCriticalDeadImprovedImmunity<FP>, ReducTimeInfectedMild<FP>, InfectiousnessNewVariant<FP>,
619+ StartDayNewVariant>;
589620
590621/* *
591622 * @brief Parameters of an age-resolved SECIR/SECIHURD model with paths for partial and improved immunity through vaccination.
@@ -685,6 +716,27 @@ class Parameters : public ParametersBase<FP>
685716 corrected = true ;
686717 }
687718
719+ if (this ->template get <TestAndTraceCapacity<FP>>() < 0.0 ) {
720+ log_warning (" Constraint check: Parameter TestAndTraceCapacity changed from {} to {}" ,
721+ this ->template get <TestAndTraceCapacity<FP>>(), 0 );
722+ this ->template set <TestAndTraceCapacity<FP>>(0 );
723+ corrected = true ;
724+ }
725+
726+ if (this ->template get <TestAndTraceCapacityMaxRiskSymptoms<FP>>() < 0.0 ) {
727+ log_warning (" Constraint check: Parameter TestAndTraceCapacityMaxRiskSymptoms changed from {} to {}" ,
728+ this ->template get <TestAndTraceCapacityMaxRiskSymptoms<FP>>(), 0 );
729+ this ->template set <TestAndTraceCapacityMaxRiskSymptoms<FP>>(0 );
730+ corrected = true ;
731+ }
732+
733+ if (this ->template get <TestAndTraceCapacityMaxRiskNoSymptoms<FP>>() < 0.0 ) {
734+ log_warning (" Constraint check: Parameter TestAndTraceCapacityMaxRiskNoSymptoms changed from {} to {}" ,
735+ this ->template get <TestAndTraceCapacityMaxRiskNoSymptoms<FP>>(), 0 );
736+ this ->template set <TestAndTraceCapacityMaxRiskNoSymptoms<FP>>(0 );
737+ corrected = true ;
738+ }
739+
688740 const double tol_times = 1e-1 ; // accepted tolerance for compartment stays
689741
690742 for (auto i = AgeGroup (0 ); i < AgeGroup (m_num_groups); ++i) {
@@ -789,7 +841,7 @@ class Parameters : public ParametersBase<FP>
789841 }
790842
791843 if (this ->template get <DaysUntilEffectivePartialImmunity<FP>>()[i] < 0.0 ) {
792- log_warning (" Constraint check: Parameter DeathsPerCritical changed from {} to {}" ,
844+ log_warning (" Constraint check: Parameter DaysUntilEffectivePartialImmunity changed from {} to {}" ,
793845 this ->template get <DaysUntilEffectivePartialImmunity<FP>>()[i], 0 );
794846 this ->template get <DaysUntilEffectivePartialImmunity<FP>>()[i] = 0 ;
795847 corrected = true ;
@@ -877,12 +929,27 @@ class Parameters : public ParametersBase<FP>
877929 {
878930 const double tol_times = 1e-1 ; // accepted tolerance for compartment stays
879931 if (this ->template get <Seasonality<FP>>() < 0.0 || this ->template get <Seasonality<FP>>() > 0.5 ) {
880- log_error (" Constraint check: Parameter m_seasonality smaller {} or larger {}" , 0 , 0.5 );
932+ log_error (" Constraint check: Parameter Seasonality smaller {} or larger {}" , 0 , 0.5 );
881933 return true ;
882934 }
883935
884936 if (this ->template get <ICUCapacity<FP>>() < 0.0 ) {
885- log_error (" Constraint check: Parameter m_icu_capacity smaller {}" , 0 );
937+ log_error (" Constraint check: Parameter ICUCapacity smaller {}" , 0 );
938+ return true ;
939+ }
940+
941+ if (this ->template get <TestAndTraceCapacity<FP>>() < 0.0 ) {
942+ log_error (" Constraint check: Parameter TestAndTraceCapacity smaller {}" , 0 );
943+ return true ;
944+ }
945+
946+ if (this ->template get <TestAndTraceCapacityMaxRiskSymptoms<FP>>() < 0.0 ) {
947+ log_error (" Constraint check: Parameter TestAndTraceCapacityMaxRiskSymptoms smaller {}" , 0 );
948+ return true ;
949+ }
950+
951+ if (this ->template get <TestAndTraceCapacityMaxRiskNoSymptoms<FP>>() < 0.0 ) {
952+ log_error (" Constraint check: Parameter TestAndTraceCapacityMaxRiskNoSymptoms smaller {}" , 0 );
886953 return true ;
887954 }
888955
0 commit comments