pub struct Pert<F>{ /* private fields */ }
Expand description
The PERT distribution PERT(min, max, mode, shape)
.
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.
§Plot
The following plot shows the PERT distribution with min = -1
, max = 1
,
and various values of mode
and shape
.
§Example
use rand_distr::{Pert, Distribution};
let d = Pert::new(0., 5.).with_mode(2.5).unwrap();
let v = d.sample(&mut rand::rng());
println!("{} is from a PERT distribution", v);
Implementations§
Trait Implementations§
Source§impl<F> Clone for Pert<F>where
F: Float + Clone,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> Clone for Pert<F>where
F: Float + Clone,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
Source§impl<F> Debug for Pert<F>where
F: Float + Debug,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> Debug for Pert<F>where
F: Float + Debug,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
Source§impl<'de, F> Deserialize<'de> for Pert<F>where
F: Float + Deserialize<'de>,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<'de, F> Deserialize<'de> for Pert<F>where
F: Float + Deserialize<'de>,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F> Distribution<F> for Pert<F>
impl<F> Distribution<F> for Pert<F>
Source§impl<F> PartialEq for Pert<F>where
F: Float + PartialEq,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> PartialEq for Pert<F>where
F: Float + PartialEq,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
Source§impl<F> Serialize for Pert<F>where
F: Float + Serialize,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> Serialize for Pert<F>where
F: Float + Serialize,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> Copy for Pert<F>where
F: Float + Copy,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> StructuralPartialEq for Pert<F>
Auto Trait Implementations§
impl<F> Freeze for Pert<F>where
F: Freeze,
impl<F> RefUnwindSafe for Pert<F>where
F: RefUnwindSafe,
impl<F> Send for Pert<F>where
F: Send,
impl<F> Sync for Pert<F>where
F: Sync,
impl<F> Unpin for Pert<F>where
F: Unpin,
impl<F> UnwindSafe for Pert<F>where
F: UnwindSafe,
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