pub struct Noise { /* private fields */ }
Expand description
Provides way to generate some noise to floating point value.
Implementations§
source§impl Noise
impl Noise
sourcepub fn new_with_addition(
probability: f64,
range: (f64, f64),
random: Arc<dyn Random + Send + Sync>
) -> Noise
pub fn new_with_addition( probability: f64, range: (f64, f64), random: Arc<dyn Random + Send + Sync> ) -> Noise
Creates a new instance of Noise
which will add some noise in given range
to the target value: value = value + value * sample_from(range)
sourcepub fn new_with_ratio(
probability: f64,
range: (f64, f64),
random: Arc<dyn Random + Send + Sync>
) -> Noise
pub fn new_with_ratio( probability: f64, range: (f64, f64), random: Arc<dyn Random + Send + Sync> ) -> Noise
Creates a new instance of Noise
which will apply noise by multiplying target value
by value from given range: value = value * sample_from(range)
sourcepub fn generate_multi<'a, Iter>(
&'a self,
values: Iter
) -> impl Iterator<Item = f64> + 'a
pub fn generate_multi<'a, Iter>( &'a self, values: Iter ) -> impl Iterator<Item = f64> + 'a
Generates an iterator with noise.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Noise
impl Send for Noise
impl Sync for Noise
impl Unpin for Noise
impl !UnwindSafe for Noise
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