pub enum Stream {
Java(JavaRandom),
Dive(DiveStream),
}Expand description
A random stream: TLC’s generator or dive’s.
Variants§
Trait Implementations§
impl Copy for Stream
impl Eq for Stream
Source§impl RandomSource for Stream
impl RandomSource for Stream
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 Stream
Auto Trait Implementations§
impl Forget for Stream
impl Freeze for Stream
impl Move for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl UnwindSafe for Stream
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