ApproximatedPoisson

Struct ApproximatedPoisson 

Source
pub struct ApproximatedPoisson { /* private fields */ }
Expand description

A finite approximation of a Poisson process with bounded probability of under-approximation.

A Poisson arrival process as modeled by Poisson cannot comply with the the ArrivalBound interface as there is a diminishing, but non-zero probability for an arbitrary large number of arrivals to occur in any interval. The ApproximatedPoisson process implements the ArrivalBound interface with a configurable residual probability of excessive arrivals.

The bound number_arrivals ensures that the claimed number of job arrivals are not exceeded with probability at least 1 - epsilon.

Note: the implementation is intended to be simple, but not necessarily fast, so it’s best to convert it into an arrival curve before use if performance is of interest.

Implementations§

Source§

impl ApproximatedPoisson

Source

pub fn new(lambda: f64, epsilon: f64) -> Self

Construct a new approximated Poisson arrival process with mean arrival rate lambda and under-approximation bound epsilon.

Trait Implementations§

Source§

impl ArrivalBound for ApproximatedPoisson

Source§

fn number_arrivals(&self, delta: Duration) -> usize

Bound the number of jobs released in any interval of length delta with probability 1 - epsilon.

Source§

fn clone_with_jitter(&self, jitter: Duration) -> Box<dyn ArrivalBound>

Clone the arrival model while accounting for added release jitter. Returns a boxed dyn object because the underlying type may change.
Source§

fn steps_iter<'a>(&'a self) -> Box<dyn Iterator<Item = Duration> + 'a>

Yield the sequence of interval lengths (i.e., values of delta in ArrivalBound::number_arrivals) for which the arrival bound “steps”, i.e., where it shows an increase in the number of released jobs. Read more
Source§

fn brute_force_steps_iter<'a>( &'a self, ) -> Box<dyn Iterator<Item = Duration> + 'a>

Same semantics as ArrivalBound::steps_iter, but provided by a default implementation in the most naive way possible. Avoid if performance is at all important.
Source§

impl Clone for ApproximatedPoisson

Source§

fn clone(&self) -> ApproximatedPoisson

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ApproximatedPoisson

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for ApproximatedPoisson

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.