Skip to main content

wowlab_engine_rng/
lib.rs

1//! Deterministic random streams and stochastic sampling primitives for the engine.
2//!
3//! ```
4//! use wowlab_engine_rng::{SimRng, proc_chance};
5//!
6//! let mut rng = SimRng::for_iteration(42, "chunk-0", 7);
7//! let mut draw = || rng.next_f64();
8//! let procced = proc_chance(&mut draw, 0.25);
9//!
10//! assert_eq!(procced, SimRng::for_iteration(42, "chunk-0", 7).next_f64() < 0.25);
11//! ```
12
13mod rng;
14mod stochastic;
15
16pub use rng::{SimRng, seed_prefix};
17pub use stochastic::{
18    AccumulatedOutcome, AccumulatedRng, RppmScaling, RppmTracker, ShuffledRng, ThresholdTracker,
19    accumulated_proc_chance, ppm_proc_chance, prd_constant, prd_constant_capped, proc_chance,
20    roll_range, roll_rppm, roll_threshold, roll_tier, shuffle_pick,
21};