parameters.h Source File

CPP API: parameters.h Source File
glct_secir/parameters.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020-2026 MEmilio
3 *
4 * Authors: Lena Ploetzke
5 *
6 * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 
21 #ifndef MIO_GLCT_SECIR_PARAMS_H
22 #define MIO_GLCT_SECIR_PARAMS_H
23 
24 #include "memilio/config.h"
26 #include "memilio/math/eigen.h"
29 #include "memilio/utils/logging.h"
30 
31 namespace mio
32 {
33 namespace glsecir
34 {
35 
36 /***********************************************
37 * Define Parameters of the GLCT-SECIHURD model *
38 ***********************************************/
39 
41 template <typename FP>
43  using Type = Eigen::VectorX<FP>;
48  static Type get_default(size_t numExposed)
49  {
50  Eigen::VectorX<FP> def = Eigen::VectorX<FP>::Zero(numExposed);
51  def[0] = 1.;
52  return def;
53  }
54  static std::string name()
55  {
56  return "StartingProbabilitiesExposed";
57  }
58 };
59 
61 template <typename FP>
63  using Type = Eigen::MatrixX<FP>;
69  static Type get_default(size_t numExposed, FP timeExposed = 1.)
70  {
71  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(numExposed, -(FP)numExposed / timeExposed).asDiagonal();
72  def.diagonal(1).setConstant((FP)numExposed / timeExposed);
73  return def;
74  }
75  static std::string name()
76  {
77  return "TransitionMatrixExposedToInfectedNoSymptoms";
78  }
79 };
80 
82 template <typename FP>
84  using Type = Eigen::VectorX<FP>;
89  static Type get_default(size_t numInfectedNoSymptoms)
90  {
91  Eigen::VectorX<FP> def = Eigen::VectorX<FP>::Zero(numInfectedNoSymptoms);
92  def[0] = 1.;
93  return def;
94  }
95  static std::string name()
96  {
97  return "StartingProbabilitiesInfectedNoSymptoms";
98  }
99 };
100 
105 template <typename FP>
107  using Type = Eigen::MatrixX<FP>;
114  static Type get_default(size_t dimension, FP time = 1.)
115  {
116  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
117  def.diagonal(1).setConstant((FP)dimension / time);
118  return def;
119  }
120  static std::string name()
121  {
122  return "TransitionMatrixInfectedNoSymptomsToInfectedSymptoms";
123  }
124 };
125 
130 template <typename FP>
132  using Type = Eigen::MatrixX<FP>;
139  static Type get_default(size_t dimension, FP time = 1.)
140  {
141  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
142  def.diagonal(1).setConstant((FP)dimension / time);
143  return def;
144  }
145  static std::string name()
146  {
147  return "TransitionMatrixInfectedNoSymptomsToInfectedSymptomsToRecovered";
148  }
149 };
150 
152 template <typename FP>
154  using Type = Eigen::VectorX<FP>;
159  static Type get_default(size_t numInfectedSymptoms)
160  {
161  Eigen::VectorX<FP> def = Eigen::VectorX<FP>::Zero(numInfectedSymptoms);
162  def[0] = 1.;
163  return def;
164  }
165  static std::string name()
166  {
167  return "StartingProbabilitiesInfectedSymptoms";
168  }
169 };
170 
175 template <typename FP>
177  using Type = Eigen::MatrixX<FP>;
184  static Type get_default(size_t dimension, FP time = 1.)
185  {
186  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
187  def.diagonal(1).setConstant((FP)dimension / time);
188  return def;
189  }
190  static std::string name()
191  {
192  return "TransitionMatrixInfectedSymptomsToInfectedSevere";
193  }
194 };
195 
200 template <typename FP>
202  using Type = Eigen::MatrixX<FP>;
209  static Type get_default(size_t dimension, FP time = 1.)
210  {
211  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
212  def.diagonal(1).setConstant((FP)dimension / time);
213  return def;
214  }
215  static std::string name()
216  {
217  return "TransitionMatrixInfectedSymptomsToRecovered";
218  }
219 };
220 
222 template <typename FP>
224  using Type = Eigen::VectorX<FP>;
229  static Type get_default(size_t numInfectedSevere)
230  {
231  Eigen::VectorX<FP> def = Eigen::VectorX<FP>::Zero(numInfectedSevere);
232  def[0] = 1.;
233  return def;
234  }
235  static std::string name()
236  {
237  return "StartingProbabilitiesInfectedSevere";
238  }
239 };
240 
245 template <typename FP>
247  using Type = Eigen::MatrixX<FP>;
254  static Type get_default(size_t dimension, FP time = 1.)
255  {
256  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
257  def.diagonal(1).setConstant((FP)dimension / time);
258  return def;
259  }
260  static std::string name()
261  {
262  return "TransitionMatrixInfectedSevereToInfectedCritical";
263  }
264 };
265 
270 template <typename FP>
272  using Type = Eigen::MatrixX<FP>;
279  static Type get_default(size_t dimension, FP time = 1.)
280  {
281  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
282  def.diagonal(1).setConstant((FP)dimension / time);
283  return def;
284  }
285  static std::string name()
286  {
287  return "TransitionMatrixInfectedSevereToDead";
288  }
289 };
290 
295 template <typename FP>
297  using Type = Eigen::MatrixX<FP>;
304  static Type get_default(size_t dimension, FP time = 1.)
305  {
306  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
307  def.diagonal(1).setConstant((FP)dimension / time);
308  return def;
309  }
310  static std::string name()
311  {
312  return "TransitionMatrixInfectedSevereToRecovered";
313  }
314 };
315 
317 template <typename FP>
319  using Type = Eigen::VectorX<FP>;
324  static Type get_default(size_t numInfectedCritical)
325  {
326  Eigen::VectorX<FP> def = Eigen::VectorX<FP>::Zero(numInfectedCritical);
327  def[0] = 1.;
328  return def;
329  }
330  static std::string name()
331  {
332  return "StartingProbabilitiesInfectedCritical";
333  }
334 };
335 
340 template <typename FP>
342  using Type = Eigen::MatrixX<FP>;
349  static Type get_default(size_t dimension, FP time = 1.)
350  {
351  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
352  def.diagonal(1).setConstant((FP)dimension / time);
353  return def;
354  }
355  static std::string name()
356  {
357  return "TransitionMatrixInfectedCriticalToDead";
358  }
359 };
360 
365 template <typename FP>
367  using Type = Eigen::MatrixX<FP>;
374  static Type get_default(size_t dimension, FP time = 1.)
375  {
376  Eigen::MatrixX<FP> def = Eigen::VectorX<FP>::Constant(dimension, -(FP)dimension / time).asDiagonal();
377  def.diagonal(1).setConstant((FP)dimension / time);
378  return def;
379  }
380  static std::string name()
381  {
382  return "TransitionMatrixInfectedCriticalToRecovered";
383  }
384 };
385 
387 template <typename FP>
389  using Type = FP;
390  static Type get_default()
391  {
392  return Type(1.0);
393  }
394  static std::string name()
395  {
396  return "TransmissionProbabilityOnContact";
397  }
398 };
399 
401 template <typename FP>
404 
405  static Type get_default()
406  {
407  ContactMatrixGroup<FP> contact_matrix = ContactMatrixGroup<FP>(1, 1);
408  contact_matrix[0] = mio::ContactMatrix<FP>(Eigen::MatrixX<FP>::Constant(1, 1, 10.));
409  return Type(contact_matrix);
410  }
411  static std::string name()
412  {
413  return "ContactPatterns";
414  }
415 };
416 
418 template <typename FP>
420  using Type = FP;
421  static Type get_default()
422  {
423  return Type(0.5);
424  }
425  static std::string name()
426  {
427  return "RelativeTransmissionNoSymptoms";
428  }
429 };
430 
432 template <typename FP>
434  using Type = FP;
435  static Type get_default()
436  {
437  return Type(0.5);
438  }
439  static std::string name()
440  {
441  return "RiskOfInfectionFromSymptomatic";
442  }
443 };
444 
451 template <typename FP>
452 struct StartDay {
453  using Type = FP;
454  static Type get_default(size_t)
455  {
456  return Type(0.0);
457  }
458  static std::string name()
459  {
460  return "StartDay";
461  }
462 };
463 
469 template <typename FP>
470 struct Seasonality {
471  using Type = FP;
472  static Type get_default()
473  {
474  return Type(0.);
475  }
476  static std::string name()
477  {
478  return "Seasonality";
479  }
480 };
481 
482 template <typename FP>
494 
496 template <typename FP>
497 class Parameters : public ParametersBase<FP>
498 {
499 public:
502  : ParametersBase<FP>()
503  {
504  }
505 
512  bool check_constraints() const
513  {
514  // --- Parameters affecting the transmission of the virus. ---
515  if (this->template get<TransmissionProbabilityOnContact<FP>>() < 0.0 ||
516  this->template get<TransmissionProbabilityOnContact<FP>>() > 1.0) {
517  log_error("Constraint check: Parameter TransmissionProbabilityOnContact smaller {} or larger {}", 0, 1);
518  return true;
519  }
520 
521  if (this->template get<RelativeTransmissionNoSymptoms<FP>>() < 0.0 ||
522  this->template get<RelativeTransmissionNoSymptoms<FP>>() > 1.0) {
523  log_error("Constraint check: Parameter RelativeTransmissionNoSymptoms smaller {} or larger {}", 0, 1);
524  return true;
525  }
526 
527  if (this->template get<RiskOfInfectionFromSymptomatic<FP>>() < 0.0 ||
528  this->template get<RiskOfInfectionFromSymptomatic<FP>>() > 1.0) {
529  log_error("Constraint check: Parameter RiskOfInfectionFromSymptomatic smaller {} or larger {}", 0, 1);
530  return true;
531  }
532 
533  if (this->template get<Seasonality<FP>>() < 0.0 || this->template get<Seasonality<FP>>() > 0.5) {
534  log_warning("Constraint check: Parameter Seasonality should lie between {} and {}", 0.0, 0.5);
535  return true;
536  }
537 
538  // --- Parameters affecting the phase-type distributions. ---
539  // --- Check that the dimensions are consistent. ---
540  if ((this->template get<TransitionMatrixExposedToInfectedNoSymptoms<FP>>().cols() !=
541  this->template get<TransitionMatrixExposedToInfectedNoSymptoms<FP>>().rows()) ||
542  (this->template get<TransitionMatrixInfectedNoSymptomsToInfectedSymptoms<FP>>().cols() !=
543  this->template get<TransitionMatrixInfectedNoSymptomsToInfectedSymptoms<FP>>().rows()) ||
544  (this->template get<TransitionMatrixInfectedNoSymptomsToRecovered<FP>>().cols() !=
545  this->template get<TransitionMatrixInfectedNoSymptomsToRecovered<FP>>().rows()) ||
546  (this->template get<TransitionMatrixInfectedSymptomsToInfectedSevere<FP>>().cols() !=
547  this->template get<TransitionMatrixInfectedSymptomsToInfectedSevere<FP>>().rows()) ||
548  (this->template get<TransitionMatrixInfectedSymptomsToRecovered<FP>>().cols() !=
549  this->template get<TransitionMatrixInfectedSymptomsToRecovered<FP>>().rows()) ||
550  (this->template get<TransitionMatrixInfectedSevereToInfectedCritical<FP>>().cols() !=
551  this->template get<TransitionMatrixInfectedSevereToInfectedCritical<FP>>().rows()) ||
552  (this->template get<TransitionMatrixInfectedSevereToDead<FP>>().cols() !=
553  this->template get<TransitionMatrixInfectedSevereToDead<FP>>().rows()) ||
554  (this->template get<TransitionMatrixInfectedSevereToRecovered<FP>>().cols() !=
555  this->template get<TransitionMatrixInfectedSevereToRecovered<FP>>().rows()) ||
556  (this->template get<TransitionMatrixInfectedCriticalToDead<FP>>().cols() !=
557  this->template get<TransitionMatrixInfectedCriticalToDead<FP>>().rows()) ||
558  (this->template get<TransitionMatrixInfectedCriticalToRecovered<FP>>().cols() !=
559  this->template get<TransitionMatrixInfectedCriticalToRecovered<FP>>().rows())) {
560  log_error("Constraint check: At least one of the matrices used for the TransitionMatrix parameters is not "
561  "quadratic.");
562  return true;
563  }
564 
565  if (this->template get<StartingProbabilitiesExposed<FP>>().rows() !=
566  this->template get<TransitionMatrixExposedToInfectedNoSymptoms<FP>>().rows()) {
567  log_error("Constraint check: Dimensions of StartingProbabilitiesExposed and "
568  "TransitionMatrixExposedToInfectedNoSymptoms are not matching.");
569  return true;
570  }
571 
572  if (this->template get<StartingProbabilitiesInfectedNoSymptoms<FP>>().rows() !=
573  this->template get<TransitionMatrixInfectedNoSymptomsToInfectedSymptoms<FP>>().rows() +
574  this->template get<TransitionMatrixInfectedNoSymptomsToRecovered<FP>>().rows()) {
575  log_error("Constraint check: Dimensions of StartingProbabilitiesInfectedNoSymptoms and "
576  "TransitionMatrices of InfectedNoSymptoms compartment are not matching.");
577  return true;
578  }
579 
580  if (this->template get<StartingProbabilitiesInfectedSymptoms<FP>>().rows() !=
581  this->template get<TransitionMatrixInfectedSymptomsToInfectedSevere<FP>>().rows() +
582  this->template get<TransitionMatrixInfectedSymptomsToRecovered<FP>>().rows()) {
583  log_error("Constraint check: Dimensions of StartingProbabilitiesInfectedSymptoms and "
584  "TransitionMatrices of InfectedSymptoms compartment are not matching.");
585  return true;
586  }
587 
588  if (this->template get<StartingProbabilitiesInfectedSevere<FP>>().rows() !=
589  this->template get<TransitionMatrixInfectedSevereToInfectedCritical<FP>>().rows() +
590  this->template get<TransitionMatrixInfectedSevereToDead<FP>>().rows() +
591  this->template get<TransitionMatrixInfectedSevereToRecovered<FP>>().rows()) {
592  log_error("Constraint check: Dimensions of StartingProbabilitiesInfectedSevere and "
593  "TransitionMatrices of InfectedSevere compartment are not matching.");
594  return true;
595  }
596 
597  if (this->template get<StartingProbabilitiesInfectedCritical<FP>>().rows() !=
598  this->template get<TransitionMatrixInfectedCriticalToDead<FP>>().rows() +
599  this->template get<TransitionMatrixInfectedCriticalToRecovered<FP>>().rows()) {
600  log_error("Constraint check: Dimensions of StartingProbabilitiesInfectedCritical and "
601  "TransitionMatrices of InfectedCritical compartment are not matching.");
602  return true;
603  }
604 
605  // --- Check constraints of the starting probability vectors. ---
606  if ((!floating_point_equal<FP>(1., this->template get<StartingProbabilitiesExposed<FP>>().sum())) ||
607  (!floating_point_equal<FP>(1., this->template get<StartingProbabilitiesInfectedNoSymptoms<FP>>().sum())) ||
608  (!floating_point_equal<FP>(1., this->template get<StartingProbabilitiesInfectedSymptoms<FP>>().sum())) ||
609  (!floating_point_equal<FP>(1., this->template get<StartingProbabilitiesInfectedSevere<FP>>().sum())) ||
610  (!floating_point_equal<FP>(1., this->template get<StartingProbabilitiesInfectedCritical<FP>>().sum()))) {
611  log_warning(
612  "Constraint check: At least one of the vectors for the starting probabilities does not sum to one.");
613  return true;
614  }
615 
616  if ((this->template get<StartingProbabilitiesExposed<FP>>().array() < -1e-10).any() ||
617  (this->template get<StartingProbabilitiesInfectedNoSymptoms<FP>>().array() < -1e-10).any() ||
618  (this->template get<StartingProbabilitiesInfectedSymptoms<FP>>().array() < -1e-10).any() ||
619  (this->template get<StartingProbabilitiesInfectedSevere<FP>>().array() < -1e-10).any() ||
620  (this->template get<StartingProbabilitiesInfectedCritical<FP>>().array() < -1e-10).any()) {
621  log_warning("Constraint check: At least one of the vectors for the starting probabilities has at least one "
622  "negative entry.");
623  return true;
624  }
625 
626  // --- Check that we have no flows back from one compartment to the previous one
627  // (only in between of the subcompartments). ---
628  if (((this->template get<TransitionMatrixExposedToInfectedNoSymptoms<FP>>() *
629  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixExposedToInfectedNoSymptoms<FP>>().rows()))
630  .array() > 1e-10)
631  .any()) {
632  log_warning(
633  "Constraint check: The entries of TransitionMatrixExposedToInfectedNoSymptoms lead to a negative "
634  "flow ExposedToInfectedNoSymptoms.");
635  return true;
636  }
637  if (((this->template get<TransitionMatrixInfectedNoSymptomsToInfectedSymptoms<FP>>() *
638  Eigen::VectorX<FP>::Ones(
639  this->template get<TransitionMatrixInfectedNoSymptomsToInfectedSymptoms<FP>>().rows()))
640  .array() > 1e-10)
641  .any()) {
642  log_warning("Constraint check: The entries of TransitionMatrixInfectedNoSymptomsToInfectedSymptoms lead to "
643  "a negative "
644  "flow InfectedNoSymptomsToInfectedSymptoms.");
645  return true;
646  }
647  if (((this->template get<TransitionMatrixInfectedNoSymptomsToRecovered<FP>>() *
648  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixInfectedNoSymptomsToRecovered<FP>>().rows()))
649  .array() > 1e-10)
650  .any()) {
651  log_warning(
652  "Constraint check: The entries of TransitionMatrixInfectedNoSymptomsToRecovered lead to a negative "
653  "flow InfectedNoSymptomsToRecovered.");
654  return true;
655  }
656  if (((this->template get<TransitionMatrixInfectedSymptomsToInfectedSevere<FP>>() *
657  Eigen::VectorX<FP>::Ones(
658  this->template get<TransitionMatrixInfectedSymptomsToInfectedSevere<FP>>().rows()))
659  .array() > 1e-10)
660  .any()) {
661  log_warning(
662  "Constraint check: The entries of TransitionMatrixInfectedSymptomsToInfectedSevere lead to a negative "
663  "flow InfectedSymptomsToInfectedSevere.");
664  return true;
665  }
666  if (((this->template get<TransitionMatrixInfectedSymptomsToRecovered<FP>>() *
667  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixInfectedSymptomsToRecovered<FP>>().rows()))
668  .array() > 1e-10)
669  .any()) {
670  log_warning(
671  "Constraint check: The entries of TransitionMatrixInfectedSymptomsToRecovered lead to a negative "
672  "flow InfectedSymptomsToRecovered.");
673  return true;
674  }
675  if (((this->template get<TransitionMatrixInfectedSevereToInfectedCritical<FP>>() *
676  Eigen::VectorX<FP>::Ones(
677  this->template get<TransitionMatrixInfectedSevereToInfectedCritical<FP>>().rows()))
678  .array() > 1e-10)
679  .any()) {
680  log_warning(
681  "Constraint check: The entries of TransitionMatrixInfectedSevereToInfectedCritical lead to a negative "
682  "flow InfectedSevereToInfectedCritical.");
683  return true;
684  }
685  if (((this->template get<TransitionMatrixInfectedSevereToDead<FP>>() *
686  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixInfectedSevereToDead<FP>>().rows()))
687  .array() > 1e-10)
688  .any()) {
689  log_warning("Constraint check: The entries of TransitionMatrixInfectedSevereToDead lead to a negative "
690  "flow InfectedSevereToDead.");
691  return true;
692  }
693  if (((this->template get<TransitionMatrixInfectedSevereToRecovered<FP>>() *
694  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixInfectedSevereToRecovered<FP>>().rows()))
695  .array() > 1e-10)
696  .any()) {
697  log_warning("Constraint check: The entries of TransitionMatrixInfectedSevereToRecovered lead to a negative "
698  "flow InfectedSevereToRecovered.");
699  return true;
700  }
701  if (((this->template get<TransitionMatrixInfectedCriticalToDead<FP>>() *
702  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixInfectedCriticalToDead<FP>>().rows()))
703  .array() > 1e-10)
704  .any()) {
705  log_warning("Constraint check: The entries of TransitionMatrixInfectedCriticalToDead lead to a negative "
706  "flow InfectedCriticalToDead.");
707  return true;
708  }
709  if (((this->template get<TransitionMatrixInfectedCriticalToRecovered<FP>>() *
710  Eigen::VectorX<FP>::Ones(this->template get<TransitionMatrixInfectedCriticalToRecovered<FP>>().rows()))
711  .array() > 1e-10)
712  .any()) {
713  log_warning(
714  "Constraint check: The entries of TransitionMatrixInfectedCriticalToRecovered lead to a negative "
715  "flow InfectedCriticalToRecovered.");
716  return true;
717  }
718 
719  return false;
720  }
721 
722 private:
724  : ParametersBase<FP>(std::move(base))
725  {
726  }
727 
728 public:
733  template <class IOContext>
734  static IOResult<Parameters> deserialize(IOContext& io)
735  {
736  BOOST_OUTCOME_TRY(auto&& base, ParametersBase<FP>::deserialize(io));
737  return success(Parameters(std::move(base)));
738  }
739 };
740 
741 } // namespace glsecir
742 } // namespace mio
743 
744 #endif // MIO_GLCT_SECIR_PARAMS_H
represents a collection of contact frequency matrices that whose sum is the total number of contacts.
Definition: contact_matrix.h:536
represents time dependent contact frequencies between groups.
Definition: contact_matrix.h:505
a set of parameters defined at compile time
Definition: parameter_set.h:205
const ParameterTagTraits< Tag >::Type & get() const
get value of a parameter
Definition: parameter_set.h:262
The UncertainContactMatrix class consists of a ContactMatrix with fixed baseline and uncertain Dampin...
Definition: uncertain_matrix.h:43
Parameters of an GLCT-SECIR model.
Definition: glct_secir/parameters.h:498
static IOResult< Parameters > deserialize(IOContext &io)
deserialize an object of this class.
Definition: glct_secir/parameters.h:734
Parameters()
Default constructor.
Definition: glct_secir/parameters.h:501
bool check_constraints() const
Checks that all parameters satisfy their corresponding constraints and logs an error if constraints a...
Definition: glct_secir/parameters.h:512
Parameters(ParametersBase< FP > &&base)
Definition: glct_secir/parameters.h:723
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
void log_warning(spdlog::string_view_t fmt, const Args &... args)
Definition: logging.h:126
auto success()
Create an object that is implicitly convertible to a succesful IOResult<void>.
Definition: io.h:360
void log_error(spdlog::string_view_t fmt, const Args &... args)
Definition: logging.h:114
boost::outcome_v2::unchecked< T, IOStatus > IOResult
Value-or-error type for operations that return a value but can fail.
Definition: io.h:354
Definition: io.h:95
The contact patterns within the society are modelled using an UncertainContactMatrix.
Definition: glct_secir/parameters.h:402
static Type get_default()
Definition: glct_secir/parameters.h:405
static std::string name()
Definition: glct_secir/parameters.h:411
UncertainContactMatrix< FP > Type
Definition: glct_secir/parameters.h:403
The relative InfectedNoSymptoms infectability.
Definition: glct_secir/parameters.h:419
static Type get_default()
Definition: glct_secir/parameters.h:421
static std::string name()
Definition: glct_secir/parameters.h:425
FP Type
Definition: glct_secir/parameters.h:420
The risk of infection from symptomatic cases in the GLCT-SECIR model.
Definition: glct_secir/parameters.h:433
static Type get_default()
Definition: glct_secir/parameters.h:435
static std::string name()
Definition: glct_secir/parameters.h:439
FP Type
Definition: glct_secir/parameters.h:434
The seasonality in the GLCT-SECIR model.
Definition: glct_secir/parameters.h:470
static std::string name()
Definition: glct_secir/parameters.h:476
FP Type
Definition: glct_secir/parameters.h:471
static Type get_default()
Definition: glct_secir/parameters.h:472
The start day in the GLCT-SECIR model.
Definition: glct_secir/parameters.h:452
FP Type
Definition: glct_secir/parameters.h:453
static std::string name()
Definition: glct_secir/parameters.h:458
static Type get_default(size_t)
Definition: glct_secir/parameters.h:454
Vector with the probability to start in any of the subcompartments of the Exposed compartment.
Definition: glct_secir/parameters.h:42
static Type get_default(size_t numExposed)
Default parameters can be used to get an Erlang distributed stay time in the Exposed compartment.
Definition: glct_secir/parameters.h:48
static std::string name()
Definition: glct_secir/parameters.h:54
Eigen::VectorX< FP > Type
Definition: glct_secir/parameters.h:43
Vector with the probability to start in any of the subcompartments of the InfectedCritical compartmen...
Definition: glct_secir/parameters.h:318
static Type get_default(size_t numInfectedCritical)
Default parameters can be used to get an Erlang distributed stay time in InfectedCritical compartment...
Definition: glct_secir/parameters.h:324
static std::string name()
Definition: glct_secir/parameters.h:330
Eigen::VectorX< FP > Type
Definition: glct_secir/parameters.h:319
Vector with the probability to start in any of the subcompartments of the InfectedNoSymptoms compartm...
Definition: glct_secir/parameters.h:83
Eigen::VectorX< FP > Type
Definition: glct_secir/parameters.h:84
static Type get_default(size_t numInfectedNoSymptoms)
Default parameters can be used to get an Erlang distributed stay time in InfectedNoSymptoms compartme...
Definition: glct_secir/parameters.h:89
static std::string name()
Definition: glct_secir/parameters.h:95
Vector with the probability to start in any of the subcompartments of the InfectedSevere compartment.
Definition: glct_secir/parameters.h:223
static Type get_default(size_t numInfectedSevere)
Default parameters can be used to get an Erlang distributed stay time in InfectedSevere compartment.
Definition: glct_secir/parameters.h:229
static std::string name()
Definition: glct_secir/parameters.h:235
Eigen::VectorX< FP > Type
Definition: glct_secir/parameters.h:224
Vector with the probability to start in any of the subcompartments of the InfectedSymptoms compartmen...
Definition: glct_secir/parameters.h:153
static std::string name()
Definition: glct_secir/parameters.h:165
Eigen::VectorX< FP > Type
Definition: glct_secir/parameters.h:154
static Type get_default(size_t numInfectedSymptoms)
Default parameters can be used to get an Erlang distributed stay time in InfectedSymptoms compartment...
Definition: glct_secir/parameters.h:159
Transition matrix of the Exposed compartment.
Definition: glct_secir/parameters.h:62
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:63
static Type get_default(size_t numExposed, FP timeExposed=1.)
Default parameters can be used to get an Erlang distributed stay time in the Exposed compartment.
Definition: glct_secir/parameters.h:69
static std::string name()
Definition: glct_secir/parameters.h:75
Transition matrix of the phase-type distribution describing the stay time in the InfectedCritical com...
Definition: glct_secir/parameters.h:341
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedCritical compartment...
Definition: glct_secir/parameters.h:349
static std::string name()
Definition: glct_secir/parameters.h:355
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:342
Transition matrix of the phase-type distribution describing the stay time in the InfectedCritical com...
Definition: glct_secir/parameters.h:366
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedCritical compartment...
Definition: glct_secir/parameters.h:374
static std::string name()
Definition: glct_secir/parameters.h:380
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:367
Transition matrix of the phase-type distribution describing the stay time in the InfectedNoSymptoms c...
Definition: glct_secir/parameters.h:106
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:107
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedNoSymptoms compartme...
Definition: glct_secir/parameters.h:114
static std::string name()
Definition: glct_secir/parameters.h:120
Transition matrix of the phase-type distribution describing the stay time in the InfectedNoSymptoms c...
Definition: glct_secir/parameters.h:131
static std::string name()
Definition: glct_secir/parameters.h:145
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:132
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedNoSymptoms compartme...
Definition: glct_secir/parameters.h:139
Transition matrix of the phase-type distribution describing the stay time in the InfectedSevere compa...
Definition: glct_secir/parameters.h:271
static std::string name()
Definition: glct_secir/parameters.h:285
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:272
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedSevere compartment b...
Definition: glct_secir/parameters.h:279
Transition matrix of the phase-type distribution describing the stay time in the InfectedSevere compa...
Definition: glct_secir/parameters.h:246
static std::string name()
Definition: glct_secir/parameters.h:260
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:247
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedSevere compartment b...
Definition: glct_secir/parameters.h:254
Transition matrix of the phase-type distribution describing the stay time in the InfectedSevere compa...
Definition: glct_secir/parameters.h:296
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in InfectedSevere compartment b...
Definition: glct_secir/parameters.h:304
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:297
static std::string name()
Definition: glct_secir/parameters.h:310
Transition matrix of the phase-type distribution describing the stay time in the InfectedNoSymptoms c...
Definition: glct_secir/parameters.h:176
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in the InfectedSymptoms compart...
Definition: glct_secir/parameters.h:184
static std::string name()
Definition: glct_secir/parameters.h:190
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:177
Transition matrix of the phase-type distribution describing the stay time in the InfectedSymptoms com...
Definition: glct_secir/parameters.h:201
Eigen::MatrixX< FP > Type
Definition: glct_secir/parameters.h:202
static Type get_default(size_t dimension, FP time=1.)
Default parameters can be used to get an Erlang distributed stay time in the InfectedSymptoms compart...
Definition: glct_secir/parameters.h:209
static std::string name()
Definition: glct_secir/parameters.h:215
Probability of getting infected from a contact.
Definition: glct_secir/parameters.h:388
static Type get_default()
Definition: glct_secir/parameters.h:390
static std::string name()
Definition: glct_secir/parameters.h:394
FP Type
Definition: glct_secir/parameters.h:389