The second update of the 3.6.x release of simmer, the Discrete-Event Simulator for R, is on CRAN, thus inaugurating a bi-monthly release cycle. I must thank Duncan Garmonsway (@nacnudus) for creating and now maintaining “The Bank Tutorial: Part I” vignette, Franz Fuchs for finding an important and weird memory bug (here) that prevented simmer
from freeing the allocated memory (all 3.x.x versions are affected up to this release), and the Rcpp
people for enduring me while I was helplessly searching for a solution to this. :)
My special thanks to Kevin Ushey (@kevinushey), who finally found the bug. As it happens, the bug was not in simmer
or Rcpp
but in magrittr
, and the problem is that the pipe operator, in its inscrutable magic, creates a new environment for unnamed functions (instead of the current one, as it should be), and there it stores a reference to the first object in the pipe. More or less. Further details here.
Anyway, if somebody faces the same problem, know that there is a workaround: you just need to delete that hidden reference, as simmer
does in this release to get rid of the memory issues. Happy simmering!
Minor changes and fixes:
- Update “The Bank Tutorial: Part I” vignette (@nacnudus in #90).
- Fix
trap()
’s handler cloning and associated test (#91). - Apply
select()
’spolicy
also whenresources
is a function (#92). - Accept dynamic timeouts in batches (#93).
- Change
rollback()
’s default behaviour totimes=Inf
, i.e., infinite loop (#95). - Stop and throw an error when
timeout()
returns a missing value (#96 and #97). - Fix memory management: resetting the environment was clearing but not deallocating memory (#98, fixed in #99).
- Fix object destruction: workaround for tidyverse/magrittr#146 (#98, fixed in effcb6b).