markov
markov copied to clipboard
Add seedable generate functions
For a project I need to be able to reproduce the same generation multiple times so I've implemented a way to seed the random number generator, or provide your own generator.
If there is interest in merging such functionality.
Add rand::Rng argument to States trait next() function.
Rename generate to generate_base which now takes an argument that implements rand::Rng
Rename generate_from_token to generate_from_token_base which now takes an argument that implements rand::Rng
Add new generate and generate_from_token functions that call the base functions with thread_rng().
Add the following seedable generate functions
generate_with_seed(seed: u64)generate_with_rng<R: rand::Rng>(rng: R)generate_from_token_with_seed(token: T, seed: u64)generate_from_token_with_rng<R: rand::Rng>(token: T, rng: R)
Implement linked-hash-map for predictable hashmap insertion.
Add "seedable" feature
I'd like this to be merged, as I'm also interested in this feature. How could I contribute to this happening?
The change looks fine to me, but we need to move the project over to GitHub Actions since it's still waiting for TravisCI which was killed long ago.