mrc-ide / individual

R Package for individual based epidemiological models
https://mrc-ide.github.io/individual
Other
30 stars 16 forks source link

Feat/resizable #159

Closed giovannic closed 2 years ago

giovannic commented 3 years ago

Some simulations require dynamic population sizes, this is a start at implementing that support. Hopefully the first of three pull requests for resizeable variables (Double, Integer and Categorical). This one is just for ResizeableDoubleVariable.

ResizeableDoubleVariable allows clients to queue "extentions" and "shrinks", which will be applied after normal updates.

Extentions will add new individuals with an initial value. e.g.

age$queue_extend(rep(0, n_births))

It can be used to model births or importation in a population.

Shrinks can selectively remove individuals from a variable, using either a bitset or a variable. e.g.

age$queue_shrink(deaths)

It can be used to model death-like processes in a population.

Notable Changes:

codecov[bot] commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (epic/resizeable@ee487f4). Click here to learn what that means. The diff coverage is n/a.

:exclamation: Current head 3f55720 differs from pull request most recent head b7b8fee. Consider uploading reports for the commit b7b8fee to get more accurate results Impacted file tree graph

@@                Coverage Diff                 @@
##             epic/resizeable     #159   +/-   ##
==================================================
  Coverage                   ?   96.12%           
==================================================
  Files                      ?       30           
  Lines                      ?     1446           
  Branches                   ?        0           
==================================================
  Hits                       ?     1390           
  Misses                     ?       56           
  Partials                   ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ee487f4...b7b8fee. Read the comment docs.