pub struct DiveStream { /* private fields */ }Expand description
dive’s random stream: draw i of the stream keyed by (seed, domain, key) is
SplitMix64(k + (i + 1) * γ), with k a mix of the seed, domain and key. It is
counter based, so draw i depends only on (seed, key, i): never on which
worker evaluates it or what it evaluated before.
Implementations§
Trait Implementations§
Source§impl Clone for DiveStream
impl Clone for DiveStream
impl Copy for DiveStream
Source§impl Debug for DiveStream
impl Debug for DiveStream
impl Eq for DiveStream
Source§impl Hash for DiveStream
impl Hash for DiveStream
Source§impl PartialEq for DiveStream
impl PartialEq for DiveStream
Source§impl RandomSource for DiveStream
impl RandomSource for DiveStream
Source§fn next_bits(&mut self, bits: u32) -> i32
fn next_bits(&mut self, bits: u32) -> i32
The next
bits random bits (1..=32), as java.util.Random.next(bits):
non-negative for bits < 32, any i32 for 32.Source§fn next_double(&mut self) -> f64
fn next_double(&mut self) -> f64
Random.nextDouble(): a double in [0, 1) from 53 bits.Source§fn next_int_bounded(&mut self, bound: i32) -> Option<i32>
fn next_int_bounded(&mut self, bound: i32) -> Option<i32>
Random.nextInt(bound), or None when bound <= 0 (where Java throws
IllegalArgumentException). Draws nothing for a bad bound.Source§fn next_prime(&mut self) -> i32
fn next_prime(&mut self) -> i32
RandomGenerator.nextPrime(Random): one of TLC’s 1341 primes near 1.28
million, chosen with one nextDouble.Source§fn next_index(&mut self, size: u64) -> u64
fn next_index(&mut self, size: u64) -> u64
(int) Math.floor(nextDouble() * size): TLC’s index into a set of size
elements (SetEnumValue.randomElement, IntervalValue.randomElement,
SimulationWorker.randomState). size 0 gives 0, as in TLC, after drawing.impl StructuralPartialEq for DiveStream
Auto Trait Implementations§
impl Forget for DiveStream
impl Freeze for DiveStream
impl Move for DiveStream
impl RefUnwindSafe for DiveStream
impl Send for DiveStream
impl Sync for DiveStream
impl Unpin for DiveStream
impl UnsafeUnpin for DiveStream
impl UnwindSafe for DiveStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more