├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug.yml │ ├── config.yml │ ├── doc.yml │ ├── enhancement.yml │ └── feature.yml ├── actions │ ├── build-py │ │ └── action.yml │ ├── linux-benchmark │ │ └── action.yml │ ├── linux-build │ │ └── action.yml │ ├── linux-run_examples │ │ └── action.yml │ ├── linux-test │ │ └── action.yml │ ├── test-py │ │ └── action.yml │ ├── test-pylint │ │ └── action.yml │ ├── windows-build │ │ └── action.yml │ ├── windows-run_examples │ │ └── action.yml │ └── windows-test │ │ └── action.yml ├── pull_request_template.md └── workflows │ ├── epidata_main.yml │ └── main.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CITATION.cff ├── CODE_OF_CONDUCT.md ├── LICENSE.txt ├── README.md ├── cpp ├── CMakeLists.txt ├── README.md ├── benchmarks │ ├── CMakeLists.txt │ ├── abm.cpp │ ├── flow_simulation_ode_secirvvs.cpp │ ├── flow_simulation_ode_secirvvs.h │ ├── flow_simulation_ode_seir.cpp │ ├── graph_simulation.config │ ├── graph_simulation.cpp │ ├── graph_simulation.h │ ├── integrator_step.config │ ├── integrator_step.cpp │ ├── integrator_step.h │ ├── profiling.md │ ├── scorep-filter-abm │ ├── secir_ageres_setups.h │ ├── simulation.config │ ├── simulation.cpp │ └── simulation.h ├── cmake │ ├── CodeCoverage.cmake │ ├── DownloadProject.CMakeLists.cmake.in │ ├── DownloadProject.cmake │ ├── FindSphinx.cmake │ └── memilio-config.cmake.in ├── examples │ ├── CMakeLists.txt │ ├── abm_history_object.cpp │ ├── abm_minimal.cpp │ ├── ad_odeint_example.cpp │ ├── ad_square_example.cpp │ ├── adapt_rk_test.cpp │ ├── cli.cpp │ ├── d_abm.cpp │ ├── data_dir.h.in │ ├── euler_test.cpp │ ├── glct_secir.cpp │ ├── graph_abm.cpp │ ├── graph_stochastic_mobility.cpp │ ├── history.cpp │ ├── ide_initialization.cpp │ ├── ide_secir.cpp │ ├── ide_secir_ageres.cpp │ ├── ide_secir_graph.cpp │ ├── ide_seir.cpp │ ├── lct_secir.cpp │ ├── ode_seair.cpp │ ├── ode_seair_optimization.cpp │ ├── ode_secir.cpp │ ├── ode_secir_ageres.cpp │ ├── ode_secir_contact_changes.cpp │ ├── ode_secir_feedback.cpp │ ├── ode_secir_graph.cpp │ ├── ode_secir_parameter_sampling.cpp │ ├── ode_secir_parameter_study.cpp │ ├── ode_secir_parameter_study_graph.cpp │ ├── ode_secir_read_graph.cpp │ ├── ode_secir_save_results.cpp │ ├── ode_secirts.cpp │ ├── ode_secirvvs.cpp │ ├── ode_seir.cpp │ ├── ode_seir_ageres.cpp │ ├── ode_seir_flows.cpp │ ├── ode_sir.cpp │ ├── ode_sir_ageres.cpp │ ├── performance_timers.cpp │ ├── sde_seirvv.cpp │ ├── sde_sir.cpp │ ├── sde_sirs.cpp │ ├── serialize.cpp │ └── smm.cpp ├── memilio │ ├── CMakeLists.txt │ ├── README.md │ ├── ad │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── include │ │ │ └── ad │ │ │ └── ad.hpp │ ├── compartments │ │ ├── README.md │ │ ├── compartmentalmodel.h │ │ ├── feedback_simulation.h │ │ ├── flow_model.h │ │ ├── flow_simulation.h │ │ ├── parameter_studies.h │ │ └── simulation.h │ ├── config.h │ ├── config_internal.h.in │ ├── data │ │ ├── analyze_result.cpp │ │ └── analyze_result.h │ ├── epidemiology │ │ ├── README.md │ │ ├── adoption_rate.h │ │ ├── age_group.h │ │ ├── contact_matrix.cpp │ │ ├── contact_matrix.h │ │ ├── damping.cpp │ │ ├── damping.h │ │ ├── damping_sampling.cpp │ │ ├── damping_sampling.h │ │ ├── dynamic_npis.cpp │ │ ├── dynamic_npis.h │ │ ├── lct_infection_state.h │ │ ├── lct_populations.h │ │ ├── populations.h │ │ ├── simulation_day.h │ │ ├── state_age_function.cpp │ │ ├── state_age_function.h │ │ ├── uncertain_matrix.cpp │ │ └── uncertain_matrix.h │ ├── geography │ │ ├── holiday_data.ipp │ │ ├── regions.cpp │ │ └── regions.h │ ├── io │ │ ├── README.md │ │ ├── binary_serializer.cpp │ │ ├── binary_serializer.h │ │ ├── cli.h │ │ ├── default_serialize.cpp │ │ ├── default_serialize.h │ │ ├── epi_data.cpp │ │ ├── epi_data.h │ │ ├── hdf5_cpp.h │ │ ├── history.h │ │ ├── io.cpp │ │ ├── io.h │ │ ├── json_serializer.cpp │ │ ├── json_serializer.h │ │ ├── mobility_io.cpp │ │ ├── mobility_io.h │ │ ├── result_io.cpp │ │ ├── result_io.h │ │ ├── serializer_base.cpp │ │ └── serializer_base.h │ ├── math │ │ ├── README.md │ │ ├── adapt_rk.cpp │ │ ├── adapt_rk.h │ │ ├── eigen.h │ │ ├── eigen_util.h │ │ ├── euler.cpp │ │ ├── euler.h │ │ ├── floating_point.h │ │ ├── integrator.cpp │ │ ├── integrator.h │ │ ├── interpolation.cpp │ │ ├── interpolation.h │ │ ├── matrix_shape.cpp │ │ ├── matrix_shape.h │ │ ├── smoother.h │ │ ├── stepper_wrapper.cpp │ │ ├── stepper_wrapper.h │ │ ├── time_series_functor.cpp │ │ └── time_series_functor.h │ ├── mobility │ │ ├── README.md │ │ ├── graph.cpp │ │ ├── graph.h │ │ ├── graph_simulation.cpp │ │ ├── graph_simulation.h │ │ ├── metapopulation_mobility_instant.cpp │ │ ├── metapopulation_mobility_instant.h │ │ ├── metapopulation_mobility_stochastic.cpp │ │ └── metapopulation_mobility_stochastic.h │ ├── timer │ │ ├── README.md │ │ ├── auto_timer.h │ │ ├── basic_timer.cpp │ │ ├── basic_timer.h │ │ ├── definitions.cpp │ │ ├── definitions.h │ │ ├── list_printer.h │ │ ├── named_timer.h │ │ ├── registration.h │ │ ├── table_printer.h │ │ └── timer_registrar.h │ └── utils │ │ ├── abstract_parameter_distribution.h │ │ ├── compiler_diagnostics.h │ │ ├── custom_index_array.h │ │ ├── date.cpp │ │ ├── date.h │ │ ├── flow.h │ │ ├── index.h │ │ ├── index_range.h │ │ ├── logging.h │ │ ├── memory.h │ │ ├── metaprogramming.h │ │ ├── miompi.cpp │ │ ├── miompi.h │ │ ├── mioomp.cpp │ │ ├── mioomp.h │ │ ├── parameter_distributions.h │ │ ├── parameter_set.cpp │ │ ├── parameter_set.h │ │ ├── pointer_dereferencing_iterator.h │ │ ├── profiler.h │ │ ├── random_number_generator.cpp │ │ ├── random_number_generator.h │ │ ├── span.cpp │ │ ├── span.h │ │ ├── stl_util.h │ │ ├── string_literal.h │ │ ├── time_series.cpp │ │ ├── time_series.h │ │ ├── transform_iterator.h │ │ ├── type_list.h │ │ ├── type_safe.cpp │ │ ├── type_safe.h │ │ ├── uncertain_value.cpp │ │ ├── uncertain_value.h │ │ └── visitor.h ├── models │ ├── README.md │ ├── abm │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── analyze_result.h │ │ ├── common_abm_loggers.h │ │ ├── config.h │ │ ├── household.cpp │ │ ├── household.h │ │ ├── infection.cpp │ │ ├── infection.h │ │ ├── infection_state.h │ │ ├── intervention_type.h │ │ ├── location.cpp │ │ ├── location.h │ │ ├── location_id.h │ │ ├── location_type.h │ │ ├── lockdown_rules.cpp │ │ ├── lockdown_rules.h │ │ ├── mask.cpp │ │ ├── mask.h │ │ ├── mask_type.h │ │ ├── mobility_data.h │ │ ├── mobility_rules.cpp │ │ ├── mobility_rules.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── model_functions.cpp │ │ ├── model_functions.h │ │ ├── parameters.cpp │ │ ├── parameters.h │ │ ├── person.cpp │ │ ├── person.h │ │ ├── person_id.h │ │ ├── personal_rng.cpp │ │ ├── personal_rng.h │ │ ├── protection_event.h │ │ ├── random_events.h │ │ ├── simulation.cpp │ │ ├── simulation.h │ │ ├── test_type.h │ │ ├── testing_strategy.cpp │ │ ├── testing_strategy.h │ │ ├── time.cpp │ │ ├── time.h │ │ ├── trip_list.cpp │ │ ├── trip_list.h │ │ └── virus_variant.h │ ├── d_abm │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ ├── quad_well.h │ │ ├── simulation.cpp │ │ └── simulation.h │ ├── glct_secir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ └── parameters.h │ ├── graph_abm │ │ ├── CMakeLists.txt │ │ ├── graph_abm_mobility.cpp │ │ ├── graph_abm_mobility.h │ │ ├── graph_abmodel.cpp │ │ └── graph_abmodel.h │ ├── ide_secir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ ├── parameters_io.h │ │ ├── simulation.cpp │ │ └── simulation.h │ ├── ide_seir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ └── parameters.h │ ├── lct_secir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── initializer_flows.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ └── parameters_io.h │ ├── ode_seair │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ └── parameters.h │ ├── ode_secir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── analyze_result.cpp │ │ ├── analyze_result.h │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameter_space.cpp │ │ ├── parameter_space.h │ │ ├── parameters.h │ │ ├── parameters_io.cpp │ │ └── parameters_io.h │ ├── ode_secirts │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── analyze_result.cpp │ │ ├── analyze_result.h │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameter_space.cpp │ │ ├── parameter_space.h │ │ ├── parameters.h │ │ ├── parameters_io.cpp │ │ └── parameters_io.h │ ├── ode_secirvvs │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── analyze_result.cpp │ │ ├── analyze_result.h │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameter_space.cpp │ │ ├── parameter_space.h │ │ ├── parameters.h │ │ ├── parameters_io.cpp │ │ └── parameters_io.h │ ├── ode_seir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ └── parameters.h │ ├── ode_sir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ └── parameters.h │ ├── sde_seirvv │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ └── simulation.h │ ├── sde_sir │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ └── simulation.h │ ├── sde_sirs │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── infection_state.h │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ └── simulation.h │ └── smm │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── model.cpp │ │ ├── model.h │ │ ├── parameters.h │ │ ├── simulation.cpp │ │ └── simulation.h ├── simulations │ ├── 2020_npis_sarscov2_wildtype_germany.cpp │ ├── 2021_vaccination_sarscov2_delta_germany.cpp │ ├── CMakeLists.txt │ ├── README.md │ ├── abm.cpp │ ├── abm_braunschweig.cpp │ ├── data_generation.sh │ └── munich_graph_sim.cpp ├── tests │ ├── CMakeLists.txt │ ├── README.md │ ├── abm_helpers.cpp │ ├── abm_helpers.h │ ├── actions.h │ ├── cmake │ │ ├── AddGoogleTest.cmake │ │ ├── DownloadProject.CMakeLists.cmake.in │ │ └── DownloadProject.cmake │ ├── data │ │ ├── District │ │ │ └── pydata │ │ │ │ ├── confirmed_cases.json │ │ │ │ ├── critical_cases.json │ │ │ │ ├── population_data.json │ │ │ │ └── vaccination_data.json │ │ ├── Germany │ │ │ └── pydata │ │ │ │ ├── cases_all_county_age_ma7.json │ │ │ │ ├── confirmed_cases.json │ │ │ │ ├── county_current_population.json │ │ │ │ ├── county_divi_ma7.json │ │ │ │ ├── critical_cases.json │ │ │ │ ├── population_data.json │ │ │ │ ├── vacc_county_ageinf_ma7.json │ │ │ │ └── vaccination_data.json │ │ ├── cases_all_age_ma7.json │ │ ├── cases_all_county_age_ma7.json │ │ ├── cases_all_germany.json │ │ ├── cases_all_state_age_ma7.json │ │ ├── contacts.txt │ │ ├── county_current_population.json │ │ ├── county_divi.json │ │ ├── county_divi_ma7.json │ │ ├── export_time_series_init_osecirvvs.h5 │ │ ├── export_time_series_initialization_osecir.h5 │ │ ├── export_time_series_initialization_osecirts.h5 │ │ ├── export_time_series_initialization_osecirvvs.h5 │ │ ├── germany_divi.json │ │ ├── graphsimulation-compare.csv │ │ ├── ide-secir-compare.csv │ │ ├── ide-secir-transitions-compare.csv │ │ ├── ide-seir-compare.csv │ │ ├── lct-secir-compartments-compare.csv │ │ ├── lct-secir-subcompartments-compare.csv │ │ ├── ode-secihurd-ageres-compare.csv │ │ ├── ode-sir-compare.csv │ │ ├── results_osecirts.h5 │ │ ├── results_osecirvvs.h5 │ │ ├── seair-compare.csv │ │ ├── secihurd-compare-cashkarp.csv │ │ ├── secihurd-compare.csv │ │ ├── seir-compare.csv │ │ ├── state_divi.json │ │ ├── test_all_ageinf_vacc.json │ │ ├── test_cases_all_age.json │ │ ├── test_county_divi.json │ │ ├── test_current_population.json │ │ ├── test_empty_file.json │ │ ├── vacc_county_ageinf_ma7.json │ │ └── vaccination_test.json │ ├── distributions_helpers.cpp │ ├── distributions_helpers.h │ ├── load_test_data.h │ ├── matchers.cpp │ ├── matchers.h │ ├── random_number_test.h │ ├── sanitizers.cpp │ ├── sir_example_pre_agegroups.txt │ ├── temp_file_register.h │ ├── test_abm_household.cpp │ ├── test_abm_infection.cpp │ ├── test_abm_location.cpp │ ├── test_abm_lockdown_rules.cpp │ ├── test_abm_masks.cpp │ ├── test_abm_mobility_rules.cpp │ ├── test_abm_model.cpp │ ├── test_abm_person.cpp │ ├── test_abm_serialization.cpp │ ├── test_abm_simulation.cpp │ ├── test_abm_testing_strategy.cpp │ ├── test_abstract_parameter_dist.cpp │ ├── test_ad.cpp │ ├── test_analyze_result.cpp │ ├── test_binary_serializer.cpp │ ├── test_compartmentsimulation.cpp │ ├── test_contact_matrix.cpp │ ├── test_custom_index_array.cpp │ ├── test_d_abm_model.cpp │ ├── test_damping.cpp │ ├── test_damping_sampling.cpp │ ├── test_data_dir.h.in │ ├── test_date.cpp │ ├── test_dynamic_npis.cpp │ ├── test_eigen_util.cpp │ ├── test_epi_data_io.cpp │ ├── test_feedback.cpp │ ├── test_flows.cpp │ ├── test_glct_secir.cpp │ ├── test_graph.cpp │ ├── test_graph_abm.cpp │ ├── test_graph_simulation.cpp │ ├── test_history.cpp │ ├── test_ide_parameters_io.cpp │ ├── test_ide_secir.cpp │ ├── test_ide_secir_ageres.cpp │ ├── test_ide_seir.cpp │ ├── test_io_cli.cpp │ ├── test_io_framework.cpp │ ├── test_json_serializer.cpp │ ├── test_lct_initializer_flows.cpp │ ├── test_lct_parameters_io.cpp │ ├── test_lct_secir.cpp │ ├── test_math_floating_point.cpp │ ├── test_math_time_series_functor.cpp │ ├── test_matrix_shape.cpp │ ├── test_metaprogramming.cpp │ ├── test_mobility.cpp │ ├── test_mobility_io.cpp │ ├── test_model.cpp │ ├── test_numericalIntegration.cpp │ ├── test_odeseair.cpp │ ├── test_odesecir.cpp │ ├── test_odesecir_ageres.cpp │ ├── test_odesecirts.cpp │ ├── test_odesecirvvs.cpp │ ├── test_odeseir.cpp │ ├── test_odesir.cpp │ ├── test_parameter_set.cpp │ ├── test_parameter_studies.cpp │ ├── test_populations.cpp │ ├── test_random_number_generator.cpp │ ├── test_regions.cpp │ ├── test_save_parameters.cpp │ ├── test_save_results.cpp │ ├── test_sde_seirvv.cpp │ ├── test_sde_sir.cpp │ ├── test_sde_sirs.cpp │ ├── test_smm_model.cpp │ ├── test_smoother.cpp │ ├── test_state_age_function.cpp │ ├── test_stl_util.cpp │ ├── test_time_series.cpp │ ├── test_timers.cpp │ ├── test_transform_iterator.cpp │ ├── test_type_safe.cpp │ ├── test_uncertain.cpp │ ├── test_utils.cpp │ ├── testmain.cpp │ └── utils.h └── thirdparty │ ├── CMakeLists.txt │ └── README.md ├── data ├── Germany │ └── contacts │ │ ├── baseline_home.txt │ │ ├── baseline_other.txt │ │ ├── baseline_school_pf_aver.txt │ │ ├── baseline_school_pf_eig.txt │ │ ├── baseline_school_prem.txt │ │ ├── baseline_work.txt │ │ ├── minimum_home.txt │ │ ├── minimum_other.txt │ │ ├── minimum_school_pf_aver.txt │ │ ├── minimum_school_pf_eig.txt │ │ ├── minimum_school_prem.txt │ │ └── minimum_work.txt └── README.md ├── docs ├── Doxyfile ├── Makefile ├── README.md ├── make.bat ├── memilio-small.png ├── memilio.ico ├── requirements.txt └── source │ ├── _static │ └── custom.css │ ├── _templates │ ├── autosummary │ │ ├── class.rst │ │ └── module.rst │ └── breadcrumbs.html │ ├── citation.rst │ ├── conf.py │ ├── cpp │ ├── aggregated_models.rst │ ├── diffusive_abm.rst │ ├── glct.rst │ ├── ide.rst │ ├── ide_creation.rst │ ├── individual_models.rst │ ├── installation.rst │ ├── io.rst │ ├── lct.rst │ ├── lct_creation.rst │ ├── metapop.rst │ ├── mobility.rst │ ├── mobility_based_abm.rst │ ├── mobility_metapop.rst │ ├── model_creation.rst │ ├── model_usage.rst │ ├── ode.rst │ ├── ode_creation.rst │ ├── overview.rst │ ├── performance_timers.rst │ ├── sde.rst │ ├── sde_creation.rst │ └── structure.rst │ ├── development.rst │ ├── faq.rst │ ├── getting_started.rst │ ├── index.rst │ ├── models │ ├── abm.rst │ ├── glsecir.rst │ ├── index.rst │ ├── isecir.rst │ ├── iseir.rst │ ├── lsecir.rst │ ├── ode_seir.rst │ ├── ode_sir.rst │ ├── oseair.rst │ ├── osecir.rst │ ├── sde_sirs.rst │ ├── sdeseir.rst │ ├── sdesir.rst │ ├── secirts.rst │ └── secirvvs.rst │ ├── python │ ├── memilio_epidata.rst │ ├── memilio_generation.rst │ ├── memilio_plot.rst │ ├── memilio_simulation.rst │ ├── memilio_surrogate.rst │ ├── model_creation.rst │ ├── model_usage.rst │ ├── python_bindings_patterns.rst │ └── python_packages.rst │ ├── pythonapi │ ├── memilio.simulation.abm.rst │ ├── memilio.simulation.osecir.rst │ ├── memilio.simulation.osecirvvs.rst │ ├── memilio.simulation.oseir.rst │ ├── memilio.simulation.osir.rst │ ├── memilio.simulation.rst │ └── pythonapi.rst │ └── references.rst ├── pycode ├── README.rst ├── examples │ ├── epidata │ │ ├── PlotCaseData.py │ │ ├── PlotGermanData.py │ │ └── ProgressIndicator.py │ ├── plot │ │ ├── Synthetic_data_counties_sh.json │ │ └── plotResultsMapGermany.py │ └── simulation │ │ ├── 2020_npis_sarscov2_wildtype_germany.py │ │ ├── 2021_vaccination_sarscov2_delta_germany.py │ │ ├── mobility_parameter_study.py │ │ ├── ode_secir_ageres.py │ │ ├── ode_secir_groups.py │ │ ├── ode_secir_mobility.py │ │ ├── ode_secir_parameter_study.py │ │ ├── ode_secir_simple.py │ │ ├── ode_secirvvs_simple.py │ │ ├── ode_seir_flows.py │ │ ├── ode_seir_simple.py │ │ └── ode_sir_simple.py ├── memilio-epidata │ ├── README.rst │ ├── memilio │ │ ├── __init__.py │ │ ├── epidata │ │ │ ├── README.rst │ │ │ ├── __init__.py │ │ │ ├── cleanData.py │ │ │ ├── customPlot.py │ │ │ ├── defaultDict.py │ │ │ ├── download_config.conf │ │ │ ├── geoModificationGermany.py │ │ │ ├── getCaseData.py │ │ │ ├── getCommuterMobility.py │ │ │ ├── getDIVIData.py │ │ │ ├── getDataIntoPandasDataFrame.py │ │ │ ├── getHospitalizationData.py │ │ │ ├── getJHData.py │ │ │ ├── getNPIData.py │ │ │ ├── getPopulationData.py │ │ │ ├── getSimulationData.py │ │ │ ├── getTestingData.py │ │ │ ├── getVaccinationData.py │ │ │ ├── modifyDataframeSeries.py │ │ │ ├── progress_indicator.py │ │ │ ├── transformMobilityData.py │ │ │ └── transformWeatherData.py │ │ └── epidata_test │ │ │ ├── __init__.py │ │ │ ├── test_data │ │ │ ├── TestSetCaseArcgis.json │ │ │ ├── TestSetCaseEstimationsDeaths.json │ │ │ ├── TestSetCaseEstimationsDeathsWeekly.json │ │ │ ├── TestSetCaseEstimationsDeathsWeeklyGender.json │ │ │ ├── TestSetCaseGithub.json │ │ │ ├── TestSetCaseRead.json │ │ │ ├── TestSetFullDIVIData.json │ │ │ ├── TestSetFullHospitalizationData.json │ │ │ ├── TestSetNPIsCaseData.json │ │ │ ├── TestSetNPIsCombinations.json │ │ │ ├── TestSetNPIsDescription.json │ │ │ ├── TestSetNPIsPopulationData.json │ │ │ ├── TestSetNPIsUnterkategorien.json │ │ │ ├── TestSetPopulationExport.json │ │ │ ├── TestSetPopulationFinal.json │ │ │ └── TestSetPopulationRaw.json │ │ │ ├── test_epidata_cleandata.py │ │ │ ├── test_epidata_customPlot.py │ │ │ ├── test_epidata_defaultDict.py │ │ │ ├── test_epidata_geoModificationGermany.py │ │ │ ├── test_epidata_getCaseData.py │ │ │ ├── test_epidata_getCommuterMobility.py │ │ │ ├── test_epidata_getDataIntoPandasDataFrame.py │ │ │ ├── test_epidata_getHospitalizationData.py │ │ │ ├── test_epidata_getNPIData.py │ │ │ ├── test_epidata_get_divi_data.py │ │ │ ├── test_epidata_get_jh_data.py │ │ │ ├── test_epidata_get_population_data.py │ │ │ ├── test_epidata_get_simulation_data.py │ │ │ ├── test_epidata_get_vaccination_data.py │ │ │ ├── test_epidata_modifyDataframeSeries.py │ │ │ ├── test_epidata_progress_indicator.py │ │ │ └── test_epidata_transform_mobility_data.py │ ├── requirements-dev.txt │ ├── setup.py │ └── tools │ │ └── script_to_extract_every_county_once.py ├── memilio-generation │ ├── CMakeLists.txt │ ├── README.md │ ├── generator_workflow.png │ ├── memilio │ │ ├── __init__.py │ │ ├── generation │ │ │ ├── __init__.py │ │ │ ├── ast.py │ │ │ ├── default_generation_dict.py │ │ │ ├── generator.py │ │ │ ├── graph_visualization.py │ │ │ ├── intermediate_representation.py │ │ │ ├── scanner.py │ │ │ ├── scanner_config.py │ │ │ ├── template │ │ │ │ ├── __init__.py │ │ │ │ ├── template_cpp.txt │ │ │ │ ├── template_py.txt │ │ │ │ └── template_string.py │ │ │ └── utility.py │ │ ├── generation_test │ │ │ ├── __init__.py │ │ │ ├── test_data │ │ │ │ ├── test_oseir.cpp.txt │ │ │ │ └── test_oseir.py.txt │ │ │ └── test_oseir_generation.py │ │ └── tools │ │ │ ├── README.md │ │ │ ├── config.json │ │ │ ├── config.json.txt │ │ │ └── example_oseir.py │ ├── requirements-dev.txt │ └── setup.py ├── memilio-plot │ ├── README.md │ ├── memilio │ │ ├── __init__.py │ │ ├── plot │ │ │ ├── __init__.py │ │ │ ├── createGIF.py │ │ │ └── plotMap.py │ │ └── plot_test │ │ │ ├── __init__.py │ │ │ ├── test_data │ │ │ └── Synthetic_data_counties_sh.json │ │ │ ├── test_plot_createGIF.py │ │ │ └── test_plot_plotMap.py │ ├── requirements-dev.txt │ └── setup.py ├── memilio-simulation │ ├── CMakeLists.txt │ ├── README.md │ ├── memilio │ │ ├── __init__.py │ │ ├── simulation │ │ │ ├── __init__.py │ │ │ ├── abm.py │ │ │ ├── bindings │ │ │ │ ├── compartments │ │ │ │ │ ├── compartmentalmodel.h │ │ │ │ │ ├── flow_simulation.h │ │ │ │ │ └── simulation.h │ │ │ │ ├── epidemiology │ │ │ │ │ ├── age_group.h │ │ │ │ │ ├── contact_matrix.h │ │ │ │ │ ├── damping.h │ │ │ │ │ ├── damping_sampling.cpp │ │ │ │ │ ├── damping_sampling.h │ │ │ │ │ ├── dynamic_npis.h │ │ │ │ │ ├── populations.h │ │ │ │ │ ├── simulation_day.h │ │ │ │ │ ├── uncertain_matrix.cpp │ │ │ │ │ └── uncertain_matrix.h │ │ │ │ ├── io │ │ │ │ │ ├── mobility_io.h │ │ │ │ │ └── result_io.h │ │ │ │ ├── math │ │ │ │ │ └── integrator.h │ │ │ │ ├── mobility │ │ │ │ │ ├── graph_simulation.h │ │ │ │ │ ├── metapopulation_mobility_instant.cpp │ │ │ │ │ └── metapopulation_mobility_instant.h │ │ │ │ ├── models │ │ │ │ │ ├── abm.cpp │ │ │ │ │ ├── osecir.cpp │ │ │ │ │ ├── osecirvvs.cpp │ │ │ │ │ ├── oseir.cpp │ │ │ │ │ └── osir.cpp │ │ │ │ ├── pickle_serializer.h │ │ │ │ ├── pybind_util.h │ │ │ │ ├── simulation.cpp │ │ │ │ └── utils │ │ │ │ │ ├── custom_index_array.h │ │ │ │ │ ├── date.cpp │ │ │ │ │ ├── date.h │ │ │ │ │ ├── index.h │ │ │ │ │ ├── logging.cpp │ │ │ │ │ ├── logging.h │ │ │ │ │ ├── parameter_distributions.cpp │ │ │ │ │ ├── parameter_distributions.h │ │ │ │ │ ├── parameter_set.h │ │ │ │ │ ├── time_series.cpp │ │ │ │ │ ├── time_series.h │ │ │ │ │ ├── uncertain_value.cpp │ │ │ │ │ └── uncertain_value.h │ │ │ ├── osecir.py │ │ │ ├── osecirvvs.py │ │ │ ├── oseir.py │ │ │ └── osir.py │ │ └── simulation_test │ │ │ ├── __init__.py │ │ │ ├── data │ │ │ ├── ode-secihurd-ageres-compare.csv │ │ │ ├── ode-secihurd-compare.csv │ │ │ ├── ode-secirvvs-compare.csv │ │ │ └── ode-seir-compare.csv │ │ │ ├── test_abm.py │ │ │ ├── test_analyze_result.py │ │ │ ├── test_custom_index_array.py │ │ │ ├── test_date.py │ │ │ ├── test_distributions.py │ │ │ ├── test_dynamic_npis.py │ │ │ ├── test_integrators.py │ │ │ ├── test_mobility.py │ │ │ ├── test_osecir.py │ │ │ ├── test_osecir_ageres.py │ │ │ ├── test_osecirvvs.py │ │ │ ├── test_oseir.py │ │ │ ├── test_osir.py │ │ │ ├── test_parameter_study.py │ │ │ ├── test_pickle.py │ │ │ ├── test_regions.py │ │ │ ├── test_time_series.py │ │ │ ├── test_uncertain_matrix.py │ │ │ └── test_uncertain_value.py │ ├── requirements-dev.txt │ ├── setup.py │ └── tools │ │ └── generate_stubs.py ├── memilio-surrogatemodel │ ├── README.md │ ├── memilio │ │ ├── __init__.py │ │ ├── surrogatemodel │ │ │ ├── __init__.py │ │ │ ├── ode_secir_groups │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── data_generation.py │ │ │ │ ├── model.py │ │ │ │ └── network_architectures.py │ │ │ └── ode_secir_simple │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── data_generation.py │ │ │ │ ├── grid_search.py │ │ │ │ ├── hyperparameter_tuning.py │ │ │ │ ├── model.py │ │ │ │ └── network_architectures.py │ │ └── surrogatemodel_test │ │ │ ├── __init__.py │ │ │ ├── test_surrogatemodel_ode_secir_groups.py │ │ │ └── test_surrogatemodel_ode_secir_simple.py │ ├── requirements-dev.txt │ └── setup.py └── pylintrc ├── pyproject.toml └── tools ├── breakAdder.sh ├── check_for_license.sh ├── plot_results_odesecir.ipynb ├── plot_results_odesecirvvs.ipynb └── sort_csv_chunked.py /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | IndentWidth: 4 3 | SortIncludes: false 4 | ColumnLimit: 120 5 | AlignTrailingComments: false 6 | AccessModifierOffset: -4 7 | AlignConsecutiveAssignments: true 8 | ReflowComments: false 9 | BraceWrapping: 10 | AfterClass: true 11 | AfterFunction: true 12 | BeforeElse: true 13 | BeforeCatch: true 14 | AfterNamespace: true 15 | AfterEnum: true 16 | BreakBeforeBraces: "Custom" 17 | PointerAlignment: Left 18 | AllowShortFunctionsOnASingleLine: false 19 | NamespaceIndentation: None 20 | BreakConstructorInitializersBeforeComma: true 21 | AlwaysBreakTemplateDeclarations: Yes 22 | AllowShortLambdasOnASingleLine: Empty 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Further Help 4 | url: https://github.com/SciCompMod/memilio/discussions 5 | about: Please discuss and ask questions there. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/doc.yml: -------------------------------------------------------------------------------- 1 | name: "📚 Documentation" 2 | description: "Report Documentation Issues." 3 | labels: 4 | - "class::documentation" 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: "Please check our [existing issues](https://github.com/SciCompMod/memilio/issues) beforehand." 9 | - type: textarea 10 | id: doc-description 11 | attributes: 12 | label: "Provide a description of requested documentation changes." 13 | validations: 14 | required: true 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.yml: -------------------------------------------------------------------------------- 1 | name: "🚀 Enhancement" 2 | description: "Use this template to describe an Enhancement of MEmilio" 3 | labels: 4 | - "class::improvement" 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: "Please check our [existing issues](https://github.com/SciCompMod/memilio/issues) beforehand." 9 | - type: textarea 10 | id: motivation 11 | attributes: 12 | label: "Motivation / Current Behaviour" 13 | description: "Describe the motivation / current behaviour." 14 | - type: textarea 15 | id: enhancement-description 16 | attributes: 17 | label: "Enhancement description" 18 | description: "Describe the enhancement." 19 | validations: 20 | required: true 21 | - type: textarea 22 | id: -context 23 | attributes: 24 | label: "Additional context" 25 | description: "Code location/examples, Papers, Mathematics, put them here." 26 | - type: checkboxes 27 | id: checks 28 | attributes: 29 | label: Checklist 30 | description: Add Labels and add this issue to a project. 31 | options: 32 | - label: "Attached labels, especially loc:: or model:: labels." 33 | required: false 34 | - label: Linked to project 35 | required: false 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.yml: -------------------------------------------------------------------------------- 1 | name: "⭐️ Feature" 2 | description: "Use this template to propose a new feature for MEmilio" 3 | labels: 4 | - "class::feature" 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: "Please check our [existing issues](https://github.com/SciCompMod/memilio/issues) beforehand." 9 | - type: textarea 10 | id: Feature-description 11 | attributes: 12 | label: "Feature description" 13 | description: "Describe the feature." 14 | validations: 15 | required: true 16 | 17 | - type: textarea 18 | id: -context 19 | attributes: 20 | label: "Additional context" 21 | description: "Code location/examples, Papers, Mathematics, put them here." 22 | 23 | - type: checkboxes 24 | id: checks 25 | attributes: 26 | label: Checklist 27 | description: Add Labels and add this issue to a project. 28 | options: 29 | - label: "Attached labels, especially loc:: or model:: labels." 30 | required: false 31 | - label: Linked to project. 32 | required: false 33 | -------------------------------------------------------------------------------- /.github/actions/linux-benchmark/action.yml: -------------------------------------------------------------------------------- 1 | name: "Linux Benchmark" 2 | description: "Run the C++ unit tests on linux." 3 | inputs: 4 | build-artifact: 5 | description: "Name of the build artifact that contains the benchmark binary." 6 | required: true 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Install Dependencies 11 | shell: bash 12 | run: | 13 | sudo apt-get -qq update 14 | sudo apt-get -qq -y install libhdf5-10* wget gnupg lcov 15 | sudo apt-get -qq update 16 | - name: Download built test directory 17 | uses: actions/download-artifact@v4 18 | with: 19 | name: ${{ inputs.build-artifact }} 20 | path: cpp 21 | - name: extract build archive 22 | shell: bash 23 | run: | 24 | cd cpp 25 | tar -xzf build.tar.gz 26 | - name: Run benchmark 27 | shell: bash 28 | run: | 29 | cd cpp/build/bin 30 | sudo chmod a+x abm_benchmark 31 | ./abm_benchmark --benchmark_out="abm_benchmark.json" --benchmark_repetitions=10 32 | - name: Upload benchmark result 33 | uses: actions/upload-artifact@v4 34 | with: 35 | name: abm-benchmark-report 36 | path: cpp/build/bin/abm_benchmark.json 37 | if-no-files-found: error 38 | retention-days: 10 39 | -------------------------------------------------------------------------------- /.github/actions/linux-run_examples/action.yml: -------------------------------------------------------------------------------- 1 | name: "Linux Examples" 2 | description: "Run the C++ examples on linux." 3 | inputs: 4 | build-artifact: 5 | description: "Name of the build artifact that contains the unit test binary." 6 | required: true 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Install Dependencies 11 | shell: bash 12 | run: | 13 | sudo apt-get -qq update 14 | sudo apt-get -qq -y install libhdf5-10* wget gnupg lcov 15 | sudo apt-get -qq update 16 | - name: Download examples directory 17 | uses: actions/download-artifact@v4 18 | with: 19 | name: ${{ inputs.build-artifact }} 20 | path: cpp 21 | - name: extract examples archive 22 | shell: bash 23 | run: | 24 | cd cpp 25 | tar -xzf build.tar.gz 26 | - name: Run examples 27 | shell: bash 28 | run: | 29 | cd cpp/build/bin 30 | sudo chmod -R a+x ./ 31 | numberoffiles=$(ls -dq *_example | wc -l) 32 | if [[ "$numberoffiles" -gt "0" ]]; then 33 | echo "Running Linux examples." 34 | find . -name "*_example" -print0 | xargs -0 -n1 -P 1 -t bash -c || exit 1 35 | else 36 | echo "No Files found with name _example, abort." 37 | exit 1 38 | fi 39 | -------------------------------------------------------------------------------- /.github/actions/windows-run_examples/action.yml: -------------------------------------------------------------------------------- 1 | name: "Windows Examples" 2 | description: "Run the C++ examples on Windows" 3 | inputs: 4 | build-artifact: 5 | description: "Name of the build artifact that contains the example binary." 6 | required: true 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Download built example directory 11 | uses: actions/download-artifact@v4 12 | with: 13 | name: ${{ inputs.build-artifact }} 14 | path: cpp/build-win/bin 15 | - name: Run examples 16 | shell: pwsh 17 | run: | 18 | cd cpp/build-win/bin 19 | $errchk = (Get-ChildItem -Path ./| Where-Object { $_.Name -like "*_example.exe"} | Measure-Object).Count 20 | if( $errchk -gt 0){ 21 | Write-Output "Running windows Examples." 22 | Get-ChildItem -Path ./| Where-Object { $_.Name -like "*_example.exe" } | ForEach-Object { 23 | Write-Output "Running $($_.Name)" 24 | & $_.FullName 25 | if ($LASTEXITCODE -ne 0) { 26 | Write-Error "Programm terminated with error, abort." 27 | Exit 1 28 | } 29 | } 30 | } 31 | else { 32 | Write-Output "No Examples found, abort." 33 | Exit 1 34 | } 35 | -------------------------------------------------------------------------------- /.github/actions/windows-test/action.yml: -------------------------------------------------------------------------------- 1 | name: "Windows Test" 2 | description: "Run the C++ unit tests on Windows" 3 | inputs: 4 | artifact-pattern: 5 | description: "Name of the build artifact that contains the unit test binary, will also be used for upload artifacts." 6 | required: true 7 | optional-deps: 8 | description: "Optional dependencies of unit test binary (ON or OFF, default ON). If OFF, adds `-nodep` to the artifact name." 9 | required: false 10 | default: "ON" 11 | runs: 12 | using: "composite" 13 | steps: 14 | - name: Download built test directory 15 | uses: actions/download-artifact@v4 16 | with: 17 | name: build-cpp-windows-${{ inputs.artifact-pattern }}${{ inputs.optional-deps == 'OFF' && '-nodep' || ''}} 18 | path: cpp/build-win/bin 19 | - name: Run unit tests 20 | shell: pwsh 21 | run: | 22 | cd cpp/build-win/bin 23 | .\memilio-test.exe --gtest_output="xml:report.xml" 24 | - name: Upload report 25 | uses: actions/upload-artifact@v4 26 | with: 27 | name: test-cpp-win-report-${{ inputs.artifact-pattern }}${{ inputs.optional-deps == 'OFF' && '-nodep' || ''}} 28 | path: | 29 | cpp/build-win/bin/report.xml 30 | retention-days: 1 31 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: ^(docs|cpp)/ 2 | repos: 3 | - repo: https://github.com/pre-commit/pre-commit-hooks 4 | rev: v4.3.0 5 | hooks: 6 | - id: check-merge-conflict 7 | - id: check-yaml 8 | - repo: https://github.com/asottile/pyupgrade 9 | rev: v3.2.2 10 | hooks: 11 | - id: pyupgrade 12 | args: [--py37-plus] 13 | - repo: https://github.com/pre-commit/mirrors-autopep8 14 | rev: v2.0.0 15 | hooks: 16 | - id: autopep8 17 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | build: 4 | os: "ubuntu-lts-latest" 5 | apt_packages: 6 | - libmagic1 7 | tools: 8 | python: "3.10" 9 | 10 | python: 11 | install: 12 | - requirements: docs/requirements.txt 13 | 14 | sphinx: 15 | configuration: docs/source/conf.py 16 | -------------------------------------------------------------------------------- /cpp/benchmarks/graph_simulation.config: -------------------------------------------------------------------------------- 1 | { 2 | "dt" : 0.5, 3 | "num_agegroups" : 6, 4 | "t0" : 0, 5 | "t_max" : 1, 6 | "num_regions" : 100 7 | } -------------------------------------------------------------------------------- /cpp/benchmarks/integrator_step.config: -------------------------------------------------------------------------------- 1 | { 2 | "abs_tol" : 1e-10, 3 | "dt_init" : 1, 4 | "dt_max" : 1.7976931348623157e+308, 5 | "dt_min" : 2.2250738585072014e-308, 6 | "num_agegroups" : 1, 7 | "rel_tol" : 1e-5, 8 | "t_init" : 50, 9 | "yt" : 10 | [ 11 | 6377.873644, 12 | 35.24915600, 13 | 30.02961100, 14 | 0.000000000, 15 | 182.1458650, 16 | 0.000000000, 17 | 66.15305900, 18 | 79.53062100, 19 | 3069.383604, 20 | 159.6344400 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /cpp/benchmarks/scorep-filter-abm: -------------------------------------------------------------------------------- 1 | SCOREP_FILE_NAMES_BEGIN 2 | EXCLUDE * 3 | INCLUDE */models/abm/* 4 | INCLUDE */simulations/abm* 5 | SCOREP_FILE_NAMES_END 6 | 7 | SCOREP_REGION_NAMES_BEGIN 8 | EXCLUDE * 9 | INCLUDE *Model::begin_step* *Model::interaction* *Model::perform_mobility* 10 | INCLUDE *Model::evolve* 11 | INCLUDE *Simulation::evolve_model* 12 | INCLUDE *Simulation::advance* 13 | SCOREP_REGION_NAMES_END 14 | -------------------------------------------------------------------------------- /cpp/benchmarks/simulation.config: -------------------------------------------------------------------------------- 1 | { 2 | "abs_tol" : 1e-10, 3 | "dt" : 0.5, 4 | "dt_max" : 1.7976931348623157e+308, 5 | "dt_min" : 2.2250738585072014e-308, 6 | "num_agegroups" : 10, 7 | "rel_tol" : 1e-05, 8 | "t0" : 0, 9 | "t_max" : 100 10 | } 11 | -------------------------------------------------------------------------------- /cpp/cmake/DownloadProject.CMakeLists.cmake.in: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved MIT License. See accompanying 2 | # file LICENSE or https://github.com/Crascit/DownloadProject for details. 3 | 4 | cmake_minimum_required(VERSION 2.8.2) 5 | 6 | project(${DL_ARGS_PROJ}-download NONE) 7 | 8 | include(ExternalProject) 9 | ExternalProject_Add(${DL_ARGS_PROJ}-download 10 | ${DL_ARGS_UNPARSED_ARGUMENTS} 11 | SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" 12 | BINARY_DIR "${DL_ARGS_BINARY_DIR}" 13 | CONFIGURE_COMMAND "" 14 | BUILD_COMMAND "" 15 | INSTALL_COMMAND "" 16 | TEST_COMMAND "" 17 | ) 18 | -------------------------------------------------------------------------------- /cpp/cmake/FindSphinx.cmake: -------------------------------------------------------------------------------- 1 | #Look for an executable called sphinx-build 2 | find_program(SPHINX_EXECUTABLE 3 | NAMES sphinx-build 4 | DOC "Path to sphinx-build executable") 5 | 6 | include(FindPackageHandleStandardArgs) 7 | 8 | #Handle standard arguments to find_package like REQUIRED and QUIET 9 | find_package_handle_standard_args(Sphinx 10 | "Failed to find sphinx-build executable" 11 | SPHINX_EXECUTABLE) 12 | -------------------------------------------------------------------------------- /cpp/cmake/memilio-config.cmake.in: -------------------------------------------------------------------------------- 1 | get_filename_component(MEMILIO_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 2 | 3 | if(NOT TARGET @PROJECT_NAME@::@PROJECT_NAME@) 4 | include("${MEMILIO_CMAKE_DIR}/@PROJECT_NAME@-targets.cmake") 5 | endif() 6 | 7 | set(MEMILIO_LIBRARIES @PROJECT_NAME@::@PROJECT_NAME@) 8 | -------------------------------------------------------------------------------- /cpp/examples/data_dir.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 DATA_DIR_H 21 | #define DATA_DIR_H 22 | 23 | const char* const DATA_DIR = "${MEMILIO_DATA_DIR}"; 24 | 25 | #endif //DATA_DIR_H 26 | -------------------------------------------------------------------------------- /cpp/memilio/README.md: -------------------------------------------------------------------------------- 1 | # MEmilio C++ modelling framework # 2 | 3 | This directory contains the framework used to build all our epidemiological models. 4 | 5 | Subdirectories: 6 | - utils: Generic utility functions, i.e. not specific to epidemiological programms. 7 | - io: Utility for writing and reading data to and from files in different formats. 8 | - math: Math utility. 9 | - epidemiology: Classes and functions that are useful in any type of epidemiological model. 10 | - compartments: Classes and functions that can be used to create compartment (i.e. SIR-type) models. 11 | - mobility: Model-independent loose coupling to model mobility between different model instances that represent e.g. geographic regions. 12 | -------------------------------------------------------------------------------- /cpp/memilio/ad/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(AD CXX) 3 | 4 | add_library(AD INTERFACE) 5 | add_library(AD::AD ALIAS AD) 6 | 7 | target_include_directories(AD INTERFACE 8 | $ 9 | $) 10 | 11 | target_link_libraries(AD INTERFACE spdlog::spdlog) 12 | 13 | ### installation related stuff #### 14 | 15 | install(TARGETS AD 16 | EXPORT ADConfig 17 | LIBRARY DESTINATION lib COMPONENT AD 18 | ARCHIVE DESTINATION lib COMPONENT AD 19 | RUNTIME DESTINATION bin COMPONENT AD 20 | INCLUDES DESTINATION include) 21 | 22 | install(EXPORT ADConfig 23 | FILE ADConfig.cmake 24 | NAMESPACE AD:: 25 | DESTINATION lib/cmake/ADConfig 26 | COMPONENT AD) 27 | 28 | 29 | install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" 30 | DESTINATION "include" 31 | COMPONENT AD 32 | ) 33 | -------------------------------------------------------------------------------- /cpp/memilio/ad/README.md: -------------------------------------------------------------------------------- 1 | # AD 2 | 3 | Algorithmic differentiation library by Uwe Naumann's group. See the book "The Art of Differentiating Computer Programs" by Uwe Naumann. 4 | -------------------------------------------------------------------------------- /cpp/memilio/config_internal.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | /** 22 | * Configured by cmake. 23 | */ 24 | 25 | #ifndef MIO_CONFIG_INTERNAL_H 26 | #define MIO_CONFIG_INTERNAL_H 27 | 28 | #cmakedefine MEMILIO_HAS_HDF5 29 | #cmakedefine MEMILIO_HAS_JSONCPP 30 | #cmakedefine MEMILIO_ENABLE_MPI 31 | #cmakedefine MEMILIO_ENABLE_OPENMP 32 | #cmakedefine MEMILIO_ENABLE_PROFILING 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/README.md: -------------------------------------------------------------------------------- 1 | This directory contains utility functions and classes that can be used in any type of epidemiological simulation. 2 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/contact_matrix.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/epidemiology/contact_matrix.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/damping.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/epidemiology/damping.h" 21 | #include "memilio/utils/stl_util.h" 22 | #include "memilio/math/smoother.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace mio 30 | { 31 | 32 | } // namespace mio 33 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/damping_sampling.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/epidemiology/damping_sampling.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/dynamic_npis.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/epidemiology/dynamic_npis.h" 21 | 22 | namespace mio 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/simulation_day.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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_EPI_SIMULATION_DAY_H 21 | #define MIO_EPI_SIMULATION_DAY_H 22 | 23 | #include "memilio/utils/index.h" 24 | 25 | namespace mio 26 | { 27 | 28 | /** 29 | * Represents the simulation time as an integer index. 30 | */ 31 | class SimulationDay : public Index 32 | { 33 | public: 34 | using Index::Index; 35 | }; 36 | 37 | } // namespace mio 38 | 39 | #endif //MIO_EPI_SIMULATION_DAY_H 40 | -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/state_age_function.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Anna Wendler, Lena Ploetzke 5 | * 6 | * Contact: Martin J. Kuehn 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 | namespace mio 22 | { 23 | 24 | } // namespace mio -------------------------------------------------------------------------------- /cpp/memilio/epidemiology/uncertain_matrix.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/epidemiology/uncertain_matrix.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/io/binary_serializer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/io/binary_serializer.h" 22 | -------------------------------------------------------------------------------- /cpp/memilio/io/default_serialize.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/io/default_serialize.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/io/json_serializer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/io/json_serializer.h" 21 | 22 | #ifdef MEMILIO_HAS_JSONCPP 23 | 24 | #endif //MEMILIO_HAS_JSONCPP 25 | -------------------------------------------------------------------------------- /cpp/memilio/io/serializer_base.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/io/serializer_base.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/math/adapt_rk.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Daniel Abele, Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/math/adapt_rk.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/math/eigen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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_UTILS_EIGEN_H 21 | #define MIO_UTILS_EIGEN_H 22 | 23 | // this file wraps includes from eigen3 library to disable warnings 24 | // Eigen is treated as a system library through cmake since #1168, so ALL warnings within the library are disabled 25 | 26 | #include 27 | 28 | #endif // MIO_UTILS_EIGEN_H 29 | -------------------------------------------------------------------------------- /cpp/memilio/math/euler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/math/euler.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/math/integrator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/math/integrator.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/math/interpolation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: David Kerkmann, Sascha Korf 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "interpolation.h" 22 | -------------------------------------------------------------------------------- /cpp/memilio/math/matrix_shape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/math/matrix_shape.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/math/stepper_wrapper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/math/stepper_wrapper.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/math/time_series_functor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/math/time_series_functor.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/mobility/graph.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/mobility/graph.h" 21 | 22 | namespace mio 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cpp/memilio/mobility/graph_simulation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/mobility/graph_simulation.h" 21 | 22 | namespace mio 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cpp/memilio/mobility/metapopulation_mobility_instant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/mobility/metapopulation_mobility_instant.h" 21 | 22 | namespace mio 23 | { 24 | } // namespace mio 25 | -------------------------------------------------------------------------------- /cpp/memilio/mobility/metapopulation_mobility_stochastic.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Julia Bicker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/mobility/metapopulation_mobility_stochastic.h" 21 | 22 | namespace mio 23 | { 24 | 25 | } // namespace mio 26 | -------------------------------------------------------------------------------- /cpp/memilio/timer/README.md: -------------------------------------------------------------------------------- 1 | # MEmilio C++ timing framework 2 | 3 | This directory contains MEmilio's performance timers. 4 | 5 | To get started, check out the 6 | [official documentation](https://memilio.readthedocs.io/en/latest/cpp/performance_timers.html), or the 7 | [code example](../../examples/performance_timers.cpp). 8 | -------------------------------------------------------------------------------- /cpp/memilio/timer/basic_timer.cpp: -------------------------------------------------------------------------------- 1 | #include "memilio/timer/basic_timer.h" 2 | #include "memilio/utils/logging.h" 3 | 4 | namespace mio 5 | { 6 | namespace timing 7 | { 8 | 9 | void BasicTimer::set_running(bool new_state) 10 | { 11 | #ifndef NDEBUG 12 | m_is_running = new_state; 13 | #else 14 | mio::unused(new_state); 15 | #endif 16 | } 17 | 18 | void BasicTimer::should_be_running(bool expected, const std::string_view function) const 19 | { 20 | #ifndef NDEBUG 21 | if (m_is_running != expected) { 22 | mio::log_error("A BasicTimer was {}running while expected to be {}. " 23 | "The offending call was {}. " 24 | "Consider using an AutoTimer with name (and scope) to avoid this.", 25 | m_is_running ? "" : "not ", expected ? "started" : "stopped", function); 26 | } 27 | // else: everything ok. 28 | 29 | #else 30 | mio::unused(expected, function); 31 | #endif 32 | } 33 | 34 | } // namespace timing 35 | } // namespace mio 36 | -------------------------------------------------------------------------------- /cpp/memilio/timer/definitions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/timer/definitions.h" 21 | 22 | namespace mio 23 | { 24 | namespace timing 25 | { 26 | 27 | #ifdef MEMILIO_ENABLE_OPENMP 28 | 29 | double time_in_seconds(DurationType duration) 30 | { 31 | return duration; 32 | } 33 | 34 | TimeType get_time_now() 35 | { 36 | return omp_get_wtime(); 37 | } 38 | 39 | #else 40 | 41 | double time_in_seconds(DurationType duration) 42 | { 43 | return std::chrono::duration_cast>(duration).count(); 44 | } 45 | 46 | TimeType get_time_now() 47 | { 48 | return std::chrono::steady_clock::now(); 49 | } 50 | 51 | #endif 52 | 53 | } // namespace timing 54 | } // namespace mio 55 | -------------------------------------------------------------------------------- /cpp/memilio/utils/date.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "date.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/utils/flow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: René Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 FLOW_H_ 21 | #define FLOW_H_ 22 | 23 | #include 24 | 25 | namespace mio 26 | { 27 | 28 | /** 29 | * @brief A Flow defines a possible transition between two Compartments in a FlowModel. 30 | * Use in a TypeList to define the "Flows" parameter of a FlowModel. 31 | */ 32 | template 33 | struct Flow { 34 | using Type = decltype(Source); 35 | static_assert(std::is_same::value && std::is_enum::value, 36 | "The Source and Target parameters of a Flow must have the same enum type."); 37 | const static Type source = Source; 38 | const static Type target = Target; 39 | }; 40 | 41 | } // namespace mio 42 | 43 | #endif // FLOW_H_ -------------------------------------------------------------------------------- /cpp/memilio/utils/mioomp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/mioomp.h" 21 | 22 | namespace mio 23 | { 24 | namespace omp 25 | { 26 | 27 | int get_thread_id() 28 | { 29 | #ifdef MEMILIO_ENABLE_OPENMP 30 | return omp_get_thread_num(); 31 | #else 32 | return 0; 33 | #endif 34 | } 35 | 36 | int get_num_threads() 37 | { 38 | #ifdef MEMILIO_ENABLE_OPENMP 39 | return omp_get_num_threads(); 40 | #else 41 | return 1; 42 | #endif 43 | } 44 | 45 | int get_max_threads() 46 | { 47 | #ifdef MEMILIO_ENABLE_OPENMP 48 | return omp_get_max_threads(); 49 | #else 50 | return 1; 51 | #endif 52 | } 53 | 54 | } // namespace omp 55 | } // namespace mio 56 | -------------------------------------------------------------------------------- /cpp/memilio/utils/parameter_set.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | -------------------------------------------------------------------------------- /cpp/memilio/utils/random_number_generator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/random_number_generator.h" 21 | 22 | namespace mio 23 | { 24 | 25 | RandomNumberGenerator& thread_local_rng() 26 | { 27 | static thread_local auto rng = RandomNumberGenerator(); 28 | return rng; 29 | } 30 | 31 | } // namespace mio 32 | -------------------------------------------------------------------------------- /cpp/memilio/utils/span.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/span.h" 21 | 22 | namespace mio 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cpp/memilio/utils/time_series.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/time_series.h" 21 | 22 | namespace mio 23 | { 24 | 25 | } // namespace mio 26 | -------------------------------------------------------------------------------- /cpp/memilio/utils/type_safe.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/type_safe.h" 21 | -------------------------------------------------------------------------------- /cpp/memilio/utils/uncertain_value.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin J. Kuehn, Martin Siggel, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/uncertain_value.h" 21 | -------------------------------------------------------------------------------- /cpp/models/README.md: -------------------------------------------------------------------------------- 1 | # MEmilio Models # 2 | 3 | Contains different concrete models that are built using the MEmilio C++ library. Some models contain a spatial resolution and some do not contain spatial resolution, hence cannot capture spatially heterogenous dynamics. 4 | The models with spatial resolution are: 5 | - abm 6 | - d_abm 7 | 8 | The models without spatial resolution are: 9 | - ode_* 10 | - ide_* 11 | - lct_* 12 | - glct_* 13 | - sde_* 14 | 15 | See the corresponding directory for details about each model. 16 | -------------------------------------------------------------------------------- /cpp/models/abm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(abm 2 | location.cpp 3 | location.h 4 | location_id.h 5 | household.cpp 6 | household.h 7 | simulation.cpp 8 | simulation.h 9 | person.cpp 10 | person.h 11 | person_id.h 12 | personal_rng.cpp 13 | personal_rng.h 14 | testing_strategy.cpp 15 | testing_strategy.h 16 | model.cpp 17 | model.h 18 | location_type.h 19 | parameters.h 20 | parameters.cpp 21 | mobility_rules.cpp 22 | mobility_rules.h 23 | model_functions.cpp 24 | model_functions.h 25 | trip_list.cpp 26 | trip_list.h 27 | lockdown_rules.cpp 28 | lockdown_rules.h 29 | infection.cpp 30 | infection.h 31 | infection_state.h 32 | virus_variant.h 33 | protection_event.h 34 | mask.h 35 | mask.cpp 36 | common_abm_loggers.h 37 | ) 38 | target_link_libraries(abm PUBLIC memilio) 39 | target_include_directories(abm PUBLIC 40 | $ 41 | $ 42 | ) 43 | target_compile_options(abm PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 44 | -------------------------------------------------------------------------------- /cpp/models/abm/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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_CONFIG_H 21 | #define MIO_ABM_CONFIG_H 22 | 23 | namespace mio 24 | { 25 | namespace abm 26 | { 27 | 28 | /** 29 | * Maximum number of age groups allowed in the model. 30 | */ 31 | const constexpr int MAX_NUM_AGE_GROUPS = 64; 32 | 33 | } 34 | } // namespace mio 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /cpp/models/abm/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Elisabeth Kluth 5 | * 6 | * Contact: Martin J. Kuehn 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_INFECTION_STATE_H 21 | #define MIO_ABM_INFECTION_STATE_H 22 | 23 | #include 24 | 25 | namespace mio 26 | { 27 | namespace abm 28 | { 29 | 30 | /** 31 | * @brief #InfectionState in ABM. 32 | * Can be used as 0-based index. 33 | */ 34 | enum class InfectionState : std::uint32_t 35 | { 36 | Susceptible = 0, 37 | Exposed, 38 | InfectedNoSymptoms, 39 | InfectedSymptoms, 40 | InfectedSevere, 41 | InfectedCritical, 42 | Recovered, 43 | Dead, 44 | 45 | Count //last!! 46 | }; 47 | 48 | } // namespace abm 49 | } // namespace mio 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /cpp/models/abm/intervention_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Khoa Nguyen 5 | * 6 | * Contact: Martin J. Kuehn 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_ABM_INTERVENTION_TYPE_H 22 | #define MIO_ABM_INTERVENTION_TYPE_H 23 | 24 | #include 25 | 26 | namespace mio 27 | { 28 | namespace abm 29 | { 30 | 31 | /** 32 | * @brief Type of an Intervention. 33 | */ 34 | enum class InterventionType : std::uint32_t 35 | { 36 | Mask, 37 | Testing, 38 | Isolation, 39 | 40 | Count 41 | }; 42 | } // namespace abm 43 | } // namespace mio 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /cpp/models/abm/mask.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Carlotta Gerstein, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "abm/mask_type.h" 22 | #include "abm/parameters.h" 23 | #include "abm/mask.h" 24 | #include "abm/time.h" 25 | 26 | namespace mio 27 | { 28 | namespace abm 29 | { 30 | Mask::Mask(MaskType type, TimePoint t) 31 | : m_type(type) 32 | , m_time_first_usage(t) 33 | { 34 | } 35 | 36 | void Mask::change_mask(MaskType new_mask_type, TimePoint t) 37 | { 38 | m_type = new_mask_type; 39 | m_time_first_usage = t; 40 | } 41 | 42 | const TimeSpan Mask::get_time_used(TimePoint curr_time) const 43 | { 44 | return curr_time - m_time_first_usage; 45 | } 46 | 47 | } // namespace abm 48 | } // namespace mio 49 | -------------------------------------------------------------------------------- /cpp/models/abm/mask_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Carlotta Gerstein, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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_ABM_MASK_TYPE_H 22 | #define MIO_ABM_MASK_TYPE_H 23 | 24 | #include 25 | 26 | namespace mio 27 | { 28 | namespace abm 29 | { 30 | 31 | /** 32 | * @brief Type of a Mask. 33 | */ 34 | enum class MaskType : std::uint32_t 35 | { 36 | None, 37 | Community, 38 | Surgical, 39 | FFP2, 40 | 41 | Count 42 | }; 43 | } // namespace abm 44 | } // namespace mio 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /cpp/models/abm/mobility_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Sascha Korf 5 | * 6 | * Contact: Martin J. Kuehn 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 ABM_MOBILITY_DATA_H 22 | #define ABM_MOBILITY_DATA_H 23 | 24 | #include 25 | 26 | namespace mio 27 | { 28 | namespace abm 29 | { 30 | 31 | /** 32 | * @brief Mode of Transport. 33 | */ 34 | enum class TransportMode : uint32_t 35 | { 36 | Bike, 37 | CarDriver, 38 | CarPassenger, 39 | PublicTransport, 40 | Walking, 41 | Other, 42 | Unknown, 43 | Count //last!! 44 | }; 45 | 46 | /** 47 | * @brief Type of the activity. 48 | */ 49 | enum class ActivityType : uint32_t 50 | { 51 | Workplace, 52 | Education, 53 | Shopping, 54 | Leisure, 55 | PrivateMatters, 56 | OtherActivity, 57 | Home, 58 | UnknownActivity 59 | }; 60 | 61 | } // namespace abm 62 | } // namespace mio 63 | 64 | #endif //ABM_MOBILITY_DATA_H 65 | -------------------------------------------------------------------------------- /cpp/models/abm/parameters.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "abm/parameters.h" 21 | -------------------------------------------------------------------------------- /cpp/models/abm/personal_rng.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Elisabeth Kluth, David Kerkmann, Khoa Nguyen, Rene Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "abm/personal_rng.h" 22 | #include "abm/person.h" 23 | #include "abm/person_id.h" 24 | #include 25 | 26 | namespace mio 27 | { 28 | namespace abm 29 | { 30 | PersonalRandomNumberGenerator::PersonalRandomNumberGenerator(mio::Key key, uint32_t index, 31 | mio::Counter& counter) 32 | : m_key(key) 33 | , m_person_index(index) 34 | , m_counter(counter) 35 | { 36 | } 37 | 38 | PersonalRandomNumberGenerator::PersonalRandomNumberGenerator(Person& person) 39 | : PersonalRandomNumberGenerator(person.get_rng_key(), person.get_rng_index(), person.get_rng_counter()) 40 | { 41 | } 42 | 43 | } // namespace abm 44 | } // namespace mio 45 | -------------------------------------------------------------------------------- /cpp/models/abm/simulation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Khoa Nguyen 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "abm/simulation.h" 21 | 22 | namespace mio 23 | { 24 | namespace abm 25 | { 26 | 27 | } // namespace abm 28 | } // namespace mio 29 | -------------------------------------------------------------------------------- /cpp/models/abm/time.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "abm/time.h" 21 | -------------------------------------------------------------------------------- /cpp/models/abm/virus_variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: David Kerkmann 5 | * 6 | * Contact: Martin J. Kuehn 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_VIRUS_VARIANT_H 21 | #define MIO_VIRUS_VARIANT_H 22 | 23 | #include 24 | 25 | namespace mio 26 | { 27 | namespace abm 28 | { 29 | // Virus Variant handling to be discussed for better solutions 30 | // Ultimately, one would like to read in all Virus Variants from 31 | // a config file. 32 | 33 | /** 34 | * Virus variants in ABM. 35 | * can be used as 0-based index 36 | */ 37 | enum class VirusVariant : std::uint32_t 38 | { 39 | Wildtype, 40 | 41 | Count // last!! 42 | }; 43 | 44 | } // namespace abm 45 | } // namespace mio 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /cpp/models/d_abm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(d_abm 2 | model.h 3 | model.cpp 4 | simulation.h 5 | simulation.cpp 6 | parameters.h 7 | ) 8 | target_link_libraries(d_abm PUBLIC memilio) 9 | target_include_directories(d_abm PUBLIC 10 | $ 11 | $ 12 | ) 13 | target_compile_options(d_abm PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 14 | -------------------------------------------------------------------------------- /cpp/models/d_abm/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 German Aerospace Center (DLR-SC) 3 | * 4 | * Authors: René Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "d_abm/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace dabm 26 | { 27 | 28 | } // namespace dabm 29 | } // namespace mio 30 | -------------------------------------------------------------------------------- /cpp/models/d_abm/parameters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2024 German Aerospace Center (DLR-SC) 3 | * 4 | * Authors: René Schmieding, Julia Bicker 5 | * 6 | * Contact: Martin J. Kuehn 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_d_ABM_PARAMETERS_H 22 | #define MIO_d_ABM_PARAMETERS_H 23 | 24 | namespace mio 25 | { 26 | namespace dabm 27 | { 28 | //The parameters for the diffusive ABM are AdoptionRates which are defined in epidemiology/adoption_rate.h. 29 | //Movement is defined by the Implementation template, see mio::dabm::Model and quadwell.h for an exemplary implementation. 30 | 31 | } // namespace dabm 32 | 33 | } // namespace mio 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /cpp/models/d_abm/simulation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2024 MEmilio 3 | * 4 | * Authors: René Schmieding, Julia Bicker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "d_abm/simulation.h" 21 | 22 | namespace mio 23 | { 24 | namespace dabm 25 | { 26 | } // namespace dabm 27 | } // namespace mio 28 | -------------------------------------------------------------------------------- /cpp/models/glct_secir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(glct_secir 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | ) 7 | target_link_libraries(glct_secir PUBLIC memilio) 8 | target_include_directories(glct_secir PUBLIC 9 | $ 10 | $ 11 | ) 12 | target_compile_options(glct_secir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) -------------------------------------------------------------------------------- /cpp/models/glct_secir/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Lena Ploetzke 5 | * 6 | * Contact: Martin J. Kuehn 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_INFECTIONSTATE_H 22 | #define MIO_GLCT_SECIR_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace glsecir 27 | { 28 | 29 | /// @brief The InfectionState enum describes the basic categories for the infection state of persons. 30 | enum class InfectionState 31 | { 32 | Susceptible = 0, 33 | Exposed = 1, 34 | InfectedNoSymptoms = 2, 35 | InfectedSymptoms = 3, 36 | InfectedSevere = 4, 37 | InfectedCritical = 5, 38 | Recovered = 6, 39 | Dead = 7, 40 | Count = 8 41 | }; 42 | 43 | } // namespace glsecir 44 | } // namespace mio 45 | 46 | #endif // MIO_GLCT_SECIR_INFECTIONSTATE_H -------------------------------------------------------------------------------- /cpp/models/glct_secir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Lena Ploetzke 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "glct_secir/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace glsecir 26 | { 27 | 28 | } // namespace glsecir 29 | } // namespace mio -------------------------------------------------------------------------------- /cpp/models/graph_abm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(graph_abm 2 | graph_abmodel.h 3 | graph_abmodel.cpp 4 | graph_abm_mobility.cpp 5 | graph_abm_mobility.h 6 | ) 7 | 8 | target_link_libraries(graph_abm PUBLIC memilio) 9 | target_include_directories(graph_abm PUBLIC 10 | $ 11 | $ 12 | ) 13 | 14 | target_compile_options(graph_abm PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 15 | -------------------------------------------------------------------------------- /cpp/models/graph_abm/graph_abm_mobility.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2024 MEmilio 3 | * 4 | * Authors: Julia Bicker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "graph_abm/graph_abm_mobility.h" 22 | #include "abm/simulation.h" 23 | #include "abm/model.h" 24 | #include "abm/person.h" 25 | #include "abm/location_type.h" 26 | #include "abm/parameters.h" 27 | 28 | namespace mio 29 | { 30 | 31 | } // namespace mio -------------------------------------------------------------------------------- /cpp/models/graph_abm/graph_abmodel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2024 MEmilio 3 | * 4 | * Authors: Julia Bicker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "graph_abm/graph_abmodel.h" 22 | 23 | namespace mio 24 | { 25 | 26 | } //namespace mio 27 | -------------------------------------------------------------------------------- /cpp/models/ide_secir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ide_secir 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | simulation.h 6 | simulation.cpp 7 | parameters.h 8 | parameters_io.h 9 | ) 10 | target_link_libraries(ide_secir PUBLIC memilio) 11 | target_include_directories(ide_secir PUBLIC 12 | $ 13 | $ 14 | ) 15 | target_compile_options(ide_secir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 16 | -------------------------------------------------------------------------------- /cpp/models/ide_seir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ide_seir 2 | model.h 3 | model.cpp 4 | parameters.h 5 | infection_state.h 6 | ) 7 | target_link_libraries(ide_seir PUBLIC memilio) 8 | target_include_directories(ide_seir PUBLIC 9 | $ 10 | $ 11 | ) 12 | target_compile_options(ide_seir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 13 | -------------------------------------------------------------------------------- /cpp/models/ide_seir/README.md: -------------------------------------------------------------------------------- 1 | # IDE SEIR model 2 | 3 | This model is based on Integro-differential equations. The four compartments 4 | - Susceptible, may become exposed at any time 5 | - Exposed, becomes infected after some time 6 | - Infected, will recover after some time 7 | - Recovered 8 | 9 | are used to simulate the spread of the disease. 10 | 11 | An example can be found in [examples/ide_seir.cpp](../../examples/ide_seir.cpp) 12 | -------------------------------------------------------------------------------- /cpp/models/ide_seir/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Lena Ploetzke 5 | * 6 | * Contact: Martin J. Kuehn 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 IDE_SEIR_INFECTIONSTATE_H 22 | #define IDE_SEIR_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace iseir 27 | { 28 | /** 29 | * @brief The InfectionState enum describes the possible categories for the infectious state of persons 30 | * in ide_seir model. 31 | */ 32 | enum class InfectionState 33 | { 34 | S = 0, 35 | E, 36 | I, 37 | R, 38 | Count = 4 39 | }; 40 | 41 | } // namespace iseir 42 | } // namespace mio 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /cpp/models/ide_seir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Lena Ploetzke 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ide_seir/model.h" 22 | -------------------------------------------------------------------------------- /cpp/models/lct_secir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(lct_secir 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | initializer_flows.h 7 | parameters_io.h 8 | ) 9 | target_link_libraries(lct_secir PUBLIC memilio) 10 | target_include_directories(lct_secir PUBLIC 11 | $ 12 | $ 13 | ) 14 | target_compile_options(lct_secir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 15 | -------------------------------------------------------------------------------- /cpp/models/lct_secir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Lena Ploetzke 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "lct_secir/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace lsecir 26 | { 27 | 28 | } // namespace lsecir 29 | } // namespace mio -------------------------------------------------------------------------------- /cpp/models/ode_seair/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ode_seair 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | ) 7 | 8 | target_link_libraries(ode_seair PUBLIC memilio AD::AD) 9 | target_include_directories(ode_seair PUBLIC 10 | $ 11 | $ 12 | ) 13 | target_compile_options(ode_seair PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 14 | -------------------------------------------------------------------------------- /cpp/models/ode_seair/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Ralf Hannemann-Tamas 5 | * 6 | * Contact: Martin J. Kuehn 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 ODESEAIR_INFECTIONSTATE_H 22 | #define ODESEAIR_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace oseair 27 | { 28 | 29 | /** 30 | * @brief The InfectionState enum describes the possible 31 | * categories for the infectious state of persons 32 | */ 33 | enum class InfectionState 34 | { 35 | Susceptible, 36 | Exposed, 37 | Asymptomatic, 38 | Infected, 39 | Recovered, 40 | Dead, 41 | Count 42 | }; 43 | 44 | } // namespace oseair 45 | } // namespace mio 46 | 47 | #endif // ODESEAIR_INFECTIONSTATE_H 48 | -------------------------------------------------------------------------------- /cpp/models/ode_seair/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Ralf Hannemann-Tamas 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_seair/model.h" 22 | -------------------------------------------------------------------------------- /cpp/models/ode_secir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ode_secir 2 | analyze_result.h 3 | analyze_result.cpp 4 | infection_state.h 5 | parameter_space.h 6 | parameter_space.cpp 7 | parameters.h 8 | parameters_io.h 9 | parameters_io.cpp 10 | model.h 11 | model.cpp 12 | ) 13 | target_link_libraries(ode_secir PUBLIC memilio) 14 | target_include_directories(ode_secir PUBLIC 15 | $ 16 | $ 17 | ) 18 | target_compile_options(ode_secir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 19 | -------------------------------------------------------------------------------- /cpp/models/ode_secir/analyze_result.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secir/analyze_result.h" 21 | #include "memilio/math/interpolation.h" 22 | 23 | namespace mio 24 | { 25 | 26 | namespace osecir 27 | { 28 | 29 | } // namespace osecir 30 | } // namespace mio 31 | -------------------------------------------------------------------------------- /cpp/models/ode_secir/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 ODESECIR_INFECTIONSTATE_H 21 | #define ODESECIR_INFECTIONSTATE_H 22 | 23 | namespace mio 24 | { 25 | 26 | namespace osecir 27 | { 28 | 29 | /** 30 | * @brief The InfectionState enum describes the possible 31 | * categories for the infectious state of persons 32 | */ 33 | enum class InfectionState 34 | { 35 | Susceptible = 0, 36 | Exposed, 37 | InfectedNoSymptoms, 38 | InfectedNoSymptomsConfirmed, 39 | InfectedSymptoms, 40 | InfectedSymptomsConfirmed, 41 | InfectedSevere, 42 | InfectedCritical, 43 | Recovered, 44 | Dead, 45 | 46 | Count 47 | }; 48 | 49 | } // namespace osecir 50 | } // namespace mio 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /cpp/models/ode_secir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Jan Kleinert, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secir/model.h" 21 | 22 | namespace mio 23 | { 24 | namespace osecir 25 | { 26 | 27 | } // namespace osecir 28 | } // namespace mio 29 | -------------------------------------------------------------------------------- /cpp/models/ode_secir/parameter_space.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secir/parameter_space.h" 21 | -------------------------------------------------------------------------------- /cpp/models/ode_secirts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ode_secirts 2 | analyze_result.h 3 | analyze_result.cpp 4 | infection_state.h 5 | parameter_space.h 6 | parameter_space.cpp 7 | parameters.h 8 | parameters_io.h 9 | parameters_io.cpp 10 | model.h 11 | model.cpp 12 | ) 13 | target_link_libraries(ode_secirts PUBLIC memilio) 14 | target_include_directories(ode_secirts PUBLIC 15 | $ 16 | $ 17 | ) 18 | target_compile_options(ode_secirts PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 19 | -------------------------------------------------------------------------------- /cpp/models/ode_secirts/analyze_result.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Henrik Zunker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secirts/analyze_result.h" 21 | 22 | namespace mio 23 | { 24 | namespace osecirts 25 | { 26 | 27 | } // namespace osecirts 28 | } // namespace mio 29 | -------------------------------------------------------------------------------- /cpp/models/ode_secirts/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Henrik Zunker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secirts/model.h" 21 | 22 | namespace mio 23 | { 24 | namespace osecirts 25 | { 26 | 27 | } // namespace osecirts 28 | } // namespace mio 29 | -------------------------------------------------------------------------------- /cpp/models/ode_secirts/parameter_space.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Henrik Zunker, Wadim Koslow, Daniel Abele, Martin J. Kühn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secirts/parameter_space.h" 21 | -------------------------------------------------------------------------------- /cpp/models/ode_secirvvs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ode_secirvvs 2 | analyze_result.h 3 | analyze_result.cpp 4 | infection_state.h 5 | parameter_space.h 6 | parameter_space.cpp 7 | parameters.h 8 | parameters_io.h 9 | parameters_io.cpp 10 | model.h 11 | model.cpp 12 | ) 13 | target_link_libraries(ode_secirvvs PUBLIC memilio) 14 | target_include_directories(ode_secirvvs PUBLIC 15 | $ 16 | $ 17 | ) 18 | target_compile_options(ode_secirvvs PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 19 | -------------------------------------------------------------------------------- /cpp/models/ode_secirvvs/analyze_result.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Wadim Koslow, Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secirvvs/analyze_result.h" 21 | 22 | namespace mio 23 | { 24 | namespace osecirvvs 25 | { 26 | 27 | } // namespace osecirvvs 28 | } // namespace mio 29 | -------------------------------------------------------------------------------- /cpp/models/ode_secirvvs/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Wadim Koslow, Daniel Abele, Martin J. Kühn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secirvvs/model.h" 21 | -------------------------------------------------------------------------------- /cpp/models/ode_secirvvs/parameter_space.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Wadim Koslow, Daniel Abele, Martin J. Kühn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_secirvvs/parameter_space.h" 21 | -------------------------------------------------------------------------------- /cpp/models/ode_seir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ode_seir 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | ) 7 | target_link_libraries(ode_seir PUBLIC memilio) 8 | target_include_directories(ode_seir PUBLIC 9 | $ 10 | $ 11 | ) 12 | target_compile_options(ode_seir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 13 | -------------------------------------------------------------------------------- /cpp/models/ode_seir/README.md: -------------------------------------------------------------------------------- 1 | # ODE SEIR compartment model 2 | 3 | This model is a very simple ODE model with only four compartments and few parameters, mostly for demonstration of the MEmilio framework: 4 | - Susceptible, may become exposed at any time 5 | - Exposed, becomes infected after some time 6 | - Infected, will recover after some time 7 | - Recovered 8 | 9 | Below is an overview of the model architecture and its compartments. 10 | 11 | ![SEIR_model](https://github.com/SciCompMod/memilio/assets/69154294/80a36be5-57d9-4012-9b5f-25eb08ec8837) 12 | | Mathematical variable | C++ variable name | Description | 13 | |---------------------------- | --------------- | -------------------------------------------------------------------------------------------------- | 14 | | $\phi$ | `ContactPatterns` | Daily contact rate / Number of daily contacts. | 15 | | $\rho$ | `TransmissionProbabilityOnContact` | Transmission risk for people located in the Susceptible compartment. | 16 | | $N$ | `populations.get_total()` | Total population. | 17 | | $T_{E}$ | `TimeExposed` | Time in days an individual stays in the Exposed compartment. | 18 | | $T_{I}$ | `TimeInfected` | Time in days an individual stays in the Infected compartment. | 19 | 20 | 21 | An example can be found in [examples/ode_seir.cpp](../../examples/ode_seir.cpp) -------------------------------------------------------------------------------- /cpp/models/ode_seir/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Jan Kleinert, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 SEIR_INFECTIONSTATE_H 21 | #define SEIR_INFECTIONSTATE_H 22 | 23 | namespace mio 24 | { 25 | namespace oseir 26 | { 27 | 28 | /** 29 | * @brief The InfectionState enum describes the possible 30 | * categories for the infectious state of persons 31 | */ 32 | enum class InfectionState 33 | { 34 | Susceptible, 35 | Exposed, 36 | Infected, 37 | Recovered, 38 | Count 39 | }; 40 | 41 | } // namespace oseir 42 | } // namespace mio 43 | 44 | #endif // SEIR_INFECTIONSTATE_H 45 | -------------------------------------------------------------------------------- /cpp/models/ode_seir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Jan Kleinert, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_seir/model.h" 21 | 22 | -------------------------------------------------------------------------------- /cpp/models/ode_sir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(ode_sir 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | ) 7 | target_link_libraries(ode_sir PUBLIC memilio) 8 | target_include_directories(ode_sir PUBLIC 9 | $ 10 | $ 11 | ) 12 | target_compile_options(ode_sir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 13 | -------------------------------------------------------------------------------- /cpp/models/ode_sir/README.md: -------------------------------------------------------------------------------- 1 | 2 | # ODE SIR compartment model 3 | 4 | This model is a very simple ODE model with only three compartments and few parameters, mostly for demonstration of the MEmilio framework: 5 | - Susceptible, may become infected at any time 6 | - Infected, will be recovered after some time 7 | - Recovered, recovered from infectious process (dead or recovered) 8 | 9 | We assume simulations over short periods of time, so that the population size can be considered constant and birth as well as (natural) mortality rates can be ignored. 10 | 11 | Below is an overview of the model architecture and its compartments. 12 | 13 | ![SIR_model](https://github.com/SciCompMod/memilio/assets/69154294/01c9a2ae-2f5c-4bad-b7f0-34de651f2c73) 14 | | Mathematical variable | C++ variable name | Description | 15 | |---------------------------- | --------------- | -------------------------------------------------------------------------------------------------- | 16 | | $\phi$ | `ContactPatterns` | Daily contact rate / Number of daily contacts. | 17 | | $\rho$ | `TransmissionProbabilityOnContact` | Transmission risk for people located in the Susceptible compartment. | 18 | | $N$ | `populations.get_total()` | Total population. | 19 | | $T_{I}$ | `TimeInfected` | Time in days an individual stays in the Infected compartment. | 20 | 21 | An example can be found in [examples/ode_sir.cpp](../../examples/ode_sir.cpp) 22 | -------------------------------------------------------------------------------- /cpp/models/ode_sir/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Jan Kleinert, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 ODESIR_INFECTIONSTATE_H 22 | #define ODESIR_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace osir 27 | { 28 | 29 | /** 30 | * @brief The InfectionState enum describes the possible 31 | * categories for the infectious state of persons 32 | */ 33 | enum class InfectionState 34 | { 35 | Susceptible, 36 | Infected, 37 | Recovered, 38 | Count 39 | }; 40 | 41 | } // namespace osir 42 | } // namespace mio 43 | 44 | #endif // ODESIR_INFECTIONSTATE_H 45 | -------------------------------------------------------------------------------- /cpp/models/ode_sir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Jan Kleinert, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "ode_sir/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace osir 26 | { 27 | 28 | } // namespace osir 29 | } // namespace mio 30 | -------------------------------------------------------------------------------- /cpp/models/sde_seirvv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sde_seirvv 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | simulation.h 7 | ) 8 | target_link_libraries(sde_seirvv PUBLIC memilio) 9 | target_include_directories(sde_seirvv PUBLIC 10 | $ 11 | $ 12 | ) 13 | target_compile_options(sde_seirvv PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 14 | -------------------------------------------------------------------------------- /cpp/models/sde_seirvv/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Nils Wassmuth, Rene Schmieding, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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_SDE_SEIRVV_INFECTIONSTATE_H 22 | #define MIO_SDE_SEIRVV_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace sseirvv 27 | { 28 | 29 | /** 30 | * @brief The InfectionState enum describes the possible 31 | * categories for the infectious state of persons 32 | */ 33 | enum class InfectionState 34 | { 35 | Susceptible, 36 | ExposedV1, 37 | InfectedV1, 38 | RecoveredV1, 39 | ExposedV2, 40 | InfectedV2, 41 | RecoveredV2, 42 | ExposedV1V2, 43 | InfectedV1V2, 44 | RecoveredV1V2, 45 | Count 46 | }; 47 | 48 | } // namespace sseirvv 49 | } // namespace mio 50 | 51 | #endif // MIO_SDE_SEIRVV_INFECTIONSTATE_H 52 | -------------------------------------------------------------------------------- /cpp/models/sde_seirvv/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Nils Wassmuth, Rene Schmieding, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "sde_seirvv/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace sseirvv 26 | { 27 | 28 | } // namespace sseirvv 29 | } // namespace mio 30 | -------------------------------------------------------------------------------- /cpp/models/sde_sir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sde_sir 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | simulation.h 7 | ) 8 | target_link_libraries(sde_sir PUBLIC memilio) 9 | target_include_directories(sde_sir PUBLIC 10 | $ 11 | $ 12 | ) 13 | target_compile_options(sde_sir PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 14 | -------------------------------------------------------------------------------- /cpp/models/sde_sir/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Nils Wassmuth, Rene Schmieding, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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_SDE_SIR_INFECTIONSTATE_H 22 | #define MIO_SDE_SIR_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace ssir 27 | { 28 | 29 | /** 30 | * @brief The InfectionState enum describes the possible 31 | * categories for the infectious state of persons 32 | */ 33 | enum class InfectionState 34 | { 35 | Susceptible, 36 | Infected, 37 | Recovered, 38 | Count 39 | }; 40 | 41 | } // namespace ssir 42 | } // namespace mio 43 | 44 | #endif // MIO_SDE_SIR_INFECTIONSTATE_H 45 | -------------------------------------------------------------------------------- /cpp/models/sde_sir/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Nils Wassmuth, Rene Schmieding, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "sde_sir/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace ssir 26 | { 27 | 28 | } // namespace ssir 29 | } // namespace mio 30 | -------------------------------------------------------------------------------- /cpp/models/sde_sirs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sde_sirs 2 | infection_state.h 3 | model.h 4 | model.cpp 5 | parameters.h 6 | simulation.h 7 | ) 8 | target_link_libraries(sde_sirs PUBLIC memilio) 9 | target_include_directories(sde_sirs PUBLIC 10 | $ 11 | $ 12 | ) 13 | target_compile_options(sde_sirs PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 14 | -------------------------------------------------------------------------------- /cpp/models/sde_sirs/infection_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Nils Wassmuth, Rene Schmieding, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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_SDE_SIRS_INFECTIONSTATE_H 22 | #define MIO_SDE_SIRS_INFECTIONSTATE_H 23 | 24 | namespace mio 25 | { 26 | namespace ssirs 27 | { 28 | 29 | /** 30 | * @brief The InfectionState enum describes the possible 31 | * categories for the infectious state of persons 32 | */ 33 | enum class InfectionState 34 | { 35 | Susceptible, 36 | Infected, 37 | Recovered, 38 | Count 39 | }; 40 | 41 | } // namespace ssirs 42 | } // namespace mio 43 | 44 | #endif // MIO_SDE_SIRS_INFECTIONSTATE_H 45 | -------------------------------------------------------------------------------- /cpp/models/sde_sirs/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Nils Wassmuth, Rene Schmieding, Martin J. Kuehn 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "sde_sirs/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace ssirs 26 | { 27 | 28 | } // namespace ssirs 29 | } // namespace mio 30 | -------------------------------------------------------------------------------- /cpp/models/smm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(smm 2 | parameters.h 3 | model.h 4 | model.cpp 5 | simulation.h 6 | simulation.cpp 7 | ) 8 | target_link_libraries(smm PUBLIC memilio) 9 | target_include_directories(smm PUBLIC 10 | $ 11 | $ 12 | ) 13 | target_compile_options(smm PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 14 | -------------------------------------------------------------------------------- /cpp/models/smm/model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 German Aerospace Center (DLR-SC) 3 | * 4 | * Authors: René Schmieding 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "smm/model.h" 22 | 23 | namespace mio 24 | { 25 | namespace smm 26 | { 27 | 28 | } // namespace smm 29 | } // namespace mio 30 | -------------------------------------------------------------------------------- /cpp/models/smm/simulation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: René Schmieding, Julia Bicker 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "smm/simulation.h" 21 | 22 | namespace mio 23 | { 24 | } // namespace mio 25 | -------------------------------------------------------------------------------- /cpp/simulations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(MEMILIO_HAS_JSONCPP AND MEMILIO_HAS_HDF5) 2 | add_executable(2020_npis_wildtype 2020_npis_sarscov2_wildtype_germany.cpp) 3 | target_link_libraries(2020_npis_wildtype PRIVATE memilio ode_secir Boost::filesystem ${HDF5_C_LIBRARIES}) 4 | target_compile_options(2020_npis_wildtype PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 5 | 6 | add_executable(2021_vaccination_delta 2021_vaccination_sarscov2_delta_germany.cpp) 7 | target_link_libraries(2021_vaccination_delta PRIVATE memilio ode_secirvvs Boost::filesystem ${HDF5_C_LIBRARIES}) 8 | target_compile_options(2021_vaccination_delta PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 9 | 10 | add_executable(abm_simulation abm.cpp) 11 | target_link_libraries(abm_simulation PRIVATE memilio abm Boost::filesystem ${HDF5_C_LIBRARIES}) 12 | target_compile_options(abm_simulation PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 13 | 14 | add_executable(munich_graph_sim munich_graph_sim) 15 | target_link_libraries(munich_graph_sim PRIVATE memilio ode_secir abm Boost::filesystem ${HDF5_C_LIBRARIES}) 16 | target_compile_options(munich_graph_sim PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 17 | 18 | add_executable(abm_braunschweig abm_braunschweig.cpp) 19 | target_link_libraries(abm_braunschweig PRIVATE memilio abm Boost::filesystem ${HDF5_C_LIBRARIES}) 20 | target_compile_options(abm_braunschweig PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) 21 | endif() 22 | -------------------------------------------------------------------------------- /cpp/simulations/data_generation.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # Run all scripts in memilio-epidata which are necessary to run the simulation files. 3 | 4 | # activate virtual_env 5 | # The path to the virtual environment activation function has to be adjusted manually 6 | # Otherwise the script can be called with -PATH_ENV Path argument, e.g. 7 | # sh data_generation.sh -PATH_ENV "YOUR/PATH/TO/VIRTUAL/ENV/activate" 8 | path_virtual_env="/localdata1/kueh_mj/virtual_envs/corona-py388/bin/activate" 9 | 10 | # Use/check for input argument 11 | while [[ $# -gt 0 ]]; do 12 | key="$1" 13 | case $key in 14 | -PATH_ENV) 15 | path_virtual_env="$2" 16 | shift 17 | shift 18 | ;; 19 | *) 20 | echo "Unknown parameter: $1" 21 | exit 1 22 | ;; 23 | esac 24 | done 25 | 26 | if ! [[ -f $path_virtual_env ]] 27 | then echo "Set path to virtual environment activation function to an existing python venv." && exit 28 | else source $path_virtual_env 29 | fi 30 | 31 | # path to MEmilio dir (assumes execution of the script from the `simulations` folder) 32 | cd ../.. 33 | data_dir=$PWD/data/pydata 34 | 35 | # download data 36 | cd "pycode/memilio-epidata" 37 | python setup.py install 38 | python memilio/epidata/getSimulationData.py -o $data_dir -m 7 39 | python memilio/epidata/transformMobilityData.py -o $data_dir 40 | 41 | echo "Generation was succesful." -------------------------------------------------------------------------------- /cpp/tests/README.md: -------------------------------------------------------------------------------- 1 | # MEmilio Unit Tests # 2 | 3 | Unit tests for the MEmilio C++ library using the GoogleTest framework. 4 | 5 | *Data handling* 6 | 7 | Inputdata that cannot be included in the source code itself is collected in the `data` directory. The path to the directory is discovered by CMake during configuration. That means the compiled unit tests can only be run succesfully if the source directory has not been deleted after building the tests and is not otherwise unreachable. Use [load_test_data.h](load_test_data.h) to access the data. 8 | 9 | Some tests write data to the filesystem. The tests try to use the temp directory provided by the operating system. The current directory is used if no temp directory can be found. Files created during tests are deleted afterwards if possible. See [temp_file_register.h](temp_file_register.h) 10 | 11 | *Running code coverage analysis* 12 | 13 | Code coverage analysis currently only works on linux with the "Makefile" generator and in Debug mode. To perform 14 | the analysis, configure cmake as follows 15 | 16 | cmake -DCMAKE_BUILD_TYPE=Debug -DMEMILIO_TEST_COVERAGE=ON .. 17 | 18 | This step needs to have the tool lcov installed. To execute the coverage, run 19 | 20 | cmake --build . --target coverage 21 | 22 | It will generate a html report inside the `coverage` directory. 23 | 24 | - MEMILIO_TEST_COVERAGE: compile libraries and unit tests for coverage analysis, only available in Debug builds, ON or OFF, default OFF. 25 | -------------------------------------------------------------------------------- /cpp/tests/cmake/DownloadProject.CMakeLists.cmake.in: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved MIT License. See accompanying 2 | # file LICENSE or https://github.com/Crascit/DownloadProject for details. 3 | 4 | cmake_minimum_required(VERSION 2.8.2) 5 | 6 | project(${DL_ARGS_PROJ}-download NONE) 7 | 8 | include(ExternalProject) 9 | ExternalProject_Add(${DL_ARGS_PROJ}-download 10 | ${DL_ARGS_UNPARSED_ARGUMENTS} 11 | SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" 12 | BINARY_DIR "${DL_ARGS_BINARY_DIR}" 13 | CONFIGURE_COMMAND "" 14 | BUILD_COMMAND "" 15 | INSTALL_COMMAND "" 16 | TEST_COMMAND "" 17 | ) 18 | -------------------------------------------------------------------------------- /cpp/tests/data/contacts.txt: -------------------------------------------------------------------------------- 1 | 0.4413 0.4504 1.2383 0.8033 0.0494 0.0017 2 | 0.0485 0.7616 0.6532 1.1614 0.0256 0.0013 3 | 0.1800 0.1795 0.8806 0.6413 0.0429 0.0032 4 | 0.0495 0.2639 0.5189 0.8277 0.0679 0.0014 5 | 0.0087 0.0394 0.1417 0.3834 0.7064 0.0447 6 | 0.0292 0.0648 0.1248 0.4179 0.3497 0.1544 7 | -------------------------------------------------------------------------------- /cpp/tests/data/export_time_series_init_osecirvvs.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/cpp/tests/data/export_time_series_init_osecirvvs.h5 -------------------------------------------------------------------------------- /cpp/tests/data/export_time_series_initialization_osecir.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/cpp/tests/data/export_time_series_initialization_osecir.h5 -------------------------------------------------------------------------------- /cpp/tests/data/export_time_series_initialization_osecirts.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/cpp/tests/data/export_time_series_initialization_osecirts.h5 -------------------------------------------------------------------------------- /cpp/tests/data/export_time_series_initialization_osecirvvs.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/cpp/tests/data/export_time_series_initialization_osecirvvs.h5 -------------------------------------------------------------------------------- /cpp/tests/data/ide-secir-compare.csv: -------------------------------------------------------------------------------- 1 | # time | S | E | C | I | H | U | R | D | 2 | 0.00000000 5961.23932428 13.80777657 8.28466594 4.41848850 0.55231106 0.55231106 3998.04050046 13.10462213 3 | 1.00000000 5933.47445246 13.88243591 13.84510624 5.53244304 2.48773289 0.76001099 4016.25703532 13.76078315 4 | 2.00000000 5891.41899959 21.02772643 17.45508117 7.82504685 3.33937247 1.45677634 4042.60782032 14.86917681 5 | 3.00000000 5837.05333649 27.18283155 24.10527899 10.39009004 4.55378422 1.97328917 4078.15717996 16.58420957 6 | 4.00000000 5763.78856564 36.63238542 31.90760849 14.00322187 6.09832798 2.66302805 4126.00449436 18.90236818 7 | 5.00000000 5667.87878109 47.95489227 42.29363885 18.55031183 8.13838343 3.55917785 4189.61134354 22.01347113 -------------------------------------------------------------------------------- /cpp/tests/data/ide-secir-transitions-compare.csv: -------------------------------------------------------------------------------- 1 | # time | S -> E | E - > C | C -> I | C -> R | I -> H | I -> R | H -> U | H -> R | U -> D | U -> R 2 | 0.00000000 27.61555314 16.56933188 8.83697700 4.41848850 1.10462213 4.41848850 1.10462213 1.10462213 1.10462213 1.10462213 3 | 1.00000000 27.76487182 27.69021248 11.06488609 11.06488609 4.97546577 4.97546577 1.52002197 1.52002197 0.65616103 0.65616103 4 | 2.00000000 42.05545287 34.91016234 15.65009370 15.65009370 6.67874495 6.67874495 2.91355268 2.91355268 1.10839366 1.10839366 5 | 3.00000000 54.36566310 48.21055798 20.78018008 20.78018008 9.10756845 9.10756845 3.94657835 3.94657835 1.71503276 1.71503276 6 | 4.00000000 73.26477085 63.81521697 28.00644374 28.00644374 12.19665596 12.19665596 5.32605610 5.32605610 2.31815861 2.31815861 7 | 5.00000000 95.90978455 84.58727770 37.10062367 37.10062367 16.27676685 16.27676685 7.11835570 7.11835570 3.11110295 3.11110295 -------------------------------------------------------------------------------- /cpp/tests/data/lct-secir-compartments-compare.csv: -------------------------------------------------------------------------------- 1 | # time | S | E | C | I | H | U | R | D 2 | 0.00000000 750.00000000 50.00000000 40.00000000 50.00000000 50.00000000 30.00000000 20.00000000 10.00000000 3 | 0.10000000 748.46824343 50.26284184 39.76391713 50.50314806 49.64881726 29.98773082 21.32228601 10.04301546 4 | 0.29072295 745.55860018 50.65687853 39.32541531 51.51432605 48.99408015 29.94667771 23.87442948 10.12959258 5 | 0.48144590 742.66416112 50.92893708 38.82680068 52.64226763 48.35930851 29.88013044 26.47554743 10.22284710 6 | 0.69951506 739.37529863 51.11312649 38.15900489 54.06952788 47.65846992 29.76917609 29.51661451 10.33878159 7 | 0.94011476 735.77502876 51.18413896 37.33702852 55.75155953 46.91644175 29.59910565 32.95707813 10.47961870 8 | 1.20982607 731.85282708 51.05289643 36.38618932 57.66826350 46.12324676 29.34392108 36.91743422 10.65522161 9 | 1.49825088 728.46517521 50.03000624 35.41581910 59.64744582 45.31873551 28.99124062 41.26645170 10.86512581 10 | 1.85517405 725.99585366 47.01366564 34.32697685 61.88928798 44.38205556 28.43822802 46.79653735 11.15739494 11 | 2.12963864 724.78054190 44.06842389 33.54397453 63.42228150 43.70283544 27.92703310 51.14873009 11.40617955 12 | 2.45390654 723.38317300 40.69846259 32.61593743 65.01365771 42.94248900 27.23273570 56.38817869 11.72536588 13 | 2.89287892 721.51261986 36.46886578 31.26065299 66.80715050 41.97894676 26.15458682 63.62123679 12.19594050 14 | 3.00000000 721.06078616 35.50223737 30.90410239 67.18501599 41.75434540 25.87051417 65.40643018 12.31656834 -------------------------------------------------------------------------------- /cpp/tests/data/results_osecirts.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/cpp/tests/data/results_osecirts.h5 -------------------------------------------------------------------------------- /cpp/tests/data/results_osecirvvs.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/cpp/tests/data/results_osecirvvs.h5 -------------------------------------------------------------------------------- /cpp/tests/data/seair-compare.csv: -------------------------------------------------------------------------------- 1 | 2 | # Time Susceptible Exposed Asymptomatic Infected Recovered Dead 3 | 0.0000000000 0.9981633866 0.0003451396 0.0003784688 0.0010302737 0.0000533305 0.0000294008 4 | 0.3000000000 0.9980778689 0.0003765044 0.0003977156 0.0010501743 0.0000670565 0.0000306802 5 | 1.2203438486 0.9977992816 0.0004617289 0.0004715106 0.0011191159 0.0001135940 0.0000347690 6 | 2.1406876972 0.9974918476 0.0005388011 0.0005597578 0.0012023344 0.0001681150 0.0000391440 7 | 3.2481026116 0.9970767863 0.0006302971 0.0006780251 0.0013241162 0.0002459051 0.0000448702 8 | 4.5387130588 0.9965208039 0.0007435648 0.0008293838 0.0014987229 0.0003552021 0.0000523226 9 | 6.0880435040 0.9957328753 0.0008973926 0.0010318929 0.0017592743 0.0005159253 0.0000626395 10 | 7.9969256445 0.9945448939 0.0011243014 0.0013215244 0.0021666093 0.0007647353 0.0000779357 11 | 10.0000000000 0.9929809200 0.0014197894 0.0016891685 0.0027146161 0.0010976191 0.0000978869 12 | -------------------------------------------------------------------------------- /cpp/tests/data/test_all_ageinf_vacc.json: -------------------------------------------------------------------------------- 1 | [{"Date":"2022-04-12","ID_County":1001,"ID_District":1234,"Age_RKI":"0-4","Vacc_partially":0.0,"Vacc_completed":5.0,"Vacc_refreshed":2.0,"Vacc_refreshed_2":1.0}, 2 | {"Date":"2022-04-15","ID_District":1235,"Age_RKI":"15-34","Vacc_partially":1.0,"Vacc_completed":1.0, "Vacc_refreshed":4.0,"Vacc_refreshed_2":3.0}] 3 | -------------------------------------------------------------------------------- /cpp/tests/data/test_cases_all_age.json: -------------------------------------------------------------------------------- 1 | [{"Date":"2022-04-24","ID_District":1234,"Age_RKI":"A00-A04","Confirmed":1.0,"Deaths":0.0,"Recovered":0.0}, 2 | {"Date":"2022-04-25","ID_District":1234,"Age_RKI":"A15-A34","Confirmed":20.0,"Deaths":1.0,"Recovered":5.0}, 3 | {"Date":"2022-04-24","ID_District":1235,"Age_RKI":"A80+","Confirmed":15.0,"Deaths":3.0,"Recovered":2.0}] 4 | -------------------------------------------------------------------------------- /cpp/tests/data/test_county_divi.json: -------------------------------------------------------------------------------- 1 | [{"ID_District":1234,"ICU":0.5437,"ICU_ventilated":0.5437,"Date":"2022-04-24"}, 2 | {"ID_District":1234,"ICU":0.64532,"ICU_ventilated":0.64532,"Date":"2022-04-25"}, 3 | {"ID_District":1235,"ICU":0.3574,"ICU_ventilated":0.3574,"Date":"2022-04-24"}, 4 | {"ID_District":1235,"ICU":0.35437,"ICU_ventilated":0.35437,"Date":"2022-04-25"}] 5 | -------------------------------------------------------------------------------- /cpp/tests/data/test_current_population.json: -------------------------------------------------------------------------------- 1 | [{"ID_County":1001,"ID_District":1234,"Population":89934,"<3 years":2709,"3-5 years":2485,"6-14 years":6816,"15-17 years":2206,"18-24 years":10396,"25-29 years":7991,"30-39 years":11199,"40-49 years":9783,"50-64 years":18077,"65-74 years":8735,">74 years":9537}, 2 | {"ID_County":1001,"ID_District":1235,"Population":89019,"<3 years":3460,"3-5 years":1965,"6-14 years":7156,"15-17 years":1207,"18-24 years":9677,"25-29 years":8004,"30-39 years":12395,"40-49 years":10124,"50-64 years":17143,"65-74 years":8456,">74 years":9432}] 3 | -------------------------------------------------------------------------------- /cpp/tests/data/test_empty_file.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /cpp/tests/sanitizers.cpp: -------------------------------------------------------------------------------- 1 | // Taken from: https://github.com/google/googletest/pull/3086/files 2 | // Sanitizer Integration 3 | // The 4 | // [Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html), 5 | // [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer), 6 | // and 7 | // [Thread Sanitizer](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual) 8 | // all provide weak functions that you can override to trigger explicit failures 9 | // when they detect sanitizer errors, such as creating a reference from `nullptr`. 10 | // To override these functions, place definitions for them in a source file that 11 | // you compile as part of your main binary 12 | #include 13 | 14 | extern "C" { 15 | void __ubsan_on_report() 16 | { 17 | FAIL() << "Encountered an undefined behavior sanitizer error"; 18 | } 19 | void __asan_on_error() 20 | { 21 | FAIL() << "Encountered an address sanitizer error"; 22 | } 23 | void __tsan_on_report() 24 | { 25 | FAIL() << "Encountered a thread sanitizer error"; 26 | } 27 | } // extern "C" 28 | -------------------------------------------------------------------------------- /cpp/tests/test_data_dir.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele 5 | * 6 | * Contact: Martin J. Kuehn 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 TEST_DATA_DIR_H 21 | #define TEST_DATA_DIR_H 22 | 23 | constexpr const char* TEST_DATA_DIR = "${MEMILIO_TEST_DATA_DIR}"; 24 | constexpr const char* TEST_GERMANY_PYDATA_DIR = "${MEMILIO_TEST_DATA_DIR}/Germany/pydata"; 25 | 26 | #endif //TEST_DATA_DIR_H 27 | -------------------------------------------------------------------------------- /cpp/tests/testmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Daniel Abele, Martin Siggel 5 | * 6 | * Contact: Martin J. Kuehn 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 | #include "memilio/utils/logging.h" 21 | #include "memilio/utils/miompi.h" 22 | #include "memilio/utils/random_number_generator.h" 23 | #include 24 | 25 | int main(int argc, char** argv) 26 | { 27 | mio::mpi::init(); 28 | mio::set_log_level(mio::LogLevel::warn); 29 | 30 | ::testing::InitGoogleTest(&argc, argv); 31 | int retval = RUN_ALL_TESTS(); 32 | mio::mpi::finalize(); 33 | return retval; 34 | } 35 | -------------------------------------------------------------------------------- /cpp/thirdparty/README.md: -------------------------------------------------------------------------------- 1 | # 3rd-Party Dependencies 2 | 3 | This directory contains CMake configuration of the dependencies of the MEmilio C++ library. See [the MEmilio C++ README](../README.md) for the full list of dependencies. 4 | 5 | ## Bundled Dependencies 6 | 7 | Most dependencies of this project don't need to be installed manually. These dependencies are bundled by cloning an external repository. Using the `MEMILIO_USE_BUNDLED_` CMake options (where `` is the name of the dependency), installed packages can be used instead of the bundled packages, using the usual `find_package` mechanism. 8 | 9 | ### External Repositories 10 | 11 | The repository of the dependency is cloned during CMake configuration into the `/_deps/-src` directory. The dependency is then built together with the MEmilio project. The version of the package is set in the [thirdparty CMakeLists.txt](CMakeLists.txt). To upgrade the version, simply increase the version number there. 12 | 13 | Note: Cloning the boost git repository can take a while. Especially for this dependency, it may be useful to set the `MEMILIO_USE_BUNDLED_BOOST` option to `OFF` if the package is already installed. The installed boost version must be at least version 1.76.0. 14 | It is planned to offer the option to use a minimal extract of boost library as an archive included in the MEmilio project. With the minimal version of boost, only limited functionality of MEmilio can be used. 15 | -------------------------------------------------------------------------------- /data/Germany/contacts/baseline_home.txt: -------------------------------------------------------------------------------- 1 | 0.4413 0.4504 1.2383 0.8033 0.0494 0.0017 2 | 0.0485 0.7616 0.6532 1.1614 0.0256 0.0013 3 | 0.1800 0.1795 0.8806 0.6413 0.0429 0.0032 4 | 0.0495 0.2639 0.5189 0.8277 0.0679 0.0014 5 | 0.0087 0.0394 0.1417 0.3834 0.7064 0.0447 6 | 0.0292 0.0648 0.1248 0.4179 0.3497 0.1544 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/baseline_other.txt: -------------------------------------------------------------------------------- 1 | 0.5170 0.3997 0.7957 0.9958 0.3239 0.0428 2 | 0.0632 0.9121 0.3254 0.4731 0.2355 0.0148 3 | 0.0336 0.1604 1.7529 0.8622 0.1440 0.0077 4 | 0.0204 0.1444 0.5738 1.2127 0.3433 0.0178 5 | 0.0371 0.0393 0.4171 0.9666 0.7495 0.0257 6 | 0.0791 0.0800 0.3480 0.5588 0.2769 0.0180 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/baseline_school_pf_aver.txt: -------------------------------------------------------------------------------- 1 | 1.1165 0.2741 0.2235 0.1028 0.0007 0.0000 2 | 0.1627 1.9412 0.2431 0.1780 0.0130 0.0000 3 | 0.0148 0.1646 1.1266 0.0923 0.0074 0.0000 4 | 0.0367 0.1843 0.3265 0.0502 0.0021 0.0005 5 | 0.0004 0.0370 0.0115 0.0014 0.0039 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/baseline_school_pf_eig.txt: -------------------------------------------------------------------------------- 1 | 2.9964 0.2501 0.9132 0.2509 0.0000 0.0000 2 | 0.2210 1.9155 0.2574 0.2863 0.0070 0.0000 3 | 0.0324 0.3598 1.2613 0.1854 0.0041 0.0000 4 | 0.1043 0.4794 1.1886 0.1836 0.0052 0.0022 5 | 0.0000 0.1150 0.0000 0.0000 0.0168 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/baseline_school_prem.txt: -------------------------------------------------------------------------------- 1 | 1.3275 0.1108 0.4046 0.1112 0.0000 0.0000 2 | 0.0979 0.8486 0.1140 0.1268 0.0031 0.0000 3 | 0.0144 0.1594 0.5588 0.0822 0.0018 0.0000 4 | 0.0462 0.2124 0.5266 0.0813 0.0023 0.0010 5 | 0.0000 0.0510 0.0000 0.0000 0.0074 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/baseline_work.txt: -------------------------------------------------------------------------------- 1 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 2 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 3 | 0.0000 0.0127 1.7570 1.6050 0.0133 0.0000 4 | 0.0000 0.0020 1.0311 2.3166 0.0098 0.0000 5 | 0.0000 0.0002 0.0194 0.0325 0.0003 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/minimum_home.txt: -------------------------------------------------------------------------------- 1 | 0.2339 0.2387 0.6564 0.4258 0.0262 0.0009 2 | 0.0257 0.4037 0.3462 0.6156 0.0136 0.0007 3 | 0.0734 0.0772 0.5699 0.3003 0.0112 0.0014 4 | 0.0156 0.1418 0.2708 0.5088 0.0138 0.0004 5 | 0.0002 0.0031 0.0363 0.1684 0.4972 0.0433 6 | 0.0008 0.0034 0.0133 0.0872 0.3558 0.1983 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/minimum_other.txt: -------------------------------------------------------------------------------- 1 | 0.0617 0.0477 0.0949 0.1188 0.0386 0.0051 2 | 0.0075 0.1088 0.0388 0.0564 0.0281 0.0018 3 | 0.0033 0.0121 0.1699 0.0768 0.0077 0.0007 4 | 0.0027 0.0100 0.0786 0.1338 0.0258 0.0026 5 | 0.0204 0.0130 0.0988 0.1590 0.1316 0.0045 6 | 0.0791 0.0348 0.0968 0.0875 0.0573 0.0051 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/minimum_school_pf_aver.txt: -------------------------------------------------------------------------------- 1 | 0.0190 0.0047 0.0038 0.0018 0.0000 0.0000 2 | 0.0028 0.0331 0.0041 0.0030 0.0002 0.0000 3 | 0.0009 0.0032 0.0241 0.0036 0.0007 0.0000 4 | 0.0008 0.0006 0.0003 0.0002 0.0001 0.0004 5 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/minimum_school_pf_eig.txt: -------------------------------------------------------------------------------- 1 | 0.0510 0.0043 0.0156 0.0043 0.0000 0.0000 2 | 0.0038 0.0326 0.0044 0.0049 0.0001 0.0000 3 | 0.0020 0.0070 0.0270 0.0072 0.0004 0.0000 4 | 0.0023 0.0015 0.0013 0.0008 0.0002 0.0020 5 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/minimum_school_prem.txt: -------------------------------------------------------------------------------- 1 | 0.0226 0.0019 0.0069 0.0019 0.0000 0.0000 2 | 0.0017 0.0145 0.0019 0.0022 0.0001 0.0000 3 | 0.0009 0.0031 0.0119 0.0032 0.0002 0.0000 4 | 0.0010 0.0007 0.0006 0.0004 0.0001 0.0009 5 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/Germany/contacts/minimum_work.txt: -------------------------------------------------------------------------------- 1 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 2 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 3 | 0.0000 0.0021 0.3695 0.2212 0.0020 0.0000 4 | 0.0000 0.0001 0.2562 0.5632 0.0008 0.0000 5 | 0.0000 0.0000 0.0048 0.0064 0.0001 0.0000 6 | 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 7 | -------------------------------------------------------------------------------- /data/README.md: -------------------------------------------------------------------------------- 1 | # MEmilio Data # 2 | 3 | This directory contains data used for real-world epidemiological simulations. Additional datasets (e.g., daily reported COVID‑19 data for Germany) can be added using the MEmilio Epidata Package [MEmilio Python library](../pycode/memilio-epidata/README.rst). 4 | 5 | ## Directory Structure 6 | The data is organized by region. Within a region folder (e.g., Germany), you will find the following subdirectories: 7 | 8 | - **contacts**: Contact matrices, i.e., the number of daily contacts between persons of different age groups. 9 | - **mobility**: Number of daily commuters and other travelers moving between regional entities. 10 | - **pydata**: Data generated using the `Epidata` package from the MEmilio library. 11 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | MEmilio Documentation 2 | =============================== 3 | With every merged pull request, the online documentation gets updated at: [https://memilio.readthedocs.io/en/latest/](https://memilio.readthedocs.io/en/latest/). 4 | 5 | A MEmilio documentation can also be created locally with [doxygen](https://www.doxygen.nl/). In order to do so, follow the procedure below. 6 | 7 | How to create the documentation: 8 | --------------------------------- 9 | 1. From the `docs` folder, execute 10 | 11 | doxygen 12 | 13 | This will create an html documentation. 14 | 15 | 2. Open 16 | 17 | docs/html/index.html 18 | 19 | 20 | How to use the documentation 21 | ---------------------------- 22 | Under "Files", you can see the general file structure and access documentation of classes. 23 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/memilio-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/docs/memilio-small.png -------------------------------------------------------------------------------- /docs/memilio.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/docs/memilio.ico -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx==7.1.2 2 | sphinx-rtd-theme==1.3.0rc1 3 | sphinx-copybutton 4 | sphinx_design 5 | breathe 6 | sphinx-hoverxref 7 | pycode/memilio-epidata 8 | pycode/memilio-generation 9 | pycode/memilio-plot 10 | pycode/memilio-simulation 11 | pycode/memilio-surrogatemodel 12 | exhale 13 | -------------------------------------------------------------------------------- /docs/source/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* Newlines (\a) and spaces (\20) before each parameter 2 | .sig-param::before { 3 | content: "\a\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20"; 4 | white-space: pre; 5 | } 6 | 7 | /* Newline after the last parameter (so the closing bracket is on a new line) 8 | dt em.sig-param:last-of-type::after { 9 | content: "\a"; 10 | white-space: pre; 11 | } 12 | 13 | /* To have blue background of width of the block (instead of width of content) 14 | dl.class > dt:first-of-type { 15 | display: block !important; 16 | } */ 17 | 18 | /* Take out pointless vertical whitespace in the signatures. */ 19 | .rst-content dl .sig dl, 20 | .rst-content dl .sig dd { 21 | margin-bottom: 0; 22 | } 23 | 24 | /* Make signature boxes full-width, with view-source and header links right-aligned. */ 25 | .rst-content dl .sig { 26 | width: -webkit-fill-available; 27 | } 28 | .rst-content .viewcode-link { 29 | display: inline-flex; 30 | float: inline-end; 31 | margin-right: 1.5em; 32 | } 33 | .rst-content .headerlink { 34 | position: absolute; 35 | right: 0.5em; 36 | } 37 | 38 | .wy-table-responsive table td, 39 | .wy-table-responsive table th { 40 | white-space: normal; 41 | } 42 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/class.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | 7 | {% block methods %} 8 | {% if '__init__' in methods %} 9 | .. automethod:: __init__ 10 | :noindex: 11 | {% endif %} 12 | {% if methods %} 13 | .. rubric:: Methods Summary 14 | .. autosummary:: 15 | {% for item in methods %} 16 | ~{{ name }}.{{ item }} 17 | {%- endfor %} 18 | {% endif %} 19 | {% endblock %} 20 | 21 | {% block attributes %} 22 | {% if attributes %} 23 | .. rubric:: Attributes 24 | .. autosummary:: 25 | {% for item in attributes %} 26 | ~{{ name }}.{{ item }} 27 | {%- endfor %} 28 | {% endif %} 29 | {% endblock %} 30 | 31 | {% block methods_full %} 32 | {% if methods %} 33 | .. rubric:: Methods 34 | {% for item in methods %} 35 | .. automethod:: {{ name }}.{{ item }} 36 | {%- endfor %} 37 | {% endif %} 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/module.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. automodule:: {{ fullname }} 4 | :members: 5 | :undoc-members: 6 | 7 | {% block attributes %} 8 | {% if attributes %} 9 | .. rubric:: {{ _('Module Attributes') }} 10 | 11 | .. autosummary:: 12 | {% for item in attributes %} 13 | {{ item }} 14 | {%- endfor %} 15 | {% endif %} 16 | {% endblock %} 17 | 18 | {% block functions %} 19 | {% if functions %} 20 | .. rubric:: {{ _('Functions') }} 21 | 22 | .. autosummary:: 23 | {% for item in functions %} 24 | {{ item }} 25 | {%- endfor %} 26 | {% endif %} 27 | {% endblock %} 28 | 29 | {% block classes %} 30 | {% if classes %} 31 | .. rubric:: {{ _('Classes') }} 32 | 33 | .. autosummary:: 34 | {% for item in classes %} 35 | {{ item }} 36 | {%- endfor %} 37 | {% endif %} 38 | {% endblock %} 39 | 40 | {% block exceptions %} 41 | {% if exceptions %} 42 | .. rubric:: {{ _('Exceptions') }} 43 | 44 | .. autosummary:: 45 | {% for item in exceptions %} 46 | {{ item }} 47 | {%- endfor %} 48 | {% endif %} 49 | {% endblock %} 50 | 51 | {% block modules %} 52 | {% if modules %} 53 | .. rubric:: Modules 54 | 55 | .. autosummary:: 56 | :toctree: 57 | :recursive: 58 | {% for item in modules %} 59 | {{ item }} 60 | {%- endfor %} 61 | {% endif %} 62 | {% endblock %} 63 | -------------------------------------------------------------------------------- /docs/source/_templates/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {% extends "!breadcrumbs.html" %} 2 | {%- block breadcrumbs_aside %} 3 |
  • 4 | 5 | 10 | 11 |
  • 12 | {{ super() }} 13 | {% endblock %} -------------------------------------------------------------------------------- /docs/source/cpp/aggregated_models.rst: -------------------------------------------------------------------------------- 1 | Aggregated models 2 | ================= 3 | 4 | There are different equation-based models implemented in MEmilio that consider an aggregated population. 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | Ordinary differential equations 10 | Linear Chain Trick 11 | Generalized Linear Chain Trick 12 | Stochastic-differential equations 13 | Integro-differential equations -------------------------------------------------------------------------------- /docs/source/cpp/ide_creation.rst: -------------------------------------------------------------------------------- 1 | IDE Models 2 | ========== -------------------------------------------------------------------------------- /docs/source/cpp/individual_models.rst: -------------------------------------------------------------------------------- 1 | Individual-based models 2 | ======================= 3 | 4 | There are two individual- or agent-based models (ABMs) implemented in MEmilio. 5 | The diffusive ABM realizes agent movement through a diffusion process with disease transmission and progression modeled by stochastic jump processes. 6 | The mobility-based ABM is much more advanced and realizes agent movement between discrete locations by either mobility rules or so-called trips. 7 | Additionally, agents have much more features e.g. an individual infection history as well as features related to quarantine or immunization. 8 | 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | mobility_based_abm 14 | diffusive_abm 15 | -------------------------------------------------------------------------------- /docs/source/cpp/installation.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ================ 3 | 4 | Fow now, we refer to our `github repository `_ . -------------------------------------------------------------------------------- /docs/source/cpp/lct_creation.rst: -------------------------------------------------------------------------------- 1 | LCT Models 2 | ========== -------------------------------------------------------------------------------- /docs/source/cpp/mobility_metapop.rst: -------------------------------------------------------------------------------- 1 | Mobility and Metapopulation Models 2 | ================================== 3 | 4 | 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | mobility 10 | metapop 11 | -------------------------------------------------------------------------------- /docs/source/cpp/model_creation.rst: -------------------------------------------------------------------------------- 1 | Model Creation 2 | ============== 3 | 4 | Here we collect information on how to create models. 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | Common structure 10 | Ordinary differential equations 11 | Linear Chain Trick 12 | stochastic-differential equations 13 | integro-differenatial equations 14 | -------------------------------------------------------------------------------- /docs/source/cpp/model_usage.rst: -------------------------------------------------------------------------------- 1 | Model Usage 2 | =========== 3 | 4 | 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | aggregated_models 10 | individual_models 11 | mobility_metapop 12 | io 13 | -------------------------------------------------------------------------------- /docs/source/cpp/ode.rst: -------------------------------------------------------------------------------- 1 | ODE Models 2 | ========== -------------------------------------------------------------------------------- /docs/source/cpp/ode_creation.rst: -------------------------------------------------------------------------------- 1 | ODE model creation 2 | ================== 3 | 4 | Model definition 5 | ---------------- 6 | 7 | Before implementing a model in MEmilio, we need to do a some math, in particular, define an initial value problem 8 | given by a system of ordinary differential equations. For example we consider a SIRD model given by 9 | 10 | .. math:: 11 | \begin{aligned} 12 | S'(t) & = -\rho\phi\ \frac{S(t)*I(t)}{N_{\perp D}} \\ 13 | I'(t) & = \rho\phi\ \frac{S(t)*I(t)}{N_{\perp D}} - \frac{\mu_R + \mu_D}{T_I}I(t) \\ 14 | R'(t) & = \frac{\mu_R}{T_I}I(t) \\ 15 | D'(t) & = \frac{\mu_D}{T_I}I(t) \\ 16 | \end{aligned} 17 | 18 | and some initial values for :math:`t=0`. Here :math:`N_{\perp D} := S(t) + I(t) + R(t)`. 19 | 20 | This type of model is called compartmental model, because the model population is represented by discrete infection 21 | states **S** usceptible, **I** nfected, **R** ecovered, **D** ead, also called compartments. 22 | 23 | How to define an ODE model 24 | -------------------------- 25 | -------------------------------------------------------------------------------- /docs/source/cpp/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ============ -------------------------------------------------------------------------------- /docs/source/cpp/sde.rst: -------------------------------------------------------------------------------- 1 | SDE Models 2 | ========== 3 | -------------------------------------------------------------------------------- /docs/source/cpp/sde_creation.rst: -------------------------------------------------------------------------------- 1 | SDE Model Creation 2 | ================== -------------------------------------------------------------------------------- /docs/source/cpp/structure.rst: -------------------------------------------------------------------------------- 1 | Structure 2 | ========= -------------------------------------------------------------------------------- /docs/source/faq.rst: -------------------------------------------------------------------------------- 1 | FAQ 2 | ==== 3 | 4 | 5 | I found a bug. What should I do? 6 | -------------------------------- 7 | 8 | Please open an issue on our `GitHub `_ page. Please try to describe the bug as detailed as possible, including the steps to reproduce it. 9 | 10 | I solved a bug. What should I do? 11 | --------------------------------- 12 | 13 | Please open a pull request on our `GitHub `_ page. If there is not yet a bug report, please open an issue first and reference it in your pull request. For more information, please refer to :doc:`development`. -------------------------------------------------------------------------------- /docs/source/models/index.rst: -------------------------------------------------------------------------------- 1 | Models 2 | ========================= 3 | 4 | MEmilio containst multiple different models. They are explained on the following subpages: 5 | 6 | .. toctree:: 7 | :titlesonly: 8 | 9 | sdesir 10 | sde_sirs 11 | sdeseir 12 | ode_sir 13 | ode_seir 14 | secirvvs 15 | secirts 16 | oseair 17 | osecir 18 | lsecir 19 | iseir 20 | isecir 21 | glsecir 22 | abm 23 | -------------------------------------------------------------------------------- /docs/source/models/iseir.rst: -------------------------------------------------------------------------------- 1 | IDE SEIR model 2 | ============== 3 | 4 | This model is based on integro-differential equations. The four compartments: 5 | 6 | - **Susceptible**: may become exposed at any time. 7 | - **Exposed**: becomes infected after some time. 8 | - **Infected**: will recover after some time. 9 | - **Recovered** 10 | 11 | are used to simulate the spread of the disease. 12 | 13 | An example can be found in the 14 | `examples/ide_seir.cpp `_. 15 | 16 | 17 | Overview of the ``iseir`` namespace: 18 | ----------------------------------------- 19 | 20 | .. doxygennamespace:: mio::iseir -------------------------------------------------------------------------------- /docs/source/python/python_bindings_patterns.rst: -------------------------------------------------------------------------------- 1 | Common patterns in python bindings 2 | ================================== 3 | 4 | 5 | Template classes 6 | ---------------- 7 | 8 | IOResult as return 9 | ------------------ 10 | 11 | CustomIndexArray 12 | ---------------- 13 | 14 | -------------------------------------------------------------------------------- /docs/source/pythonapi/memilio.simulation.abm.rst: -------------------------------------------------------------------------------- 1 | memilio.simulation.abm 2 | ====================== 3 | 4 | .. automodule:: memilio.simulation._simulation_abm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/source/pythonapi/memilio.simulation.osecir.rst: -------------------------------------------------------------------------------- 1 | memilio.simulation.osecir 2 | ========================= 3 | 4 | .. automodule:: memilio.simulation._simulation_osecir 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/source/pythonapi/memilio.simulation.osecirvvs.rst: -------------------------------------------------------------------------------- 1 | memilio.simulation.osecirvvs 2 | ============================ 3 | 4 | .. automodule:: memilio.simulation._simulation_osecirvvs 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/source/pythonapi/memilio.simulation.oseir.rst: -------------------------------------------------------------------------------- 1 | memilio.simulation.oseir 2 | ======================== 3 | 4 | .. automodule:: memilio.simulation._simulation_oseir 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/source/pythonapi/memilio.simulation.osir.rst: -------------------------------------------------------------------------------- 1 | memilio.simulation.osir 2 | ======================= 3 | 4 | .. automodule:: memilio.simulation._simulation_osir 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/source/pythonapi/memilio.simulation.rst: -------------------------------------------------------------------------------- 1 | memilio.simulation 2 | ================== 3 | 4 | .. rubric:: Modules 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | memilio.simulation.abm 10 | memilio.simulation.osir 11 | memilio.simulation.oseir 12 | memilio.simulation.osecir 13 | memilio.simulation.osecirvvs 14 | 15 | .. automodule:: memilio.simulation._simulation 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/source/pythonapi/pythonapi.rst: -------------------------------------------------------------------------------- 1 | Python API 2 | =========== 3 | 4 | 5 | .. .. rubric:: Modules 6 | 7 | .. autosummary:: 8 | :toctree: generated 9 | :recursive: 10 | 11 | memilio.plot 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | memilio.simulation 17 | 18 | -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | MEmilio main namespace package. 23 | """ 24 | 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Functions to import epidemiological data from a variety of sources including RKI, JHU, and others. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata/download_config.conf: -------------------------------------------------------------------------------- 1 | [SETTINGS] 2 | # Set verbosity level 3 | # Off, Critical, Error, Warning, Info, Debug, Trace 4 | # Default: Info 5 | verbosity_level = Info 6 | 7 | # Whether to show Progress Indicator (Spinner, download bars etc.) 8 | # True or False 9 | show_progress = True 10 | 11 | # Whether to run sanity checks etc. 12 | # Will improve performance but may lead to unpredicted behaviour if something in the file format has changed 13 | # True or False 14 | run_checks = True 15 | 16 | # Interactivity of the download functions 17 | # Programm will exit with error if a user choice is needed and interactive is False. 18 | # True or False 19 | interactive = False 20 | 21 | # Defines if plots are generated with matplotlib 22 | # True or False 23 | make_plot = False 24 | 25 | # If out_folder or a different path should be used. 26 | # default uses the definition of default_dict 27 | path_to_use = default 28 | 29 | # If raw data from source should be prevented from being written into the download directory 30 | # True or False 31 | no_raw = False 32 | 33 | # matplotlib backend to use 34 | mpl_backend = QtAgg 35 | 36 | # To dataset allows to not generate json file but rather return python objects 37 | to_dataset = False -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata_test/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Module epidata_test provides tests for the epidata module. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata_test/test_data/TestSetCaseEstimationsDeaths.json: -------------------------------------------------------------------------------- 1 | [{"Sterbejahr":2020,"Sterbewoche":1,"Anzahl verstorbene COVID-19 F\u00e4lle":"0"},{"Sterbejahr":2020,"Sterbewoche":3,"Anzahl verstorbene COVID-19 F\u00e4lle":"<4"},{"Sterbejahr":2020,"Sterbewoche":10,"Anzahl verstorbene COVID-19 F\u00e4lle":"18"},{"Sterbejahr":2020,"Sterbewoche":51,"Anzahl verstorbene COVID-19 F\u00e4lle":"3000"}] -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata_test/test_data/TestSetCaseEstimationsDeathsWeekly.json: -------------------------------------------------------------------------------- 1 | [{"Sterbejahr":2020,"Sterbewoche":1,"AG 0-9 Jahre":"0","AG 10-19 Jahre":"0","AG 20-29 Jahre":"0","AG 30-39 Jahre":"0","AG 40-49 Jahre":"0","AG 50-59 Jahre":"0","AG 60-69 Jahre":"0","AG 70-79 Jahre":"0","AG 80-89 Jahre":"0","AG 90+ Jahre":"0"},{"Sterbejahr":2020,"Sterbewoche":3,"AG 0-9 Jahre":"<4","AG 10-19 Jahre":"<4","AG 20-29 Jahre":"<4","AG 30-39 Jahre":"<4","AG 40-49 Jahre":"<4","AG 50-59 Jahre":"<4","AG 60-69 Jahre":"<4","AG 70-79 Jahre":"<4","AG 80-89 Jahre":"<4","AG 90+ Jahre":"<4"},{"Sterbejahr":2020,"Sterbewoche":10,"AG 0-9 Jahre":"30","AG 10-19 Jahre":"30","AG 20-29 Jahre":"30","AG 30-39 Jahre":"30","AG 40-49 Jahre":"30","AG 50-59 Jahre":"30","AG 60-69 Jahre":"30","AG 70-79 Jahre":"30","AG 80-89 Jahre":"30","AG 90+ Jahre":"30"},{"Sterbejahr":2020,"Sterbewoche":51,"AG 0-9 Jahre":"10","AG 10-19 Jahre":"10","AG 20-29 Jahre":"10","AG 30-39 Jahre":"10","AG 40-49 Jahre":"10","AG 50-59 Jahre":"10","AG 60-69 Jahre":"10","AG 70-79 Jahre":"10","AG 80-89 Jahre":"10","AG 90+ Jahre":"10"}] -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata_test/test_data/TestSetCaseEstimationsDeathsWeeklyGender.json: -------------------------------------------------------------------------------- 1 | [{"Sterbejahr":2020,"Sterbewoche":1,"M\u00e4nner, AG 0-19 Jahre":"0","M\u00e4nner, AG 20-39 Jahre":"0","M\u00e4nner, AG 40-59 Jahre":"0","M\u00e4nner, AG 60-79 Jahre":"0","M\u00e4nner, AG 80+ Jahre":"0","Frauen, AG 0-19 Jahre":"0","Frauen, AG 20-39 Jahre":"0","Frauen, AG 40-59 Jahre":"0","Frauen, AG 60-79 Jahre":"0","Frauen, AG 80+ Jahre":"0"},{"Sterbejahr":2020,"Sterbewoche":3,"M\u00e4nner, AG 0-19 Jahre":"<4","M\u00e4nner, AG 20-39 Jahre":"<4","M\u00e4nner, AG 40-59 Jahre":"<4","M\u00e4nner, AG 60-79 Jahre":"<4","M\u00e4nner, AG 80+ Jahre":"<4","Frauen, AG 0-19 Jahre":"<4","Frauen, AG 20-39 Jahre":"<4","Frauen, AG 40-59 Jahre":"<4","Frauen, AG 60-79 Jahre":"<4","Frauen, AG 80+ Jahre":"<4"},{"Sterbejahr":2020,"Sterbewoche":10,"M\u00e4nner, AG 0-19 Jahre":"30","M\u00e4nner, AG 20-39 Jahre":"30","M\u00e4nner, AG 40-59 Jahre":"30","M\u00e4nner, AG 60-79 Jahre":"30","M\u00e4nner, AG 80+ Jahre":"30","Frauen, AG 0-19 Jahre":"30","Frauen, AG 20-39 Jahre":"30","Frauen, AG 40-59 Jahre":"30","Frauen, AG 60-79 Jahre":"30","Frauen, AG 80+ Jahre":"30"},{"Sterbejahr":2020,"Sterbewoche":51,"M\u00e4nner, AG 0-19 Jahre":"10","M\u00e4nner, AG 20-39 Jahre":"10","M\u00e4nner, AG 40-59 Jahre":"10","M\u00e4nner, AG 60-79 Jahre":"10","M\u00e4nner, AG 80+ Jahre":"10","Frauen, AG 0-19 Jahre":"10","Frauen, AG 20-39 Jahre":"10","Frauen, AG 40-59 Jahre":"10","Frauen, AG 60-79 Jahre":"10","Frauen, AG 80+ Jahre":"10"}] -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata_test/test_data/TestSetNPIsCombinations.json: -------------------------------------------------------------------------------- 1 | [{"Unnamed: 0":0,"Variablenname":"M1_1","Massnahmenindex":0,"Variable":"Beschr\u00e4nkung X","empty":0,"Unnamed: 5":"x","Unnamed: 6":null,"Unnamed: 7":null},{"Unnamed: 0":6,"Variablenname":"M1_2","Massnahmenindex":1,"Variable":"Beschr\u00e4nkung Y","empty":0,"Unnamed: 5":null,"Unnamed: 6":"x","Unnamed: 7":"x"},{"Unnamed: 0":12,"Variablenname":"M1_3","Massnahmenindex":2,"Variable":"Beschr\u00e4nkung Z","empty":0,"Unnamed: 5":null,"Unnamed: 6":"x","Unnamed: 7":"x"}] -------------------------------------------------------------------------------- /pycode/memilio-epidata/memilio/epidata_test/test_data/TestSetNPIsPopulationData.json: -------------------------------------------------------------------------------- 1 | [{"ID_County":1001,"Population":98663,"<3 years":9711,"3-5 years":8499,"6-14 years":5103,"15-17 years":10673,"18-24 years":9915,"25-29 years":11048,"30-39 years":2346,"40-49 years":12995,"50-64 years":11268,"65-74 years":3744,">74 years":13361}] -------------------------------------------------------------------------------- /pycode/memilio-epidata/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # dev dependencies 2 | # first support of python 3.11 is 4.6 3 | # 5.3.4 has conflicts with openpyxl 4 | # 5.3.3 broken 5 | pyfakefs>=4.6,<5.3.3 6 | coverage>=7.0.1 7 | # pylint 2.16 creates problem with wrapt package version 8 | pylint>=2.13.0,<2.16 9 | pylint_json2html==0.4.0 10 | -------------------------------------------------------------------------------- /pycode/memilio-epidata/tools/script_to_extract_every_county_once.py: -------------------------------------------------------------------------------- 1 | # Script to extract one data row for every countx each to generate test 2 | # data for test_epidata_get_Case_Data_read.py which is not to large 3 | 4 | import pandas as pd 5 | 6 | from memilio.epidata import defaultDict as dd 7 | from memilio.epidata import getDataIntoPandasDataFrame as gd 8 | 9 | # Put any CaseDataFull.json file or Update file has below here 10 | file_name = "UpdateDataCases2021-07-08.json" 11 | 12 | # read in 13 | df = pd.read_json(file_name) 14 | 15 | # empty dataframe to get every county jut once 16 | df_neu = pd.DataFrame() 17 | 18 | for k in dd.County.keys(): 19 | 20 | df_k = df[df["IdLandkreis"] == k].reset_index() 21 | 22 | print(k, len(df_k)) 23 | 24 | if len(df_k) > 0: 25 | 26 | df_append = df_k.iloc[[0]] 27 | df_neu = pd.concat([df_neu, df_append]) 28 | 29 | print("Number of counties in data:", len(df_neu)) 30 | 31 | 32 | gd.write_dataframe(df_neu, ".", "test_epidata_get_Case_Data_data_read", "json") 33 | -------------------------------------------------------------------------------- /pycode/memilio-generation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | project(memilio-python) 3 | 4 | include(GNUInstallDirs) # set to gnu folders. No cache variable so this is not global 5 | 6 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 7 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 8 | set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 9 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 10 | set(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/bin") 11 | 12 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 13 | 14 | # add in C++ library 15 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL) 16 | FIND_LIBRARY(LIBCLANG_PATH 17 | clang HINTS ${CMAKE_CXX_COMPILER}/../../ 18 | ) 19 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/memilio/tools/config.json.txt ${CMAKE_CURRENT_SOURCE_DIR}/memilio/tools/config.json) 20 | -------------------------------------------------------------------------------- /pycode/memilio-generation/generator_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SciCompMod/memilio/d1b66f34d20b1f03737f2ee14d1a301ebfde8257/pycode/memilio-generation/generator_workflow.png -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Maximilian Betz 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | MEmilio main namespace package. 23 | """ 24 | 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/generation/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Maximilian Betz 5 | # 6 | # Contact: Martin J. Kuehn 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 | Main folder of the automatic code generation. 22 | """ 23 | from . import utility 24 | from .generator import Generator 25 | from .intermediate_representation import IntermediateRepresentation 26 | from .scanner import Scanner 27 | from .scanner_config import ScannerConfig 28 | from .ast import AST 29 | from .default_generation_dict import default_dict 30 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/generation/default_generation_dict.py: -------------------------------------------------------------------------------- 1 | default_dict = { 2 | "model": "Model", 3 | "agegroup": "AgeGroup", 4 | "emptystring": "", 5 | "simulation": "Simulation", 6 | "flowmodel": "FlowModel", 7 | "compartmentalmodel": "CompartmentaModel", 8 | "modelfile": "model.h", 9 | "infectionstatefile": "infection_state.h", 10 | "parameterspacefile": "parameter_space.h", 11 | "analyzeresultfile": "analyze_result.h", 12 | "namespace": "namespace", 13 | "mio": "mio" 14 | } 15 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/generation/template/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Maximilian Betz 5 | # 6 | # Contact: Martin J. Kuehn 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 | Functions and text templates used by the generator to create the target code. 22 | """ 23 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/generation/template/template_py.txt: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2024 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio ${python_module_name} model. 23 | """ 24 | 25 | from memilio._simulation_${python_module_name} import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/generation_test/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Maximilian Betz 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Test suite for generation of Python bindings from MEmilio C++ library. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/generation_test/test_data/test_oseir.py.txt: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2024 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio test_oseir model. 23 | """ 24 | 25 | from memilio._simulation_test_oseir import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-generation/memilio/tools/config.json.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "python_generation_module_path": "${memilio-python_SOURCE_DIR}/../memilio-generation", 4 | "skbuild_path_to_database": "${memilio-python_BINARY_DIR}", 5 | "libclang_library_path": "${LIBCLANG_PATH}" 6 | } 7 | 8 | ] -------------------------------------------------------------------------------- /pycode/memilio-generation/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | libclang==18.1.1 2 | importlib-resources>=1.1.0; python_version < '3.9' 3 | -------------------------------------------------------------------------------- /pycode/memilio-generation/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | 5 | from setuptools import find_packages, setup 6 | 7 | try: 8 | from skbuild import setup 9 | except ImportError: 10 | print('scikit-build is required to build from source.') 11 | print('Installation: python -m pip install scikit-build') 12 | subprocess.check_call( 13 | [sys.executable, "-m", "pip", "install", "scikit-build"]) 14 | from skbuild import setup 15 | 16 | __version__ = '0.1.0' 17 | 18 | setup( 19 | name='memilio-generation', 20 | version=__version__, 21 | author='DLR-SC', 22 | author_email='maximilian.betz@dlr.de', 23 | maintainer_email='martin.kuehn@dlr.de', 24 | url='https://github.com/SciCompMod/memilio', 25 | description='Part of MEmilio project, automatic generation of model specific python bindings.', 26 | packages=find_packages( 27 | where=os.path.dirname(os.path.abspath(__file__))), 28 | setup_requires=['cmake'], 29 | install_requires=['libclang==18.1.1', 30 | 'dataclasses', 'dataclasses_json', 'graphviz', 'importlib-resources>=1.1.0; python_version < \'3.9\''], 31 | extras_require={'dev': []}, 32 | long_description='', 33 | test_suite='memilio.generation_test', 34 | package_data={'memilio.generation': [ 35 | '../../_skbuild/*/cmake-build/compile_commands.json', '../tools/config.json']}, 36 | ) 37 | -------------------------------------------------------------------------------- /pycode/memilio-plot/memilio/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Martin J. Kuehn 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | MEmilio main namespace package. 23 | """ 24 | 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /pycode/memilio-plot/memilio/plot/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Functions to plot and visualize map data and simulation trajectories. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-plot/memilio/plot_test/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Module plot_test provides tests for the plot module. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-plot/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # dev dependencies 2 | # first support of python 3.11 3 | pyfakefs>=4.6 4 | coverage>=7.0.1 5 | # pylint 2.16 creates problem with wrapt package version 6 | pylint>=2.13.0,<2.16 7 | pylint_json2html==0.4.0 8 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | MEmilio main namespace package. 23 | """ 24 | 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/abm.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio ABM model. 23 | """ 24 | 25 | from memilio.simulation._simulation_abm import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/epidemiology/age_group.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_AGE_GROUP_H 21 | #define PYMIO_AGE_GROUP_H 22 | 23 | #include "memilio/epidemiology/age_group.h" 24 | 25 | #include "pybind11/pybind11.h" 26 | 27 | namespace pymio 28 | { 29 | 30 | template <> 31 | inline std::string pretty_name() 32 | { 33 | return "AgeGroup"; 34 | } 35 | 36 | } // namespace pymio 37 | 38 | #endif //PYMIO_AGE_GROUP_H 39 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/epidemiology/damping_sampling.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_DAMPING_SAMPLING_H 21 | #define PYMIO_DAMPING_SAMPLING_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_damping_sampling(pybind11::module_& m, std::string const& name); 29 | 30 | } // namespace pymio 31 | 32 | #endif //PYMIO_DAMPING_SAMPLING_H 33 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/epidemiology/simulation_day.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_SIMULATION_DAY_H 21 | #define PYMIO_SIMULATION_DAY_H 22 | 23 | #include "memilio/epidemiology/simulation_day.h" 24 | 25 | #include "pybind11/pybind11.h" 26 | 27 | namespace pymio 28 | { 29 | 30 | template <> 31 | inline std::string pretty_name() 32 | { 33 | return "SimulationDay"; 34 | } 35 | 36 | } // namespace pymio 37 | 38 | #endif //PYMIO_SIMULATION_DAY_H 39 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/epidemiology/uncertain_matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_UNCERTAIN_MATRIX_H 21 | #define PYMIO_UNCERTAIN_MATRIX_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_uncertain_contact_matrix(pybind11::module_& m, std::string const& name); 29 | 30 | } // namespace pymio 31 | 32 | #endif //PYMIO_UNCERTAIN_MATRIX_H 33 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/io/mobility_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_MOBILITY_IO_H 21 | #define PYMIO_MOBILITY_IO_H 22 | 23 | #include "memilio/mobility/metapopulation_mobility_instant.h" 24 | #include "memilio/io/mobility_io.h" 25 | 26 | #include "pybind11/pybind11.h" 27 | #include 28 | 29 | namespace pymio 30 | { 31 | 32 | template 33 | void bind_write_graph(pybind11::module_& m) 34 | { 35 | m.def("write_graph", 36 | [&](const mio::Graph>& graph, const std::string& directory) { 37 | int ioflags = mio::IOF_None; 38 | auto ioresult = mio::write_graph(graph, directory, ioflags); 39 | }); 40 | } 41 | 42 | } // namespace pymio 43 | 44 | #endif //PYMIO_MOBILITY_IO_H 45 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/utils/date.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_DATE_H 21 | #define PYMIO_DATE_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_date(pybind11::module_& m, std::string const& name); 29 | 30 | } // namespace pymio 31 | 32 | #endif //PYMIO_DATE_H 33 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/utils/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_LOGGING_H 21 | #define PYMIO_LOGGING_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_logging(pybind11::module& m, std::string const& name); 29 | 30 | } // namespace pymio 31 | 32 | #endif //PYMIO_LOGGING_H 33 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/utils/parameter_distributions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_PARAMETER_DISTRIBUTIONS_H 21 | #define PYMIO_PARAMETER_DISTRIBUTIONS_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_parameter_distribution(pybind11::module_& m, std::string const& name); 29 | 30 | void bind_parameter_distribution_normal(pybind11::module_& m, std::string const& name); 31 | 32 | void bind_parameter_distribution_uniform(pybind11::module_& m, std::string const& name); 33 | 34 | } // namespace pymio 35 | 36 | #endif //PYMIO_PARAMETER_DISTRIBUTIONS_H 37 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/utils/time_series.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_TIME_SERIES_H 21 | #define PYMIO_TIME_SERIES_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_time_series(pybind11::module_& m, std::string const& name); 29 | 30 | } // namespace pymio 31 | 32 | #endif //PYMIO_TIME_SERIES_H 33 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/bindings/utils/uncertain_value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020-2025 MEmilio 3 | * 4 | * Authors: Martin Siggel, Daniel Abele, Martin J. Kuehn, Jan Kleinert, Maximilian Betz 5 | * 6 | * Contact: Martin J. Kuehn 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 PYMIO_UNCERTAIN_VALUE_H 21 | #define PYMIO_UNCERTAIN_VALUE_H 22 | 23 | #include "pybind11/pybind11.h" 24 | 25 | namespace pymio 26 | { 27 | 28 | void bind_uncertain_value(pybind11::module_& m, std::string const& name); 29 | 30 | } // namespace pymio 31 | 32 | #endif //PYMIO_UNCERTAIN_VALUE_H 33 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/osecir.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio ODE SECIHURD model. 23 | """ 24 | 25 | from memilio.simulation._simulation_osecir import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/osecirvvs.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele, Maximilian Betz 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio ODE SECIRVVS model. 23 | """ 24 | 25 | from memilio.simulation._simulation_osecirvvs import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/oseir.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio ODE SEIR model. 23 | """ 24 | 25 | from memilio.simulation._simulation_oseir import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation/osir.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Python bindings for MEmilio ODE SIR model. 23 | """ 24 | 25 | from memilio.simulation._simulation_osir import * 26 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/memilio/simulation_test/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Test suite for Python bindings to MEmilio C++ library. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-simulation/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.22,<1.25 # smaller numpy versions cause a security issue, 1.25 breaks testing with pyfakefs 2 | pandas>=2.0.0 # smaller pandas versions contain a bug that sometimes prevents reading -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | MEmilio main namespace package. 23 | """ 24 | 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/surrogatemodel/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Agatha Schmidt, Henrik Zunker 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | Machine-learnt surrogate models for equation- or agent-based expert models. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/surrogatemodel/ode_secir_groups/README.md: -------------------------------------------------------------------------------- 1 | # SECIR model with multiple age groups and one damping 2 | 3 | This model is an application of the SECIR model implemented in https://github.com/DLR-SC/memilio/tree/main/cpp/models/ode_secir/ stratified by age groups using one damping to represent a change in the contact matrice. 4 | The example is based on https://github.com/DLR-SC/memilio/tree/main/pycode/examples/simulation/secir_groups.py which uses python bindings to run the underlying C++ code. 5 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/surrogatemodel/ode_secir_groups/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Agatha Schmidt, Henrik Zunker 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | A surrogate model for a SECIR model allowing for asymptomatic as well as symptomatic infection stratified by age groups. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/surrogatemodel/ode_secir_simple/README.md: -------------------------------------------------------------------------------- 1 | # Simple SECIR model 2 | 3 | This model is an very simplified application of the SECIR model implemented in https://github.com/SciCompMod/memilio/tree/main/cpp/models/ode_secir/ not stratified by age groups. 4 | The example is based on https://github.com/SciCompMod/memilio/tree/main/pycode/examples/simulation/secir_simple.py which uses python bindings to run the underlying C++ code. 5 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/surrogatemodel/ode_secir_simple/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Agatha Schmidt, Henrik Zunker 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | A surrogate model for a simple SECIR model allowing for asymptomatic as well as symptomatic infection not stratified by age groups. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/memilio/surrogatemodel_test/__init__.py: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Copyright (C) 2020-2025 MEmilio 3 | # 4 | # Authors: Daniel Abele 5 | # 6 | # Contact: Martin J. Kuehn 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 | """ 22 | The module surrogatemodel_test provides tests for the surrogatemodel module. 23 | """ 24 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # first support of python 3.11 2 | pyfakefs>=4.6 3 | coverage>=7.0.1 4 | -------------------------------------------------------------------------------- /pycode/memilio-surrogatemodel/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import find_packages, setup 4 | 5 | __version__ = '1.0.0' 6 | 7 | setup( 8 | name='memilio-surrogatemodel', version=__version__, author='DLR-SC', 9 | author_email='henrik.zunker@dlr.de', 10 | maintainer_email='martin.kuehn@dlr.de', 11 | url='https://github.com/SciCompMod/memilio', 12 | description='Part of MEmilio project, implementation of surrogate models for the existing models in MEmilio.', 13 | packages=find_packages( 14 | where=os.path.dirname(os.path.abspath(__file__))), 15 | install_requires=[ 16 | # smaller pandas versions contain a bug that sometimes prevents reading 17 | # some excel files (e.g. population or mobility data) 18 | 'pandas>=1.2.2', 19 | 'progress', 20 | # smaller numpy versions cause a security issue, 1.25 breaks testing with pyfakefs 21 | 'numpy>=1.22,<1.25', 22 | 'tensorflow', 23 | 'matplotlib', 24 | 'scikit-learn', ], 25 | extras_require={'dev': [ 26 | # first support of python 3.11 27 | 'pyfakefs>=4.6', 28 | 'coverage>=7.0.1', 29 | ], }, 30 | long_description='', test_suite='memilio.surrogatemodel_test',) 31 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.autopep8] 2 | max-line-length = 79 3 | 4 | [tool.pyright] 5 | include = ["pycode"] 6 | exclude = ["pycode/memilio-simulation"] -------------------------------------------------------------------------------- /tools/breakAdder.sh: -------------------------------------------------------------------------------- 1 | cd $(git rev-parse --show-cdup) # Change to the root of the repository 2 | git ls-files -z | # List all files in the repository 3 | while IFS= read -rd '' f; do # Read each file in the repository 4 | if [[ $f != *.(png|md|h5|txt) ]]; then 5 | tail -c1 < "$f" | read -r _ || echo >> "$f"; # Add a newline if the file has no end of line break in the last line 6 | fi 7 | done 8 | --------------------------------------------------------------------------------