Skip to content

1213 PAIS for ABM - #1587

Draft
DavidKerkmann wants to merge 2 commits into
mainfrom
1213-pais-for-abm
Draft

1213 PAIS for ABM#1587
DavidKerkmann wants to merge 2 commits into
mainfrom
1213-pais-for-abm

Conversation

@DavidKerkmann

Copy link
Copy Markdown
Member

Changes and Information

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

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 within the code (Doxygen) for new functionality has been added in the code.
  • Appropriate external documentation (ReadTheDocs) for new functionality has been added to the online documentation and checked in the preview.
  • 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).

@DavidKerkmann DavidKerkmann linked an issue Aug 3, 2026 that may be closed by this pull request
2 tasks

@xsaschako xsaschako left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!
Obv no tests yet, but looks fine otherwise. see remarks in comments

* @brief #Vaccination classes
* can be used as 0-based index
*/
enum class VaccinationClass : std::uint32_t

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldnt this be VaccinationCount if its Zero,OneorTwo, ThreeOrMore?
Also is it sensible to do OneOrTwo if it's only used for PAIS maybe use a different word for it,e.g. PAISVaccClass?

Eigen::VectorX<ScalarType> sum =
Eigen::VectorX<ScalarType>::Zero(Eigen::Index(mio::abm::InfectionState::Count));
auto curr_time = sim.get_time();
PRAGMA_OMP(for)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just a note also to myself but I think we should leave OMP out for loggers atm (as you did), I've only felt they produce more headache than an performance upgrade...
ill take a closer look at them if I do the performance analysis with parallelization

/**
* @brief Looger to log the TimeSeries of the number of Person%s that have an active PAIS.
*/
struct LogPAIS : mio::LogAlways {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LogCurrentlyActiveAmountOfPais?
maybe too longe but I thought about a full amount of which severity etc.

return m_infection_course.back();
}
else {
return m_infection_course[m_infection_course.size() - 2];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

short comment why this leads to the desired case and why this is true

also: name sounds like over all infections but its about the last infection course no?
Maybe a short assert so in the future, if anything changes we have no access to -1 index.

Comment thread cpp/models/abm/model.h
* @return Id of the newly created Person.
*/
PersonId add_person(const LocationId id, AgeGroup age);
PersonId add_person(const LocationId id, AgeGroup age, Sex sex = Sex::Male);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we want unisex as I think we model with that 95% of the time. (also this could be political, think "migration")

Comment thread cpp/models/abm/pais.cpp

void PAIS::update_severity(const Parameters& params, PersonalRandomNumberGenerator& rng, TimePoint t, TimeSpan dt)
{
if (severity.empty() || t > severity.back().first) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it should be t >... or? We only proceed when the last update was before t and this is describing this and we return then ( or am I stupid?)

Comment thread cpp/models/abm/person.h
* @param[in] t TimePoint of check.
* @returns Antibody level of the Person at the given TimePoint.
*/
ScalarType get_antibody_level(TimePoint t) const;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this isn't in cpp or?

* Each value give the probability that a Person with a certain PAISState transitions to another PAISState within a day.
* The first index is the from state and the second index is the to state.
*/
struct PAISTransitionMatrix {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PAISProbabilityMatrix? ;-)

Comment thread cpp/models/abm/person.cpp
}

void Person::add_new_infection(Infection&& inf)
void Person::add_new_infection(Infection&& inf, PersonalRandomNumberGenerator& rng, TimePoint t,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is arguably super often called function, maybe overload this for PAIS?

Comment thread cpp/tests/abm_helpers.h
*/
mio::abm::PersonId add_test_person(mio::abm::Model& model, mio::abm::LocationId loc_id,
mio::AgeGroup age = age_group_15_to_34,
mio::AgeGroup age = age_group_15_to_34, mio::abm::Sex sex = mio::abm::Sex::Male,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

probably better to insert as last, could be safer, since the enums are after each other?

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.

PAIS for ABM

2 participants