@@ -74,23 +74,23 @@ class Model
7474
7575 ScalarType support_max = std::max (
7676 {parameters.get <TransitionDistributions>()[(int )InfectionTransition::ExposedToInfectedNoSymptoms]
77- .get_support_max (dt),
77+ .get_support_max (dt, m_tol ),
7878 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedNoSymptomsToInfectedSymptoms]
79- .get_support_max (dt),
79+ .get_support_max (dt, m_tol ),
8080 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedNoSymptomsToRecovered]
81- .get_support_max (dt),
81+ .get_support_max (dt, m_tol ),
8282 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedSymptomsToInfectedSevere]
83- .get_support_max (dt),
83+ .get_support_max (dt, m_tol ),
8484 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedSymptomsToRecovered]
85- .get_support_max (dt),
85+ .get_support_max (dt, m_tol ),
8686 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedSevereToInfectedCritical]
87- .get_support_max (dt),
87+ .get_support_max (dt, m_tol ),
8888 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedSevereToRecovered]
89- .get_support_max (dt),
89+ .get_support_max (dt, m_tol ),
9090 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedCriticalToDead]
91- .get_support_max (dt),
91+ .get_support_max (dt, m_tol ),
9292 parameters.get <TransitionDistributions>()[(int )InfectionTransition::InfectedCriticalToRecovered]
93- .get_support_max (dt)});
93+ .get_support_max (dt, m_tol )});
9494
9595 if (m_transitions.get_num_time_points () < (Eigen::Index)std::ceil (support_max / dt)) {
9696 log_error (
@@ -195,6 +195,16 @@ class Model
195195 */
196196 void compute_recovered ();
197197
198+ /* *
199+ * @brief Setter for the tolerance used to calculate the maximum support of the TransitionDistributions.
200+ *
201+ * @param[in] new_tol New tolerance.
202+ */
203+ void set_tol_for_support_max (ScalarType new_tol)
204+ {
205+ m_tol = new_tol;
206+ }
207+
198208 ParameterSet parameters{}; // /< ParameterSet of Model Parameters.
199209 /* Attention: m_populations and m_transitions do not necessarily have the same number of time points due to the initialization part. */
200210 TimeSeries<ScalarType>
@@ -206,6 +216,7 @@ class Model
206216 ScalarType m_forceofinfection{0 }; // /< Force of infection term needed for numerical scheme.
207217 ScalarType m_N{0 }; // /< Total population size of the considered region.
208218 ScalarType m_deaths_before{0 }; // /< Deaths before start of simulation (at time -m_dt).
219+ ScalarType m_tol{1e-10 }; // /< Tolerance used to calculate the maximum support of the TransitionDistributions.
209220};
210221
211222} // namespace isecir
0 commit comments