pub trait SimpleSample {
// Required method
fn randomize(&mut self);
// Provided methods
fn simple_sample<F>(&mut self, times: usize, f: F)
where F: FnMut(&Self) { ... }
fn simple_sample_vec<F, G>(&mut self, times: usize, f: F) -> Vec<G>
where F: FnMut(&Self) -> G { ... }
}
Expand description
For easy sampling of your ensemble
Required Methods§
Sourcefn randomize(&mut self)
fn randomize(&mut self)
§Randomizes self according to model
- this is intended for creation of initial sample
- used in
simple_sample
andsimple_sample_vec
Provided Methods§
Sourcefn simple_sample<F>(&mut self, times: usize, f: F)where
F: FnMut(&Self),
fn simple_sample<F>(&mut self, times: usize, f: F)where
F: FnMut(&Self),
§do the following times
times:
f(self)
self.randomize()
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.