Struct rand_distr::Pert [−][src]
The PERT distribution.
Similar to the Triangular
distribution, the PERT distribution is
parameterised by a range and a mode within that range. Unlike the
Triangular
distribution, the probability density function of the PERT
distribution is smooth, with a configurable weighting around the mode.
Example
use rand_distr::{Pert, Distribution}; let d = Pert::new(0., 5., 2.5).unwrap(); let v = d.sample(&mut rand::thread_rng()); println!("{} is from a PERT distribution", v);
Implementations
impl<N: Float> Pert<N> where
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
[src]
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
pub fn new(min: N, max: N, mode: N) -> Result<Pert<N>, PertError>
[src]
Set up the PERT distribution with defined min
, max
and mode
.
This is equivalent to calling Pert::new_shape
with shape == 4.0
.
pub fn new_with_shape(
min: N,
max: N,
mode: N,
shape: N
) -> Result<Pert<N>, PertError>
[src]
min: N,
max: N,
mode: N,
shape: N
) -> Result<Pert<N>, PertError>
Set up the PERT distribution with defined min
, max
, mode
and
shape
.
Trait Implementations
impl<N: Clone> Clone for Pert<N>
[src]
impl<N: Copy> Copy for Pert<N>
[src]
impl<N: Debug> Debug for Pert<N>
[src]
impl<N: Float> Distribution<N> for Pert<N> where
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
[src]
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
Auto Trait Implementations
impl<N> RefUnwindSafe for Pert<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Pert<N> where
N: Send,
N: Send,
impl<N> Sync for Pert<N> where
N: Sync,
N: Sync,
impl<N> Unpin for Pert<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for Pert<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,