Skip to content

Commit 0fce556

Browse files
mknaranjareneSchmkilianvolmerHenrZu
authored
1390 further improve documentation (#1427)
- Better getting started on why to use MEmilio and which models to be used when - More motivation from research questions - More Details on dynamic NPIs - Several minor corrections and improvements Co-authored-by: reneSchm <49305466+reneSchm@users.noreply.github.com> Co-authored-by: Kilian Volmer <13285635+kilianvolmer@users.noreply.github.com> Co-authored-by: Henrik Zunker <69154294+HenrZu@users.noreply.github.com>
1 parent 610a823 commit 0fce556

26 files changed

+261
-92
lines changed

cpp/benchmarks/flow_simulation_ode_secirvvs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ void setup_model(Model& model)
719719
model.parameters.template get<osecirvvs::ReducTimeInfectedMild<ScalarType>>()[AgeGroup(0)] = 0.9;
720720

721721
model.parameters.template get<osecirvvs::Seasonality<ScalarType>>() = 0.2;
722-
722+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
723+
// Note that negative values are set to zero instead of stopping the simulation.
723724
model.apply_constraints();
724725
}
725726

cpp/examples/graph_stochastic_mobility.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ int main(int /*argc*/, char** /*argv*/)
8080
contact_matrix.add_damping(
8181
Eigen::MatrixX<ScalarType>::Constant((size_t)num_age_groups, (size_t)num_age_groups, 0.6),
8282
mio::SimulationTime<ScalarType>(5.));
83-
83+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
84+
// Note that negative values are set to zero instead of stopping the simulation.
8485
model.apply_constraints();
8586

8687
//modify model for second node

cpp/examples/ode_secir.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ int main()
7474
model.parameters.get<mio::osecir::SeverePerInfectedSymptoms<ScalarType>>() = 0.2;
7575
model.parameters.get<mio::osecir::CriticalPerSevere<ScalarType>>() = 0.25;
7676
model.parameters.get<mio::osecir::DeathsPerCritical<ScalarType>>() = 0.3;
77-
77+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
78+
// Note that negative values are set to zero instead of stopping the simulation.
7879
model.apply_constraints();
7980

8081
// Using default Integrator

cpp/examples/ode_secir_ageres.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ int main()
3838
ScalarType nb_total_t0 = 10000, nb_exp_t0 = 100, nb_inf_t0 = 50, nb_car_t0 = 50, nb_hosp_t0 = 20, nb_icu_t0 = 10,
3939
nb_rec_t0 = 10, nb_dead_t0 = 0;
4040

41-
// alpha = alpha_in; // percentage of asymptomatic cases
42-
// beta = beta_in; // risk of infection from the infected symptomatic patients
43-
// rho = rho_in; // hospitalized per infected
44-
// theta = theta_in; // icu per hospitalized
45-
// delta = delta_in; // deaths per ICUs
46-
4741
mio::osecir::Model<ScalarType> model(3);
4842
auto nb_groups = model.parameters.get_num_groups();
4943
ScalarType fact = 1.0 / (ScalarType)(size_t)nb_groups;
@@ -82,7 +76,8 @@ int main()
8276
params.get<mio::osecir::CriticalPerSevere<ScalarType>>()[i] = 0.25;
8377
params.get<mio::osecir::DeathsPerCritical<ScalarType>>()[i] = 0.3;
8478
}
85-
79+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
80+
// Note that negative values are set to zero instead of stopping the simulation.
8681
model.apply_constraints();
8782

8883
mio::ContactMatrixGroup<ScalarType>& contact_matrix = params.get<mio::osecir::ContactPatterns<ScalarType>>();

cpp/examples/ode_secir_feedback.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ void initialize_model(mio::osecir::Model<double>& model, int total_population, d
6060
model.populations[{mio::AgeGroup(0), mio::osecir::InfectionState::Dead}] = 0;
6161
model.populations.set_difference_from_total({mio::AgeGroup(0), mio::osecir::InfectionState::Susceptible},
6262
total_population);
63-
63+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
64+
// Note that negative values are set to zero instead of stopping the simulation.
6465
model.apply_constraints();
6566
}
6667

cpp/examples/ode_secir_feedback_graph.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ create_graph(int num_nodes, int total_population, double cont_freq)
111111
else {
112112
model.populations[{mio::AgeGroup(0), mio::osecir::InfectionState::Susceptible}] = total_population;
113113
}
114+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
115+
// Note that negative values are set to zero instead of stopping the simulation.
114116
model.apply_constraints();
115117

116118
// Determine the index for the ICU state (InfectedCritical) for the feedback mechanism

cpp/examples/ode_secir_parameter_study.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ int main()
110110
params.get<mio::osecir::CriticalPerSevere<ScalarType>>()[i] = 0.25;
111111
params.get<mio::osecir::DeathsPerCritical<ScalarType>>()[i] = 0.3;
112112
}
113-
113+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
114+
// Note that negative values are set to zero instead of stopping the simulation.
114115
params.apply_constraints();
115116

116117
mio::ContactMatrixGroup<ScalarType>& contact_matrix = params.get<mio::osecir::ContactPatterns<ScalarType>>();

cpp/examples/ode_secir_read_graph.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ int main(int argc, char** argv)
9393
params.get<mio::osecir::CriticalPerSevere<ScalarType>>()[i] = 0.25;
9494
params.get<mio::osecir::DeathsPerCritical<ScalarType>>()[i] = 0.3;
9595
}
96-
96+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
97+
// Note that negative values are set to zero instead of stopping the simulation.
9798
params.apply_constraints();
9899

99100
mio::ContactMatrixGroup<ScalarType>& contact_matrix = params.get<mio::osecir::ContactPatterns<ScalarType>>();

cpp/examples/ode_secir_save_results.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ int main()
7171
params.get<mio::osecir::CriticalPerSevere<ScalarType>>()[i] = 0.25;
7272
params.get<mio::osecir::DeathsPerCritical<ScalarType>>()[i] = 0.3;
7373
}
74-
74+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
75+
// Note that negative values are set to zero instead of stopping the simulation.
7576
params.apply_constraints();
7677

7778
mio::ContactMatrixGroup<ScalarType>& contact_matrix = params.get<mio::osecir::ContactPatterns<ScalarType>>();

cpp/examples/ode_secirts.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ int main()
132132
mio::SimulationTime<ScalarType>(30.));
133133

134134
model.parameters.get<mio::osecirts::Seasonality<ScalarType>>() = 0.2;
135-
135+
// The function apply_constraints() ensures that all parameters are within their defined bounds.
136+
// Note that negative values are set to zero instead of stopping the simulation.
136137
model.apply_constraints();
137138

138139
mio::TimeSeries<ScalarType> result = mio::osecirts::simulate<ScalarType>(t0, tmax, dt, model);

0 commit comments

Comments
 (0)