MurrellGroup / MolecularEvolution.jl

A Julia framework for developing phylogenetic models
MIT License
9 stars 4 forks source link

Random number generator as argument #7

Open bicycle1885 opened 1 year ago

bicycle1885 commented 1 year ago

There are several rand function calls and friends that depend on the global random number generator. This is okay, but it is not be a standard way of implementing simulation code because multithreaded code will need more control on random number generation for reproducibility. The standard way is passing a random number generator (RNG) as the first argument of a function, as in rand of Base. I think we also should follow this convention so that users can easily find a way to control it.