pub struct FroggyRand {
pub seed: u64,
}Fields§
§seed: u64Implementations§
Source§impl FroggyRand
impl FroggyRand
pub fn new(seed: u64) -> Self
pub fn from_hash<T: Hash>(x: T) -> Self
pub fn subrand<T: Hash>(&self, x: T) -> Self
Sourcepub fn gen_range<T: Hash>(&self, x: T, min: f32, max: f32) -> f32
pub fn gen_range<T: Hash>(&self, x: T, min: f32, max: f32) -> f32
Should be uniform in [min, max]
Sourcepub fn choose<'a, T: Hash, X>(&self, x: T, choices: &'a [X]) -> &'a X
pub fn choose<'a, T: Hash, X>(&self, x: T, choices: &'a [X]) -> &'a X
Should give a uniform random element of the slice choices.
Sourcepub fn gen_froggy<T: Hash>(&self, x: T, min: f32, max: f32, n: u32) -> f32
pub fn gen_froggy<T: Hash>(&self, x: T, min: f32, max: f32, n: u32) -> f32
I dont know what a statistic is Approx normal dist https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution
pub fn gen_usize_range<T: Hash>(&self, x: T, min: usize, max: usize) -> usize
pub fn shuffle<T: Hash, X>(&self, x: T, xs: &mut [X])
Sourcepub fn gen_perf(&self, seed: i32) -> u64
pub fn gen_perf(&self, seed: i32) -> u64
More performant gen() if the only control parameter you need is a single int.
Sourcepub fn gen_unit_perf(&self, seed: i32) -> f32
pub fn gen_unit_perf(&self, seed: i32) -> f32
More performant gen_unit() if the only control parameter you need is a single int.
Trait Implementations§
Source§impl Clone for FroggyRand
impl Clone for FroggyRand
Source§fn clone(&self) -> FroggyRand
fn clone(&self) -> FroggyRand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FroggyRand
impl Debug for FroggyRand
impl Copy for FroggyRand
Auto Trait Implementations§
impl Freeze for FroggyRand
impl RefUnwindSafe for FroggyRand
impl Send for FroggyRand
impl Sync for FroggyRand
impl Unpin for FroggyRand
impl UnwindSafe for FroggyRand
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