@@ -171,12 +171,13 @@ class Parameters : public ParametersBase
171
171
* @param dt Time step size which is used to get model specific StateAgeFunction%s support.
172
172
* @return Returns true if one (or more) constraint(s) are not satisfied, otherwise false.
173
173
*/
174
- bool check_constraints (ScalarType dt = 0.1 ) const
174
+ bool check_constraints () const
175
175
{
176
- size_t check_eval_min = 50 ; // parameter defining minimal window on x-axis
177
- for (size_t i = 0 ;
178
- i < std::min (check_eval_min, (size_t )this ->get <TransmissionProbabilityOnContact>().get_support_max (dt));
179
- i++) {
176
+ // For parameters potentially depending on the infectious age, values are checked
177
+ // equidistantly on a realistic maximum window.
178
+ // Please note that this is an incomplete check on correctness.
179
+ size_t infectious_window_check = 50 ; // parameter defining minimal window on x-axis
180
+ for (size_t i = 0 ; i < infectious_window_check; i++) {
180
181
if (this ->get <TransmissionProbabilityOnContact>().eval ((ScalarType)i) < 0.0 ||
181
182
this ->get <TransmissionProbabilityOnContact>().eval ((ScalarType)i) > 1.0 ) {
182
183
log_error (" Constraint check: TransmissionProbabilityOnContact smaller {:d} or larger {:d} at some "
@@ -186,9 +187,7 @@ class Parameters : public ParametersBase
186
187
}
187
188
}
188
189
189
- for (size_t i = 0 ;
190
- i < std::min (check_eval_min, (size_t )this ->get <RelativeTransmissionNoSymptoms>().get_support_max (dt));
191
- i++) {
190
+ for (size_t i = 0 ; i < infectious_window_check; i++) {
192
191
if (this ->get <RelativeTransmissionNoSymptoms>().eval ((ScalarType)i) < 0.0 ||
193
192
this ->get <RelativeTransmissionNoSymptoms>().eval ((ScalarType)i) > 1.0 ) {
194
193
log_error (" Constraint check: RelativeTransmissionNoSymptoms smaller {:d} or larger {:d} at some "
@@ -198,9 +197,7 @@ class Parameters : public ParametersBase
198
197
}
199
198
}
200
199
201
- for (size_t i = 0 ;
202
- i < std::min (check_eval_min, (size_t )this ->get <RiskOfInfectionFromSymptomatic>().get_support_max (dt));
203
- i++) {
200
+ for (size_t i = 0 ; i < infectious_window_check; i++) {
204
201
if (this ->get <RiskOfInfectionFromSymptomatic>().eval ((ScalarType)i) < 0.0 ||
205
202
this ->get <RiskOfInfectionFromSymptomatic>().eval ((ScalarType)i) > 1.0 ) {
206
203
log_error (" Constraint check: RiskOfInfectionFromSymptomatic smaller {:d} or larger {:d} at some "
0 commit comments