pub trait Rng {
// Required method
fn next_u64(&mut self) -> u64;
// Provided methods
fn next_u32(&mut self) -> u32 { ... }
fn next_u8(&mut self) -> u8 { ... }
fn chance(&mut self, numerator: u32, denominator: u32) -> bool { ... }
fn index(&mut self, len: usize) -> usize { ... }
}Expand description
A seeded random number generator for deterministic simulation.
All randomness in the simulation must flow through this trait. The same seed must produce the same sequence of values - this is what makes simulation runs reproducible and replayable.