pub struct SimRandomProvider { /* private fields */ }Expand description
Random provider for simulation that uses the thread-local deterministic RNG.
This provider wraps the existing thread-local RNG infrastructure in
crate::sim::rng to provide deterministic random number generation within
the simulation environment.
The provider sets the thread-local seed during construction and then
delegates all random generation to the existing sim_random() functions.
Implementations§
Trait Implementations§
Source§impl Clone for SimRandomProvider
impl Clone for SimRandomProvider
Source§fn clone(&self) -> SimRandomProvider
fn clone(&self) -> SimRandomProvider
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimRandomProvider
impl Debug for SimRandomProvider
Source§impl RandomProvider for SimRandomProvider
impl RandomProvider for SimRandomProvider
Source§fn random<T>(&self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&self) -> Twhere
StandardUniform: Distribution<T>,
Generate a random value of type T. Read more
Source§fn random_range<T>(&self, range: Range<T>) -> Twhere
T: SampleUniform + PartialOrd,
fn random_range<T>(&self, range: Range<T>) -> Twhere
T: SampleUniform + PartialOrd,
Generate a random value within a specified range. Read more
Source§fn random_ratio(&self) -> f64
fn random_ratio(&self) -> f64
Generate a random f64 between 0.0 and 1.0. Read more
Auto Trait Implementations§
impl Freeze for SimRandomProvider
impl RefUnwindSafe for SimRandomProvider
impl Send for SimRandomProvider
impl Sync for SimRandomProvider
impl Unpin for SimRandomProvider
impl UnwindSafe for SimRandomProvider
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)