pub trait Splittable: PRNGenerator {
// Required method
fn split(&mut self) -> Self;
}
Expand description
A trait for splittable PRNGs. This means that given PRNG can split into two generators. This is different from creating a new PRNG (with a random seed), because splitting is a deterministic process.
Also this is different from cloning, since clones generally generate the same sequences of numbers (since clones have the exact same state). We want the result of splitting look like it is independent (even though in reality it is not).
It is especially useful for deterministic, multi-threaded simulations where each thread needs a PRNG.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.