ArrivalBound

Trait ArrivalBound 

Source
pub trait ArrivalBound {
    // Required methods
    fn number_arrivals(&self, delta: Duration) -> usize;
    fn clone_with_jitter(&self, jitter: Duration) -> Box<dyn ArrivalBound>;

    // Provided methods
    fn steps_iter<'a>(&'a self) -> Box<dyn Iterator<Item = Duration> + 'a> { ... }
    fn brute_force_steps_iter<'a>(
        &'a self,
    ) -> Box<dyn Iterator<Item = Duration> + 'a> { ... }
}
Expand description

The main interface for models describing arrival processes.

Required Methods§

Source

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

Bound the number of jobs released in any interval of length delta.

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.

Provided Methods§

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.

More precisely, the iterator yields values of delta such that:

self.number_arrivals(delta - 1) < self.number_arrivals(delta).

Defaults to using ArrivalBound::brute_force_steps_iter, which is very slow, so implementors should override this method.

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.

Implementations on Foreign Types§

Source§

impl<'b, T: 'b + ArrivalBound + ?Sized> ArrivalBound for &'b T

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: ArrivalBound + ?Sized> ArrivalBound for Box<T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: ArrivalBound + ?Sized> ArrivalBound for Rc<T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: ArrivalBound> ArrivalBound for [T]

Source§

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

Source§

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

Source§

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

Source§

impl<T: ArrivalBound> ArrivalBound for Vec<T>

Source§

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

Source§

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

Source§

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

Implementors§