Expand description
Thread-local random number generation for simulation.
This module provides deterministic randomness through thread-local storage, enabling clean API design without passing RNG through the simulation state. Each thread maintains its own RNG state, ensuring deterministic behavior within each simulation run while supporting parallel test execution.
Functionsยง
- get_
current_ sim_ seed - Get the current simulation seed.
- reset_
sim_ rng - Reset the thread-local simulation RNG to a fresh state.
- set_
sim_ seed - Set the seed for the thread-local simulation RNG.
- sim_
random - Generate a random value using the thread-local simulation RNG.
- sim_
random_ f64 - Generate a random f64 in the range [0.0, 1.0) using the simulation RNG.
- sim_
random_ range - Generate a random value within a specified range using the thread-local simulation RNG.
- sim_
random_ range_ or_ default - Generate a random value within the given range, returning the start value if the range is empty.