Trait response_time_analysis::arrival::ArrivalBound
source · pub trait ArrivalBound {
fn number_arrivals(&self, delta: Duration) -> usize;
fn clone_with_jitter(&self, jitter: Duration) -> Box<dyn ArrivalBound>;
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
sourcefn number_arrivals(&self, delta: Duration) -> usize
fn number_arrivals(&self, delta: Duration) -> usize
Bound the number of jobs released in any interval of length delta
.
sourcefn clone_with_jitter(&self, jitter: Duration) -> Box<dyn ArrivalBound>
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
sourcefn steps_iter<'a>(&'a self) -> Box<dyn Iterator<Item = Duration> + 'a>
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.
sourcefn brute_force_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>
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.