memilio icon indicating copy to clipboard operation
memilio copied to clipboard

1039 Add functions for the Person to choose whether to comply to mask,test and isolation

Open khoanguyen-dev opened this issue 1 year ago • 3 comments

Changes and Information

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

  • Add a file for different NPI types
  • The compliance levels are presented as a member vector in the Person class.
  • Add functions to set and get compliance levels in the Person class.
  • Add different functions to check wether a Person is complying to these NPIs.

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

  • See World::migration for apply_mask_intervention()
  • See TestingStrategy::run_strategy for apply_test_intervention()
  • See Person::get_tested for apply_isolation_intervention()

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

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

Run on (8 X 24.121 MHz CPU s) CPU Caches: L1 Data 64 KiB (x8) L1 Instruction 128 KiB (x8) L2 Unified 4096 KiB (x2) Load Average: 2.98, 4.30, 4.88

  • Main branch

Benchmark Time CPU Iterations

abm_benchmark/abm_benchmark_50k 2247 ms 2242 ms 1 abm_benchmark/abm_benchmark_100k 4691 ms 4619 ms 1 abm_benchmark/abm_benchmark_200k 8577 ms 8299 ms 1

  • 1039 branch

Benchmark Time CPU Iterations

abm_benchmark/abm_benchmark_50k 2044 ms 2040 ms 1 abm_benchmark/abm_benchmark_100k 4169 ms 4098 ms 1 abm_benchmark/abm_benchmark_200k 8243 ms 8168 ms 1

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

Closes #1039 Closes #503

khoanguyen-dev avatar May 24 '24 15:05 khoanguyen-dev

Codecov Report

Attention: Patch coverage is 98.59155% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.54%. Comparing base (cb5affd) to head (990fe6b). Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
cpp/models/abm/model.cpp 96.96% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1040      +/-   ##
==========================================
+ Coverage   96.42%   96.54%   +0.11%     
==========================================
  Files         132      135       +3     
  Lines       11061    10906     -155     
==========================================
- Hits        10666    10529     -137     
+ Misses        395      377      -18     
Flag Coverage Δ
96.54% <98.59%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 24 '24 15:05 codecov[bot]

I just noticed that the compliance vector looks very much like a parameter, especially with the getter/setter. We could think about putting it into a Person specific ParameterSet, as well as probably m_age or the random-group/hour variables; but probably in another PR.

reneSchm avatar Jun 14 '24 09:06 reneSchm

For your comment @DavidKerkmann (https://github.com/SciCompMod/memilio/pull/1040#discussion_r1678913362): I realised that the testing_scheme_2 is not actually active so at one time the second person agrees to test but it's not performed. I have now added some more comments to clarify the number of draws.

khoanguyen-dev avatar Jul 24 '24 07:07 khoanguyen-dev

@reneSchm @DavidKerkmann pls always check (and "check") reviewer boxes above.

mknaranja avatar Sep 27 '24 13:09 mknaranja