-
Notifications
You must be signed in to change notification settings - Fork 20
1003 implement ODE SEIR metapopulation model #1273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
charlie0614
wants to merge
122
commits into
main
Choose a base branch
from
1003-implement-ode-seir-metapopulation-model
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
2d4aec1
add model with Populations with Regions
charlie0614 9416256
working SIR model without infections during commuting
charlie0614 12c9c09
add infections during commuting and age groups
charlie0614 2b883b6
read in mobility data for new model
charlie0614 d49a048
only add edges if weight is big enough
charlie0614 56c4dd4
correct age resolution
charlie0614 0efa8db
add tests
charlie0614 05e3717
add seir version of mobility model
charlie0614 f475e3c
small adjustments sir version
charlie0614 68632c5
Merge branch 'main' into 1003-implement-model-in-which-the-mobility-i…
charlie0614 f19bcf6
fixes after merge
charlie0614 6ace8cf
Renaming
charlie0614 232f705
Renaming
charlie0614 6045e1f
Set up examples for comparison
charlie0614 dfdac2d
changes for plots and corrections
charlie0614 16a07da
add improved model
charlie0614 23196bc
changes for comparing simulations
charlie0614 4193cd6
Merge branch 'main' into 1003-implement-model-in-which-the-mobility-i…
charlie0614 bfc2562
adjust plot file
charlie0614 c6b56e9
reformat py file
charlie0614 5e51d69
py file
charlie0614 0eff4d1
py file
charlie0614 3d3b007
change commuting strengths to contact matrix and implement indicator …
charlie0614 9f0fba7
return to factor 0.5
charlie0614 8908d01
read in data and time measurement 400 counties
charlie0614 06950d9
small corrections model
charlie0614 aad78a9
corrections again
charlie0614 2bdb791
change integrator in graph model
charlie0614 3c6f630
fix bug with age groups and discard transmissions during commuting
charlie0614 aa6b393
adapt structure of old model
charlie0614 e6e6d70
add computation of basis reproduction number for old model
charlie0614 649467c
add computation of basis reproduction numbers and changes for countin…
charlie0614 4239fa7
small cleanup
charlie0614 2c4de48
read in population data
charlie0614 ce86fb6
debugging artefacts
charlie0614 d378118
more cleanup and provide demo population for a number of agegroups di…
charlie0614 33a2dd5
read in contact matrices, set age resolved parameters, restructure
charlie0614 c1bd747
add bool for using population from data
charlie0614 df22f54
read in data for graph model
charlie0614 7b30779
simulation for nrw, plots and a bug fix
charlie0614 f49a497
add timing example
charlie0614 64744ab
cmake changes for timing
charlie0614 a262104
fix bug for measuring runtimes and graph timing example
charlie0614 565141c
fix bug for graph timing
charlie0614 9f36912
fix things for runtime measurements
charlie0614 ee57c8f
add plotfiles, small correction in the model and maybe optimizations
charlie0614 d8b321f
mini optimizations and small changes for timing runs
charlie0614 7dc7e44
add simulations for paper model and comparison of basic reproduction …
charlie0614 90a8d3e
small changes in plots
charlie0614 c78c996
fix runtime maybe
charlie0614 cd056b5
adjust timing examples for single age group
charlie0614 fba237a
remove prints from simulations
charlie0614 363bf85
add examples for basic reproduction numbers, and measurements of steps
charlie0614 fd2bfdd
remove synthetic population for simulation
charlie0614 33bf7a9
small improvement model c
charlie0614 24883f3
remove steps from timing example
charlie0614 4db243d
changes in plots
charlie0614 8084deb
fix bug in model b
charlie0614 9b87803
fix bug in computation of basic reproduction number as well
charlie0614 f7f3eca
add likwid test example
c74474f
new likwid example
a4fb5d7
likwid examples
172998a
optimize model
charlie0614 87faada
cleanup timing files
charlie0614 45cad87
cleanup step files
charlie0614 b0e9827
restructure for thesis submission
charlie0614 9f8334f
add system flag for boost again
charlie0614 a4351e3
rename ode_seir_mobility
charlie0614 f18a2ef
rename namespaces of metapopulation models
charlie0614 7795832
small corrections
charlie0614 995f59b
cleanup plot file results
charlie0614 32c74ad
cleanup plot file runtimes
charlie0614 629e886
change colors in plots
charlie0614 c61dac5
add shellscripts for runtimes and steps
charlie0614 6e56e39
delete redundant plot
charlie0614 d84d5a3
optimizations ode model
charlie0614 a5540f9
remove old examples
charlie0614 137feab
Merge branch 'main' into 1003-implement-model-in-which-the-mobility-i…
charlie0614 1291acd
format python file
charlie0614 d4e9341
format more python files
charlie0614 c48fc83
resolve pyupgrade issue
charlie0614 6782917
commit likwid examples
charlie0614 51a28f4
rename mio::Vector in metapop models
charlie0614 b9d0fbb
adjust to changed data structure
charlie0614 881cb5b
adjust to changed data structure
charlie0614 86fdc27
CHG: Adapt paths to new folder structure
kilianvolmer 298636a
adjustments for testing
charlie0614 d7ba3c5
add tests
charlie0614 e2f3864
continue working on tests and restructure population after commuting
charlie0614 67e6d22
add minimal metapop example
charlie0614 04f3033
Merge branch '1003-implement-model-in-which-the-mobility-is-integrate…
charlie0614 77f2d97
delete thesis examples and rename model
charlie0614 5800934
remove timing artifacts
charlie0614 ceea756
renamed model
charlie0614 99fe446
renamed model 2
charlie0614 22a94f4
remove superfluous include omp
charlie0614 fd323b0
correct setting of population after commuting
charlie0614 b2d266a
comment in tests
charlie0614 baf54e7
correct test and add compare files
charlie0614 13ec735
remove debugging artifact
charlie0614 fc94b55
add documentation
charlie0614 172c674
change error handling to include
charlie0614 8b85683
correct docu for contact matrix
charlie0614 4619fac
use existing region struct
charlie0614 e7c4def
adjust to new data structure
charlie0614 f788f7f
Merge branch 'main' into 1003-implement-ode-seir-metapopulation-model
charlie0614 6c75e60
simplify metapop
charlie0614 371f12a
adjust test
charlie0614 6649d49
fix bug
charlie0614 58856cd
go back to previous version
charlie0614 f43dba2
readjust test, write some documentation
charlie0614 043de91
Merge branch 'main' into 1003-implement-ode-seir-metapopulation-model
charlie0614 b5f1df6
specify templates
charlie0614 3aaecd9
fix bug
charlie0614 8185db7
forgot SimulationTime
charlie0614 0b812e8
forgot FP
charlie0614 3e57b61
still forgot SimulationTime
charlie0614 7861885
fix bugs in tests
charlie0614 e8d8e30
Still forgot ScalarType
charlie0614 fd60e1b
readd the tests for parameter checks
charlie0614 fdbf3a7
add license header
charlie0614 7edc608
Merge branch 'main' into 1003-implement-ode-seir-metapopulation-model
charlie0614 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #include "memilio/compartments/simulation.h" | ||
| #include "memilio/utils/custom_index_array.h" | ||
| #include "models/ode_seir_metapop/model.h" | ||
| #include "models/ode_seir_metapop/parameters.h" | ||
| #include "memilio/geography/regions.h" | ||
|
|
||
| int main() | ||
| { | ||
| const ScalarType t0 = 0.; | ||
| const ScalarType tmax = 10; | ||
| ScalarType dt = 0.1; | ||
|
|
||
| using namespace mio::oseirmetapop; | ||
|
|
||
| Model<ScalarType> model(3, 1); | ||
|
|
||
| for (size_t i = 0; i < (size_t)model.parameters.get_num_regions(); i++) { | ||
| model.populations[{mio::regions::Region(i), mio::AgeGroup(0), InfectionState::Susceptible}] = | ||
| 10000; | ||
| } | ||
|
|
||
| model.populations[{mio::regions::Region(0), mio::AgeGroup(0), InfectionState::Exposed}] += 100; | ||
| model.populations[{mio::regions::Region(0), mio::AgeGroup(0), InfectionState::Susceptible}] -= | ||
| 100; | ||
|
|
||
| Eigen::MatrixXd mobility_data_commuter(3, 3); | ||
| mobility_data_commuter << 0.4, 0.3, 0.3, 0.2, 0.7, 0.1, 0.4, 0.1, 0.5; | ||
|
|
||
| model.set_commuting_strengths(mobility_data_commuter); | ||
|
|
||
| model.parameters.template get<ContactPatterns<>>() | ||
| .get_cont_freq_mat()[0] | ||
| .get_baseline() | ||
| .setConstant(2.7); | ||
|
|
||
| model.parameters.set<TimeExposed<>>(3.335); | ||
| model.parameters.set<TimeInfected<>>(8.097612257); | ||
| model.parameters.set<TransmissionProbabilityOnContact<>>(0.07333); | ||
|
|
||
| auto result = simulate(t0, tmax, dt, model); | ||
|
|
||
| result.print_table(); | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| add_library(ode_seir_metapop | ||
| model.h | ||
| model.cpp | ||
| parameters.h | ||
| ) | ||
| target_link_libraries(ode_seir_metapop PUBLIC memilio) | ||
| target_include_directories(ode_seir_metapop PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| ) | ||
| target_compile_options(ode_seir_metapop PRIVATE ${MEMILIO_CXX_FLAGS_ENABLE_WARNING_ERRORS}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright (C) 2020-2025 MEmilio | ||
| * | ||
| * Authors: Carlotta Gerstein | ||
| * | ||
| * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef SEIRMETAPOP_INFECTIONSTATE_H | ||
| #define SEIRMETAPOP_INFECTIONSTATE_H | ||
|
|
||
| #include "models/ode_seir/infection_state.h" | ||
|
|
||
| namespace mio | ||
| { | ||
| namespace oseirmetapop | ||
| { | ||
|
|
||
| using mio::oseir::InfectionState; | ||
|
|
||
| } // namespace oseirmetapop | ||
| } // namespace mio | ||
|
|
||
| #endif // SEIRMETAPOP_INFECTIONSTATE_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * Copyright (C) 2020-2025 MEmilio | ||
| * | ||
| * Authors: Carlotta Gerstein | ||
| * | ||
| * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| #include "ode_seir_metapop/model.h" | ||
|
|
||
| namespace mio | ||
| { | ||
| namespace oseirmetapop | ||
| { | ||
|
|
||
| } // namespace oseirmetapop | ||
| } // namespace mio |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add infection_state.h for consistency? If not required, leave a comment here.