xaya / libxayagame

MIT License
21 stars 19 forks source link

Implement branching off for Random instances #90

Closed domob1812 closed 4 years ago

domob1812 commented 4 years ago

The new function Random::BranchOff will yield a separate Random instance that is seeded based on the current Random's state and some key string (so we can branch off multiple instances at a single point in time). The original state is not modified by this.

With this feature, we can split a single long sequence of random bytes into a hierarchy of sequences, so that e.g. operations can be run in parallel with their own deterministic Random instances.

This implements #88.