Skip to content
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

646 use graph model with ABMs v3 #1085

Open
wants to merge 120 commits into
base: main
Choose a base branch
from

Conversation

jubicker
Copy link
Member

@jubicker jubicker commented Aug 1, 2024

Changes and Information

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

  • add node property and edge property class for ABM graph simulation
  • add model wrapper for abm that is used for ABM graph simulation and can handle persons that commute to other nodes
  • add tests for new functionality
  • add graph abm example

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).

@jubicker jubicker linked an issue Aug 1, 2024 that may be closed by this pull request
2 tasks
Copy link
Member

@DavidKerkmann DavidKerkmann left a comment

Choose a reason for hiding this comment

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

There are only a small things left to improve and one discussion item.

cpp/models/abm/model.cpp Outdated Show resolved Hide resolved
cpp/models/graph_abm/graph_abm_mobility.h Outdated Show resolved Hide resolved
cpp/models/graph_abm/graph_abmodel.h Show resolved Hide resolved
cpp/models/graph_abm/graph_abmodel.h Outdated Show resolved Hide resolved
cpp/tests/test_graph_abm.cpp Show resolved Hide resolved
@@ -438,7 +430,6 @@ class Person
.add("rnd_go_to_school_hour", m_random_goto_school_hour)
.add("mask", m_mask)
.add("compliance", m_compliance)
.add("index", m_person_index)
Copy link
Member

Choose a reason for hiding this comment

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

We might have to add the new data members to this list.

GlobalID
m_global_id; ///< Unique identifier of a person. Is only relevant in graph abm, otherwise is equal to m_person_index.
PersonId m_person_id; ///< Unique identifier of a person.
uint32_t m_rng_index;
Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. Well now instead of the person index we have the rng index.

In all current use cases, we could use the other constructor of PersonalRNG that uses the index directly from its index in the world. However, when we want to construct the PersonalRNG inside the Person or anywhere where the world is not known, this is a problem.

Further, this rng_index needs to be updated each time a person is removed and added to a world, such that it uses the correct world index and doesn't clash with the same rng_index of another person.

Let's discuss in the next meeting.

cpp/models/graph_abm/graph_abmodel.h Outdated Show resolved Hide resolved
Copy link
Member

@DavidKerkmann DavidKerkmann left a comment

Choose a reason for hiding this comment

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

Thanks! Only one point left to discuss from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class::feature A feature to be implemented for some part of the software loc::backend This issue concerns the C++ backend implementation. model::abm This issue concerns any kind of agent-based model.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use graph model with abms
4 participants