Skip to content

1003 implement ODE SEIR metapopulation model#1273

Open
charlie0614 wants to merge 138 commits intomainfrom
1003-implement-ode-seir-metapopulation-model
Open

1003 implement ODE SEIR metapopulation model#1273
charlie0614 wants to merge 138 commits intomainfrom
1003-implement-ode-seir-metapopulation-model

Conversation

@charlie0614
Copy link
Copy Markdown
Member

@charlie0614 charlie0614 commented May 12, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

Replacement for #1128

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@charlie0614 charlie0614 requested a review from HenrZu December 1, 2025 18:40
Copy link
Copy Markdown
Contributor

@HenrZu HenrZu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work :) Only some comments, and then we can merge :)

@charlie0614 charlie0614 requested a review from HenrZu January 8, 2026 08:22
Copy link
Copy Markdown
Contributor

@HenrZu HenrZu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Let's get this done soon. Overall, it looks very good and is an interesting addition. However, we still need to work on the presentation and documentation :)


auto result = simulate(t0, tmax, dt, model);

result.print_table();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the insight of this output? Maaybe you can output smth more interesting, or at least label the cols.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Labelled the cols. Not sure what is more interesting than the simulation result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The labels don't change the fact that the output is way too wide. Right now, it's just pointless because you can't see anything anyway due to the formatting, just a lot of numbers. So you might as well just remove the example entirely :D

The examples should be used to demonstrate the advantage or the function of the approaach

You can also create your own time series from the results.
Maybe plot the percentage of infeted in each region? (interpolate the time points before?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

{

/********************
* define the model *
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no readme file in this dir.
I think it is important to note there, that is just an implementation of a implicit mobility scheme and that we also have a generic mobility scheme with explicit mobility (the graph-ode) for each of the available ODE models.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the readme file, but only with the two short references to the example and documentation. I also added the reference to the Graph-ODE model to the documentation as I think it should rather belong there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This directory contains a metapopulation model implementation based on an ODE formulation. "

Please add there, what the difference to the graph ODE metapopulation formulation is.
(indirect mobility, impact from others in the force of incfection)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still wondering. We actually wanted to get rid of the README's for every model completely. Then decided to use them only to reference to the actual documentation. Why don't we just collect all information in one place?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two sentences

model.parameters.set<mio::oseirmetapop::TimeInfected<>>(8.097612257);
model.parameters.set<mio::oseirmetapop::TransmissionProbabilityOnContact<>>(0.07333);

Construct an ``Eigen::MatrixXd`` of size :math:`n_{regions} \times n_{regions}` which describes the fraction of individuals commuting from one region to another. The matrix should satify the sum of each row equal to 1.0, e.g.:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theres not real "commuting from one region to another" in this model

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, but it still is what we try to model.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we model the impact from commuters in the transmission process in other patches. We do not model the commuting from one region to another :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We model the impact of that fraction commuting from one region to another

charlie0614 and others added 4 commits March 23, 2026 08:06
Co-authored-by: Henrik Zunker <69154294+HenrZu@users.noreply.github.com>
….com:SciCompMod/memilio into 1003-implement-ode-seir-metapopulation-model
@charlie0614 charlie0614 requested a review from HenrZu March 23, 2026 17:29
model.parameters.set<mio::oseirmetapop::TimeInfected<>>(8.097612257);
model.parameters.set<mio::oseirmetapop::TransmissionProbabilityOnContact<>>(0.07333);

Construct an ``Eigen::MatrixXd`` of size :math:`n_{regions} \times n_{regions}` which describes the fraction of individuals commuting from one region to another. The matrix should satify the sum of each row equal to 1.0, e.g.:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we model the impact from commuters in the transmission process in other patches. We do not model the commuting from one region to another :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement model in which the mobility is integrated into the ODEs

3 participants