pub struct PoissonProcess {
pub rate: f64,
}Expand description
Homogeneous Poisson process with constant rate lambda.
Fields§
§rate: f64Events per unit time.
Implementations§
Source§impl PoissonProcess
impl PoissonProcess
pub fn new(rate: f64) -> Self
Sourcepub fn next_arrival(&self, rng: &mut Rng) -> f64
pub fn next_arrival(&self, rng: &mut Rng) -> f64
Generate the next inter-arrival time (exponential distribution). T ~ Exp(rate) => T = -ln(U) / rate
Sourcepub fn arrivals(&self, rng: &mut Rng, duration: f64) -> Vec<f64>
pub fn arrivals(&self, rng: &mut Rng, duration: f64) -> Vec<f64>
Generate all arrival times in [0, duration].
Sourcepub fn count(&self, duration: f64) -> PoissonDistribution
pub fn count(&self, duration: f64) -> PoissonDistribution
Count distribution: N(t) ~ Poisson(rate * t).
Sourcepub fn counting_path(&self, rng: &mut Rng, duration: f64) -> Vec<(f64, usize)>
pub fn counting_path(&self, rng: &mut Rng, duration: f64) -> Vec<(f64, usize)>
Generate a counting process path: (time, count) pairs.
Sourcepub fn superpose(&self, other: &PoissonProcess) -> PoissonProcess
pub fn superpose(&self, other: &PoissonProcess) -> PoissonProcess
Superposition of two independent Poisson processes.
Sourcepub fn thin(&self, p: f64) -> PoissonProcess
pub fn thin(&self, p: f64) -> PoissonProcess
Thin this process with probability p to get rate * p.
Auto Trait Implementations§
impl Freeze for PoissonProcess
impl RefUnwindSafe for PoissonProcess
impl Send for PoissonProcess
impl Sync for PoissonProcess
impl Unpin for PoissonProcess
impl UnsafeUnpin for PoissonProcess
impl UnwindSafe for PoissonProcess
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.