pub struct PoissonProcess {
pub rate: f64,
/* private fields */
}Expand description
Homogeneous and inhomogeneous Poisson processes.
Fields§
§rate: f64Constant rate for homogeneous process.
Implementations§
Source§impl PoissonProcess
impl PoissonProcess
Sourcepub fn new(rate: f64, seed: u64) -> Self
pub fn new(rate: f64, seed: u64) -> Self
Creates a homogeneous Poisson process with constant rate.
Sourcepub fn arrivals(&self, t_end: f64) -> Vec<f64>
pub fn arrivals(&self, t_end: f64) -> Vec<f64>
Generate arrival times for a homogeneous Poisson process on [0, t_end].
Inter-arrival times are Exp(rate) distributed.
Sourcepub fn inhomogeneous_arrivals<F>(
&self,
t_end: f64,
lambda_max: f64,
lambda_fn: F,
) -> Vec<f64>
pub fn inhomogeneous_arrivals<F>( &self, t_end: f64, lambda_max: f64, lambda_fn: F, ) -> Vec<f64>
Generate arrival times for an inhomogeneous Poisson process with intensity lambda(t)
using Lewis-Shedler thinning. lambda_max must bound lambda(t) from above.
Sourcepub fn inter_arrival_times(&self, n: usize) -> Vec<f64>
pub fn inter_arrival_times(&self, n: usize) -> Vec<f64>
Inter-arrival times for a homogeneous Poisson process (exactly n arrivals).
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.