Skip to main content

batch_rng

Function batch_rng 

Source
pub fn batch_rng(master_seed: u64, batch: u64) -> SimRng
Expand description

An independent, reproducible generator for one batch of frames.

Keyed by the batch index, never by the worker, so that results do not depend on the number of threads. It is the stream (master_seed, "", 0, batch) of stream.

ยงExamples

use comnum_core::rng::batch_rng;
assert_eq!(batch_rng(42, 3).next_u64(), batch_rng(42, 3).next_u64());
assert_ne!(batch_rng(42, 3).next_u64(), batch_rng(42, 4).next_u64());