Struct vrp_core::utils::DefaultRandom
source · [−]pub struct DefaultRandom { /* private fields */ }Expand description
A default random implementation.
Implementations
sourceimpl DefaultRandom
impl DefaultRandom
sourcepub fn new_with_seed(seed: u64) -> DefaultRandom
pub fn new_with_seed(seed: u64) -> DefaultRandom
Creates a new instance DefaultRandom with seed.
Trait Implementations
sourceimpl Default for DefaultRandom
impl Default for DefaultRandom
sourcepub fn default() -> DefaultRandom
pub fn default() -> DefaultRandom
Returns the “default value” for a type. Read more
sourceimpl Random for DefaultRandom
impl Random for DefaultRandom
sourcefn uniform_int(&self, min: i32, max: i32) -> i32
fn uniform_int(&self, min: i32, max: i32) -> i32
Produces integral random value, uniformly distributed on the closed interval [min, max]
sourcefn uniform_real(&self, min: f64, max: f64) -> f64
fn uniform_real(&self, min: f64, max: f64) -> f64
Produces real random value, uniformly distributed on the closed interval [min, max)
sourcefn is_head_not_tails(&self) -> bool
fn is_head_not_tails(&self) -> bool
Flips a coin and returns true if it is “heads”, false otherwise.
Auto Trait Implementations
impl RefUnwindSafe for DefaultRandom
impl Send for DefaultRandom
impl Sync for DefaultRandom
impl Unpin for DefaultRandom
impl UnwindSafe for DefaultRandom
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more