pub struct Random<A: Algorithm> {
pub distribution: Distribution,
/* private fields */
}Expand description
pseudorandom number generator toolkit
Fields§
§distribution: DistributionDecides the distribution used for generating random numbers
Implementations§
Source§impl Random<MersenneTwister>
impl Random<MersenneTwister>
Sourcepub fn new_mt_from_seed(seed: u32) -> Self
pub fn new_mt_from_seed(seed: u32) -> Self
Returns a new Random using the Mersenne Twister algorithm, seeded with the given seed.
Source§impl Random<ComplementaryMultiplyWithCarry>
impl Random<ComplementaryMultiplyWithCarry>
Sourcepub fn new_cmwc() -> Self
pub fn new_cmwc() -> Self
Returns a new Random using the Complementary Multiply With Carry algorithm.
Sourcepub fn new_cmwc_from_seed(seed: u32) -> Self
pub fn new_cmwc_from_seed(seed: u32) -> Self
Returns a new Random using the Complementary Multiply With Carry algorithm,
seeded with the given seed.
Trait Implementations§
Source§impl<A: Algorithm> Rng for Random<A>
impl<A: Algorithm> Rng for Random<A>
Source§fn get_i32_mean(&mut self, min: i32, max: i32, mean: i32) -> i32
fn get_i32_mean(&mut self, min: i32, max: i32, mean: i32) -> i32
Get an
i32 between min and max, using gaussian distribution with the given mean.Auto Trait Implementations§
impl<A> Freeze for Random<A>where
A: Freeze,
impl<A> RefUnwindSafe for Random<A>where
A: RefUnwindSafe,
impl<A> Send for Random<A>where
A: Send,
impl<A> Sync for Random<A>where
A: Sync,
impl<A> Unpin for Random<A>where
A: Unpin,
impl<A> UnwindSafe for Random<A>where
A: UnwindSafe,
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