parameters.h Source File

CPP API: parameters.h Source File
abm/parameters.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020-2026 MEmilio
3 *
4 * Authors: Daniel Abele, Elisabeth Kluth, Khoa Nguyen, David Kerkmann, Julia Bicker
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 #ifndef MIO_ABM_PARAMETERS_H
21 #define MIO_ABM_PARAMETERS_H
22 
23 #include "abm/mask_type.h"
24 #include "abm/time.h"
25 #include "abm/infection_state.h"
26 #include "abm/virus_variant.h"
27 #include "abm/protection_event.h"
28 #include "abm/protection_event.h"
29 #include "abm/test_type.h"
30 #include "memilio/config.h"
32 #include "memilio/io/io.h"
36 #include "memilio/utils/logging.h"
44 
45 #include <algorithm>
46 #include <limits>
47 #include <string>
48 
49 namespace mio
50 {
51 namespace abm
52 {
53 
60  {
62  }
63  static std::string name()
64  {
65  return "TimeExposedToNoSymptoms";
66  }
67 };
68 
75  {
77  }
78  static std::string name()
79  {
80  return "TimeInfectedNoSymptomsToSymptoms";
81  }
82 };
83 
90  {
92  }
93  static std::string name()
94  {
95  return "TimeInfectedNoSymptomsToRecovered";
96  }
97 };
98 
106  {
108  }
109  static std::string name()
110  {
111  return "TimeInfectedSymptomsToSevere";
112  }
113 };
114 
121  {
123  }
124  static std::string name()
125  {
126  return "TimeInfectedSymptomsToRecovered";
127  }
128 };
129 
136  {
138  }
139  static std::string name()
140  {
141  return "TimeInfectedSevereToCritical";
142  }
143 };
144 
151  {
153  }
154  static std::string name()
155  {
156  return "TimeInfectedSevereToRecovered";
157  }
158 };
159 
166  {
168  }
169  static std::string name()
170  {
171  return "TimeInfectedSevereToDead";
172  }
173 };
174 
181  {
183  }
184  static std::string name()
185  {
186  return "TimeInfectedCriticalToDead";
187  }
188 };
189 
196  {
198  }
199  static std::string name()
200  {
201  return "TimeInfectedCriticalToRecovered";
202  }
203 };
204 
211  {
212  return Type({VirusVariant::Count, size}, .5);
213  }
214  static std::string name()
215  {
216  return "SymptomaticPerInfectedNoSymptoms";
217  }
218 };
219 
226  {
227  return Type({VirusVariant::Count, size}, .5);
228  }
229  static std::string name()
230  {
231  return "SeverePerInfectedSymptoms";
232  }
233 };
234 
241  {
242  return Type({VirusVariant::Count, size}, .5);
243  }
244  static std::string name()
245  {
246  return "CriticalPerInfectedSevere";
247  }
248 };
249 
256  {
257  return Type({VirusVariant::Count, size}, .1);
258  }
259  static std::string name()
260  {
261  return "DeathsPerInfectedSevere";
262  }
263 };
264 
271  {
272  return Type({VirusVariant::Count, size}, .5);
273  }
274  static std::string name()
275  {
276  return "DeathsPerInfectedCritical";
277  }
278 };
279 
289 
292  {
293  return Members("ViralLoadDistributionsParameters")
294  .add("viral_load_peak", viral_load_peak)
295  .add("viral_load_incline", viral_load_incline)
296  .add("viral_load_decline", viral_load_decline);
297  }
298 };
299 
303  {
304  Type default_val(
309  return default_val;
310  }
311  static std::string name()
312  {
313  return "ViralLoadDistributions";
314  }
315 };
316 
324 
327  {
328  return Members("ViralShedTuple")
329  .add("viral_shed_alpha", viral_shed_alpha)
330  .add("viral_shed_beta", viral_shed_beta);
331  }
332 };
333 
337  {
338  Type default_val({VirusVariant::Count, size}, ViralShedTuple{-7., 1.});
339  return default_val;
340  }
341  static std::string name()
342  {
343  return "ViralShedParameters";
344  }
345 };
346 
353  {
354  Type default_val({VirusVariant::Count, size},
356  return default_val;
357  }
358  static std::string name()
359  {
360  return "ViralShedFactor";
361  }
362 };
363 
369  static Type get_default(AgeGroup /*size*/)
370  {
371  return Type({VirusVariant::Count}, 1.0);
372  }
373  static std::string name()
374  {
375  return "InfectionRateFromViralShed";
376  }
377 };
378 
384  static Type get_default(AgeGroup /*size*/)
385  {
386  Type defaut_value = Type(MaskType::Count, 0.0);
387  // Initial values according to http://dx.doi.org/10.15585/mmwr.mm7106e1
388  defaut_value[MaskType::FFP2] = 0.83;
389  defaut_value[MaskType::Surgical] = 0.66;
390  defaut_value[MaskType::Community] = 0.56;
391  return defaut_value;
392  }
393  static std::string name()
394  {
395  return "MaskProtection";
396  }
397 };
398 
404  static Type get_default(AgeGroup /*size*/)
405  {
406  return Type({VirusVariant::Count}, 1.0);
407  }
408  static std::string name()
409  {
410  return "AerosolTransmissionRates";
411  }
412 };
413 
420  static auto get_default(AgeGroup size)
421  {
423  }
424  static std::string name()
425  {
426  return "InfectionProtectionFactor";
427  }
428 };
429 
436  static auto get_default(AgeGroup size)
437  {
439  }
440  static std::string name()
441  {
442  return "SeverityProtectionFactor";
443  }
444 };
445 
452  static auto get_default(AgeGroup size)
453  {
455  }
456  static std::string name()
457  {
458  return "HighViralLoadProtectionFactor";
459  }
460 };
461 
470 
473  {
474  return Members("TestParameters")
475  .add("sensitivity", sensitivity)
476  .add("specificity", specificity)
477  .add("required_time", required_time)
478  .add("test_type", type);
479  }
480 };
481 
485 struct TestData {
487  static auto get_default(AgeGroup /*size*/)
488  {
489  Type default_val = Type({TestType::Count});
490  default_val[{TestType::Generic}] = TestParameters{0.9, 0.99, hours(48), TestType::Generic};
491  default_val[{TestType::Antigen}] = TestParameters{0.8, 0.88, minutes(30), TestType::Antigen};
492  default_val[{TestType::PCR}] = TestParameters{0.9, 0.99, hours(48), TestType::PCR};
493  return default_val;
494  }
495  static std::string name()
496  {
497  return "TestData";
498  }
499 };
500 
504 struct LockdownDate {
505  using Type = TimePoint;
506  static auto get_default(AgeGroup /*size*/)
507  {
509  }
510  static std::string name()
511  {
512  return "LockdownDate";
513  }
514 };
515 
520  using Type = TimeSpan;
521  static auto get_default(AgeGroup /*size*/)
522  {
523  return days(10);
524  }
525  static std::string name()
526  {
527  return "QuarantineDuration";
528  }
529 };
530 
535  using Type = ScalarType;
536  static auto get_default(AgeGroup /*size*/)
537  {
538  return 0.0;
539  }
540  static std::string name()
541  {
542  return "QuarantineEffectivness";
543  }
544 };
545 
551  static auto get_default(AgeGroup size)
552  {
553  return Type({size}, 1.0);
554  }
555  static std::string name()
556  {
557  return "BasicShoppingRate";
558  }
559 };
560 
564 struct WorkRatio {
565  using Type =
567  static auto get_default(AgeGroup /*size*/)
568  {
569  return Type(Eigen::VectorX<ScalarType>::Constant(1, 1.0));
570  }
571  static std::string name()
572  {
573  return "WorkRatio";
574  }
575 };
576 
580 struct SchoolRatio {
581  using Type =
583  static auto get_default(AgeGroup /*size*/)
584  {
585  return Type(Eigen::VectorX<ScalarType>::Constant(1, 1.0));
586  }
587  static std::string name()
588  {
589  return "SchoolRatio";
590  }
591 };
592 
597  using Type =
599  static auto get_default(AgeGroup size)
600  {
601  return Type(Eigen::VectorX<ScalarType>::Constant((size_t)size, 1.0));
602  }
603  static std::string name()
604  {
605  return "SocialEventRate";
606  }
607 };
608 
614  static auto get_default(AgeGroup size)
615  {
617  }
618  static std::string name()
619  {
620  return "GotoWorkTimeMinimum";
621  }
622 };
623 
629  static auto get_default(AgeGroup size)
630  {
632  }
633  static std::string name()
634  {
635  return "GotoWorkTimeMaximum";
636  }
637 };
638 
644  static auto get_default(AgeGroup size)
645  {
647  }
648  static std::string name()
649  {
650  return "GotoSchoolTimeMinimum";
651  }
652 };
653 
659  static auto get_default(AgeGroup size)
660  {
662  }
663  static std::string name()
664  {
665  return "GotoSchoolTimeMaximum";
666  }
667 };
668 
674  static Type get_default(AgeGroup num_agegroups)
675  {
676  return Type(num_agegroups, false);
677  }
678  static std::string name()
679  {
680  return "AgeGroupGotoSchool";
681  }
682 };
683 
689  static Type get_default(AgeGroup num_agegroups)
690  {
691  return Type(num_agegroups, false);
692  }
693  static std::string name()
694  {
695  return "AgeGroupGotoWork";
696  }
697 };
698 
710 
715  using Type = ScalarType;
716  static Type get_default(AgeGroup /*size*/)
717  {
719  }
720  static std::string name()
721  {
722  return "MaximumContacts";
723  }
724 };
725 
729 struct ContactRates {
732  {
733  return Type({size, size},
734  1.0); // amount of contacts from AgeGroup a to AgeGroup b per day
735  }
736  static std::string name()
737  {
738  return "ContactRates";
739  }
740 };
741 
742 // If true, consider the capacity of the Cell%s of this Location for the computation of relative transmission risk.
744  using Type = bool;
745  static Type get_default(AgeGroup /*size*/)
746  {
747  return false;
748  }
749  static std::string name()
750  {
751  return "UseLocationCapacityForTransmissions";
752  }
753 };
754 
759 
764 {
765 public:
766  Parameters(size_t num_agegroups)
767  : ParametersBase(AgeGroup(num_agegroups))
768  , m_num_groups(num_agegroups)
769  {
770  }
771 
772 private:
774  : ParametersBase(std::move(base))
776  {
777  }
778 
779 public:
783  size_t get_num_groups() const
784  {
785  return m_num_groups;
786  }
787 
793  bool check_constraints() const
794  {
795  for (auto i = AgeGroup(0); i < AgeGroup(m_num_groups); ++i) {
796  for (auto&& v : enum_members<VirusVariant>()) {
797 
798  if (this->get<TimeExposedToNoSymptoms>()[{v, i}].params()[0] < 0) {
799  log_error("Constraint check: Mean of parameter TimeExposedToNoSymptoms of virus variant {} and "
800  "age group {} smaller "
801  "than {}",
802  (uint32_t)v, (size_t)i, 0);
803  return true;
804  }
805 
806  if (this->get<TimeInfectedNoSymptomsToSymptoms>()[{v, i}].params()[0] < 0.0) {
807  log_error("Constraint check: Mean of parameter TimeInfectedNoSymptomsToSymptoms "
808  "of virus variant "
809  "{} and age group {} smaller "
810  "than {}",
811  (uint32_t)v, (size_t)i, 0);
812  return true;
813  }
814 
815  if (this->get<TimeInfectedNoSymptomsToRecovered>()[{v, i}].params()[0] < 0.0) {
816  log_error("Constraint check: Mean of parameter TimeInfectedNoSymptomsToRecovered of "
817  "virus variant "
818  "{} and age group {} smaller "
819  "than {}",
820  (uint32_t)v, (size_t)i, 0);
821  return true;
822  }
823 
824  if (this->get<TimeInfectedSymptomsToSevere>()[{v, i}].params()[0] < 0.0) {
825  log_error("Constraint check: Mean of parameter TimeInfectedSymptomsToSevere of virus "
826  "variant {} "
827  "and age group {} smaller "
828  "than {}",
829  (uint32_t)v, (size_t)i, 0);
830  return true;
831  }
832 
833  if (this->get<TimeInfectedSymptomsToRecovered>()[{v, i}].params()[0] < 0.0) {
834  log_error("Constraint check: Mean of parameter TimeInfectedSymptomsToRecovered of virus "
835  "variant {} "
836  "and age group {} smaller "
837  "than {}",
838  (uint32_t)v, (size_t)i, 0);
839  return true;
840  }
841 
842  if (this->get<TimeInfectedSevereToCritical>()[{v, i}].params()[0] < 0.0) {
843  log_error("Constraint check: Mean of parameter TimeInfectedSevereToCritical of virus "
844  "variant {} "
845  "and age group {} smaller "
846  "than {}",
847  (uint32_t)v, (size_t)i, 0);
848  return true;
849  }
850 
851  if (this->get<TimeInfectedSevereToRecovered>()[{v, i}].params()[0] < 0.0) {
852  log_error("Constraint check: Mean of parameter TimeInfectedSevereToRecovered of virus "
853  "variant {} "
854  "and age group {} smaller "
855  "than {}",
856  (uint32_t)v, (size_t)i, 0);
857  return true;
858  }
859 
860  if (this->get<TimeInfectedSevereToDead>()[{v, i}].params()[0] < 0.0) {
861  log_error("Constraint check: Mean of parameter TimeInfectedSevereToDead of virus "
862  "variant {} "
863  "and age group {} smaller "
864  "than {}",
865  (uint32_t)v, (size_t)i, 0);
866  return true;
867  }
868 
869  if (this->get<TimeInfectedCriticalToDead>()[{v, i}].params()[0] < 0.0) {
870  log_error("Constraint check: Mean of parameter TimeInfectedCriticalToDead of virus variant {} "
871  "and age group {} smaller "
872  "than {}",
873  (uint32_t)v, (size_t)i, 0);
874  return true;
875  }
876 
877  if (this->get<TimeInfectedCriticalToRecovered>()[{v, i}].params()[0] < 0.0) {
878  log_error("Constraint check: Mean of parameter TimeInfectedCriticalToRecovered of virus "
879  "variant {} "
880  "and age group {} smaller "
881  "than {}",
882  (uint32_t)v, (size_t)i, 0);
883  return true;
884  }
885 
886  if (this->get<SymptomsPerInfectedNoSymptoms>()[{v, i}] < 0.0 ||
887  this->get<SymptomsPerInfectedNoSymptoms>()[{v, i}] > 1.0) {
888  log_error("Constraint check: Parameter SymptomsPerInfectedNoSymptoms of virus variant {} and age "
889  "group {} smaller than {} or larger than {}",
890  (uint32_t)v, (size_t)i, 0, 1);
891  return true;
892  }
893 
894  if (this->get<SeverePerInfectedSymptoms>()[{v, i}] < 0.0 ||
895  this->get<SeverePerInfectedSymptoms>()[{v, i}] > 1.0) {
896  log_error("Constraint check: Parameter SeverePerInfectedSymptoms of virus variant {} and age group "
897  "{} smaller than {} or larger than {}",
898  (uint32_t)v, (size_t)i, 0, 1);
899  return true;
900  }
901 
902  if (this->get<CriticalPerInfectedSevere>()[{v, i}] < 0.0 ||
903  this->get<CriticalPerInfectedSevere>()[{v, i}] > 1.0) {
904  log_error("Constraint check: Parameter CriticalPerInfectedSevere of virus variant {} and age group "
905  "{} smaller than {} or larger than {}",
906  (uint32_t)v, (size_t)i, 0, 1);
907  return true;
908  }
909 
910  if (this->get<DeathsPerInfectedSevere>()[{v, i}] < 0.0 ||
911  this->get<DeathsPerInfectedSevere>()[{v, i}] > 1.0) {
912  log_error("Constraint check: Parameter DeathsPerInfectedSevere of age group {} smaller than "
913  "{} or larger than {}",
914  (uint32_t)v, (size_t)i, 0, 1);
915  return true;
916  }
917 
918  if ((this->get<DeathsPerInfectedSevere>()[{v, i}] + this->get<CriticalPerInfectedSevere>()[{v, i}]) >
919  1.0) {
920  log_error("Constraint check: Sum of parameters DeathsPerInfectedSevere and "
921  "CriticalPerInfectedSevere of age group {} larger than "
922  "{}",
923  (uint32_t)v, (size_t)i, 1);
924  return true;
925  }
926 
927  if (this->get<DeathsPerInfectedCritical>()[{v, i}] < 0.0 ||
928  this->get<DeathsPerInfectedCritical>()[{v, i}] > 1.0) {
929  log_error("Constraint check: Parameter DeathsPerInfectedCritical of age group {} smaller than "
930  "{} or larger than {}",
931  (uint32_t)v, (size_t)i, 0, 1);
932  return true;
933  }
934 
935  if (this->get<ViralShedFactor>()[{v, i}].params()[0] < 0.0) {
936  log_error("Constraint check: Mean of parameter ViralShedFactor of virus "
937  "variant {} "
938  "and age group {:.0f} smaller "
939  "than {:d}",
940  (uint32_t)v, (size_t)i, 0);
941  return true;
942  }
943  }
944 
945  if (this->get<GotoWorkTimeMinimum>()[i].seconds() < 0.0 ||
946  this->get<GotoWorkTimeMinimum>()[i].seconds() > this->get<GotoWorkTimeMaximum>()[i].seconds()) {
947  log_error("Constraint check: Parameter GotoWorkTimeMinimum of age group {} smaller {} or "
948  "larger {}",
949  (size_t)i, 0, this->get<GotoWorkTimeMaximum>()[i].seconds());
950  return true;
951  }
952 
953  if (this->get<GotoWorkTimeMaximum>()[i].seconds() < this->get<GotoWorkTimeMinimum>()[i].seconds() ||
954  this->get<GotoWorkTimeMaximum>()[i] > days(1)) {
955  log_error("Constraint check: Parameter GotoWorkTimeMaximum of age group {} smaller {} or larger "
956  "than one day time span",
957  (size_t)i, this->get<GotoWorkTimeMinimum>()[i].seconds());
958  return true;
959  }
960 
961  if (this->get<GotoSchoolTimeMinimum>()[i].seconds() < 0.0 ||
962  this->get<GotoSchoolTimeMinimum>()[i].seconds() > this->get<GotoSchoolTimeMaximum>()[i].seconds()) {
963  log_error("Constraint check: Parameter GotoSchoolTimeMinimum of age group {} smaller {} or "
964  "larger {}",
965  (size_t)i, 0, this->get<GotoWorkTimeMaximum>()[i].seconds());
966  return true;
967  }
968 
969  if (this->get<GotoSchoolTimeMaximum>()[i].seconds() < this->get<GotoSchoolTimeMinimum>()[i].seconds() ||
970  this->get<GotoSchoolTimeMaximum>()[i] > days(1)) {
971  log_error("Constraint check: Parameter GotoWorkTimeMaximum of age group {} smaller {} or larger "
972  "than one day time span",
973  (size_t)i, this->get<GotoSchoolTimeMinimum>()[i].seconds());
974  return true;
975  }
976  }
977 
978  for (auto&& v : enum_members<VirusVariant>()) {
979  if (this->get<InfectionRateFromViralShed>()[v] < 0.0) {
980  log_error("Constraint check: Parameter InfectionRateFromViralShed of virus "
981  "variant {} is smaller than {:d}",
982  (uint32_t)v, 0);
983  return true;
984  }
985  }
986 
987  if (this->get<MaskProtection>()[MaskType::Community] < 0.0 ||
988  this->get<MaskProtection>()[MaskType::Community] > 1.0) {
989  log_error("Constraint check: Parameter MaskProtection for MaskType Community is smaller {} or larger {}", 0,
990  1);
991  return true;
992  }
993 
994  if (this->get<MaskProtection>()[MaskType::FFP2] < 0.0 || this->get<MaskProtection>()[MaskType::FFP2] > 1.0) {
995  log_error("Constraint check: Parameter MaskProtection for MaskType FFP2 is smaller {} or larger {}", 0, 1);
996  return true;
997  }
998 
999  if (this->get<MaskProtection>()[MaskType::Surgical] < 0.0 ||
1000  this->get<MaskProtection>()[MaskType::Surgical] > 1.0) {
1001  log_error("Constraint check: Parameter MaskProtection for MaskType Surgical smaller {} or larger {}", 0, 1);
1002  return true;
1003  }
1004 
1005  if (this->get<LockdownDate>().seconds() < 0.0) {
1006  log_error("Constraint check: Parameter LockdownDate smaller {}", 0);
1007  return true;
1008  }
1009 
1010  if (this->get<QuarantineEffectiveness>() < 0.0 || this->get<QuarantineEffectiveness>() > 1.0) {
1011  log_error("Constraint check: Parameter QuarantineEffectiveness not between {:d,:d}", 0, 1);
1012  return true;
1013  }
1014 
1015  return false;
1016  }
1017 
1022  template <class IOContext>
1023  static IOResult<Parameters> deserialize(IOContext& io)
1024  {
1025  BOOST_OUTCOME_TRY(auto&& base, ParametersBase::deserialize(io));
1026  return success(Parameters(std::move(base)));
1027  }
1028 
1029 private:
1031 };
1032 
1033 } // namespace abm
1034 } // namespace mio
1035 #endif
This class represents an arbitrary ParameterDistribution.
Definition: abstract_parameter_distribution.h:40
A class template for an array with custom indices.
Definition: custom_index_array.h:136
represents the coefficient wise matrix (or vector) expression B - D * M where B is a baseline,...
Definition: contact_matrix.h:46
Definition: parameter_distributions.h:813
Definition: parameter_distributions.h:567
Definition: parameter_distributions.h:440
a set of parameters defined at compile time
Definition: parameter_set.h:205
static constexpr size_t size()
returns the number of parameters
Definition: parameter_set.h:315
static IOResult< ParameterSet > deserialize(IOContext &io)
deserialize an object of this class.
Definition: parameter_set.h:393
const ParameterTagTraits< Tag >::Type & get() const
get value of a parameter
Definition: parameter_set.h:262
Definition: time_series_functor.h:47
Parameters of the simulation that are the same everywhere within the Model.
Definition: abm/parameters.h:764
Parameters(size_t num_agegroups)
Definition: abm/parameters.h:766
size_t m_num_groups
Definition: abm/parameters.h:1030
size_t get_num_groups() const
Get the number of the age groups.
Definition: abm/parameters.h:783
Parameters(ParametersBase &&base)
Definition: abm/parameters.h:773
bool check_constraints() const
Checks whether all Parameters satisfy their corresponding constraints and logs an error if constraint...
Definition: abm/parameters.h:793
static IOResult< Parameters > deserialize(IOContext &io)
deserialize an object of this class.
Definition: abm/parameters.h:1023
Represents a point in time.
Definition: time.h:175
A duration of time.
Definition: time.h:36
double ScalarType
Configuration of memilio library.
Definition: memilio/config.h:30
static min_max_return_type< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > >::type max(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &a, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &b)
Definition: ad.hpp:2596
ProtectionType
ProtectionType in ABM.
Definition: protection_event.h:38
VirusVariant
Virus variants in ABM.
Definition: virus_variant.h:38
TestType
Type of a Test.
Definition: test_type.h:37
TimeSpan seconds(int seconds)
Create a TimeSpan of a specified number of seconds.
Definition: time.h:321
TimeSpan days(int days)
Create a TimeSpan with a specified number of days.
Definition: time.h:348
TimeSpan hours(int hours)
Create a TimeSpan of a specified number of hours.
Definition: time.h:339
MaskType
Type of a Mask.
Definition: mask_type.h:35
TimeSpan minutes(int minutes)
Create a TimeSpan of a specified number of minutes.
Definition: time.h:330
int size(Comm comm)
Return the size of the given communicator.
Definition: miompi.cpp:75
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
auto i
Definition: io.h:809
auto success()
Create an object that is implicitly convertible to a succesful IOResult<void>.
Definition: io.h:359
void log_error(spdlog::string_view_t fmt, const Args &... args)
Definition: logging.h:100
boost::outcome_v2::unchecked< T, IOStatus > IOResult
Value-or-error type for operations that return a value but can fail.
Definition: io.h:353
Definition: io.h:94
The AgeGroup struct is used as a dynamically sized tag for all age dependent categories.
Definition: age_group.h:32
List of a class's members.
Definition: default_serialize.h:113
Members< ValueTypes..., T > add(const char *member_name, T &member)
Add a class member.
Definition: default_serialize.h:139
Aerosol transmission rates.
Definition: abm/parameters.h:402
CustomIndexArray< ScalarType, VirusVariant > Type
Definition: abm/parameters.h:403
static Type get_default(AgeGroup)
Definition: abm/parameters.h:404
static std::string name()
Definition: abm/parameters.h:408
The set of AgeGroups that can go to school.
Definition: abm/parameters.h:672
static std::string name()
Definition: abm/parameters.h:678
static Type get_default(AgeGroup num_agegroups)
Definition: abm/parameters.h:674
CustomIndexArray< bool, AgeGroup > Type
Definition: abm/parameters.h:673
The set of AgeGroups that can go to work.
Definition: abm/parameters.h:687
static std::string name()
Definition: abm/parameters.h:693
static Type get_default(AgeGroup num_agegroups)
Definition: abm/parameters.h:689
CustomIndexArray< bool, AgeGroup > Type
Definition: abm/parameters.h:688
Parameter for the exponential distribution to decide if a Person goes shopping.
Definition: abm/parameters.h:549
static std::string name()
Definition: abm/parameters.h:555
CustomIndexArray< UncertainValue< ScalarType >, AgeGroup > Type
Definition: abm/parameters.h:550
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:551
contact rates
Definition: abm/parameters.h:729
static std::string name()
Definition: abm/parameters.h:736
CustomIndexArray< ScalarType, AgeGroup, AgeGroup > Type
Definition: abm/parameters.h:730
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:731
the percentage of ICU cases per hospitalized cases
Definition: abm/parameters.h:238
CustomIndexArray< UncertainValue< ScalarType >, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:239
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:240
static std::string name()
Definition: abm/parameters.h:244
the percentage of dead cases per ICU cases
Definition: abm/parameters.h:268
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:270
static std::string name()
Definition: abm/parameters.h:274
CustomIndexArray< UncertainValue< ScalarType >, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:269
the percentage of dead cases per hospitalized cases
Definition: abm/parameters.h:253
static std::string name()
Definition: abm/parameters.h:259
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:255
CustomIndexArray< UncertainValue< ScalarType >, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:254
Latest time that a Person can go to school.
Definition: abm/parameters.h:657
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:659
static std::string name()
Definition: abm/parameters.h:663
Earliest time that a Person can go to school.
Definition: abm/parameters.h:642
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:644
static std::string name()
Definition: abm/parameters.h:648
Latest time that a Person can go to work.
Definition: abm/parameters.h:627
static std::string name()
Definition: abm/parameters.h:633
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:629
Earliest time that a Person can go to work.
Definition: abm/parameters.h:612
static std::string name()
Definition: abm/parameters.h:618
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:614
Personal protective factor against high viral load, which depends on ProtectionType,...
Definition: abm/parameters.h:450
CustomIndexArray< TimeSeriesFunctor< ScalarType >, ProtectionType, AgeGroup, VirusVariant > Type
Definition: abm/parameters.h:451
static std::string name()
Definition: abm/parameters.h:456
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:452
Personal protection factor against #Infection% after #Infection and vaccination, which depends on Pro...
Definition: abm/parameters.h:418
CustomIndexArray< TimeSeriesFunctor< ScalarType >, ProtectionType, AgeGroup, VirusVariant > Type
Definition: abm/parameters.h:419
static std::string name()
Definition: abm/parameters.h:424
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:420
Determines the infection rate by viral shed.
Definition: abm/parameters.h:367
static std::string name()
Definition: abm/parameters.h:373
static Type get_default(AgeGroup)
Definition: abm/parameters.h:369
CustomIndexArray< ScalarType, VirusVariant > Type
Definition: abm/parameters.h:368
Starting date of interventions.
Definition: abm/parameters.h:504
static std::string name()
Definition: abm/parameters.h:510
static auto get_default(AgeGroup)
Definition: abm/parameters.h:506
Effectiveness of a Mask of a certain MaskType% against an Infection%.
Definition: abm/parameters.h:382
static std::string name()
Definition: abm/parameters.h:393
static Type get_default(AgeGroup)
Definition: abm/parameters.h:384
CustomIndexArray< UncertainValue< ScalarType >, MaskType > Type
Definition: abm/parameters.h:383
Maximum number of Persons an infectious Person can infect at the respective Location.
Definition: abm/parameters.h:714
static Type get_default(AgeGroup)
Definition: abm/parameters.h:716
static std::string name()
Definition: abm/parameters.h:720
ScalarType Type
Definition: abm/parameters.h:715
Duration of quarantine.
Definition: abm/parameters.h:519
static std::string name()
Definition: abm/parameters.h:525
static auto get_default(AgeGroup)
Definition: abm/parameters.h:521
Effectiveness of quarantine.
Definition: abm/parameters.h:534
static std::string name()
Definition: abm/parameters.h:540
static auto get_default(AgeGroup)
Definition: abm/parameters.h:536
ScalarType Type
Definition: abm/parameters.h:535
Percentage of Persons of the respective age going to school.
Definition: abm/parameters.h:580
DampingMatrixExpression< ScalarType, Dampings< ScalarType, Damping< ScalarType, ColumnVectorShape< ScalarType > >> > Type
Definition: abm/parameters.h:582
static auto get_default(AgeGroup)
Definition: abm/parameters.h:583
static std::string name()
Definition: abm/parameters.h:587
the percentage of hospitalized cases per infected cases
Definition: abm/parameters.h:223
static std::string name()
Definition: abm/parameters.h:229
CustomIndexArray< UncertainValue< ScalarType >, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:224
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:225
Personal protective factor against severe symptoms after #Infection and vaccination,...
Definition: abm/parameters.h:434
static std::string name()
Definition: abm/parameters.h:440
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:436
CustomIndexArray< TimeSeriesFunctor< ScalarType >, ProtectionType, AgeGroup, VirusVariant > Type
Definition: abm/parameters.h:435
Parameter for the exponential distribution to decide if a Person goes to a social event.
Definition: abm/parameters.h:596
static auto get_default(AgeGroup size)
Definition: abm/parameters.h:599
DampingMatrixExpression< ScalarType, Dampings< ScalarType, Damping< ScalarType, ColumnVectorShape< ScalarType > >> > Type
Definition: abm/parameters.h:598
static std::string name()
Definition: abm/parameters.h:603
the percentage of symptomatic cases
Definition: abm/parameters.h:208
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:210
static std::string name()
Definition: abm/parameters.h:214
CustomIndexArray< UncertainValue< ScalarType >, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:209
Store a map from the TestTypes to their TestParameters.
Definition: abm/parameters.h:485
CustomIndexArray< TestParameters, TestType > Type
Definition: abm/parameters.h:486
static auto get_default(AgeGroup)
Definition: abm/parameters.h:487
static std::string name()
Definition: abm/parameters.h:495
Parameters that describe the reliability of a test.
Definition: abm/parameters.h:465
TimeSpan required_time
Definition: abm/parameters.h:468
UncertainValue< ScalarType > sensitivity
Definition: abm/parameters.h:466
UncertainValue< ScalarType > specificity
Definition: abm/parameters.h:467
auto default_serialize()
This method is used by the default serialization feature.
Definition: abm/parameters.h:472
TestType type
Definition: abm/parameters.h:469
Time that a Person is infected but not yet infectious in day unit.
Definition: abm/parameters.h:57
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:59
static std::string name()
Definition: abm/parameters.h:63
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:58
Time that a Person is treated by ICU before dying in day unit.
Definition: abm/parameters.h:178
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:179
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:180
static std::string name()
Definition: abm/parameters.h:184
Time that a Person is treated by ICU before recovering in day unit.
Definition: abm/parameters.h:193
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:195
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:194
static std::string name()
Definition: abm/parameters.h:199
Time that a Person is infected when staying asymptomatic in day unit.
Definition: abm/parameters.h:87
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:89
static std::string name()
Definition: abm/parameters.h:93
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:88
Time that a Person is infected but presymptomatic in day unit.
Definition: abm/parameters.h:72
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:74
static std::string name()
Definition: abm/parameters.h:78
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:73
Time that a Person is infected and 'simply' hospitalized before becoming critical in day unit.
Definition: abm/parameters.h:133
static std::string name()
Definition: abm/parameters.h:139
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:135
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:134
Time that a Person is hospitalized before dying in day unit.
Definition: abm/parameters.h:163
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:164
static std::string name()
Definition: abm/parameters.h:169
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:165
Time that a Person is infected and 'simply' hospitalized before recovering in day unit.
Definition: abm/parameters.h:148
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:150
static std::string name()
Definition: abm/parameters.h:154
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:149
Time that a Person is infected and symptomatic who will recover in day unit.
Definition: abm/parameters.h:118
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:119
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:120
static std::string name()
Definition: abm/parameters.h:124
Time that a Person is infected and symptomatic but who do not need to be hospitalized yet in day unit...
Definition: abm/parameters.h:103
static std::string name()
Definition: abm/parameters.h:109
CustomIndexArray< AbstractParameterDistribution, VirusVariant, AgeGroup > Type
Definition: abm/parameters.h:104
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:105
Definition: abm/parameters.h:743
static Type get_default(AgeGroup)
Definition: abm/parameters.h:745
static std::string name()
Definition: abm/parameters.h:749
bool Type
Definition: abm/parameters.h:744
Parameters for the ViralLoad course.
Definition: abm/parameters.h:285
AbstractParameterDistribution viral_load_incline
Definition: abm/parameters.h:287
auto default_serialize()
This method is used by the default serialization feature.
Definition: abm/parameters.h:291
AbstractParameterDistribution viral_load_peak
Definition: abm/parameters.h:286
AbstractParameterDistribution viral_load_decline
Definition: abm/parameters.h:288
Definition: abm/parameters.h:300
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:302
static std::string name()
Definition: abm/parameters.h:311
Individual viral shed factor to account for variability in infectious viral load spread.
Definition: abm/parameters.h:350
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:352
static std::string name()
Definition: abm/parameters.h:358
Definition: abm/parameters.h:334
static std::string name()
Definition: abm/parameters.h:341
static Type get_default(AgeGroup size)
Definition: abm/parameters.h:336
Parameters for the viral shed.
Definition: abm/parameters.h:321
auto default_serialize()
This method is used by the default serialization feature.
Definition: abm/parameters.h:326
ScalarType viral_shed_alpha
Definition: abm/parameters.h:322
ScalarType viral_shed_beta
Definition: abm/parameters.h:323
Percentage of Persons of the respective age going to work.
Definition: abm/parameters.h:564
static auto get_default(AgeGroup)
Definition: abm/parameters.h:567
static std::string name()
Definition: abm/parameters.h:571
DampingMatrixExpression< ScalarType, Dampings< ScalarType, Damping< ScalarType, ColumnVectorShape< ScalarType > >> > Type
Definition: abm/parameters.h:566