pub struct Curve { /* private fields */ }
Expand description
An arrival curve (also commonly called an “upper event arrival curve” η+) that can describe arbitrarily bursty sporadic arrival processes.
As is common, the arrival curve is defined by a finite delta-min vector that describes the minimum interval length in which a certain number of jobs may arrive.
Implementations§
Source§impl Curve
impl Curve
Sourcepub fn new(delta_min_prefix: Vec<Duration>) -> Curve
pub fn new(delta_min_prefix: Vec<Duration>) -> Curve
Construct a new arrival curve.
The delta_min_prefix
is the delta-min prefix describing
the arrival curve. Each element of the vector gives the
minimum interval length in which a corresponding number of
jobs may arrive.
Convention: we do not store the mininum distance for 0
and 1 jobs. So the min_distance
vector at offset 0 contains
the minimum separation of two jobs, the min_distance
vector
at offset 1 contains the length of the shortest interval in
which three jobs arrive, and so on.
Sourcepub fn from_arrival_bound_until<T: ArrivalBound>(
ab: &T,
horizon: Duration,
) -> Curve
pub fn from_arrival_bound_until<T: ArrivalBound>( ab: &T, horizon: Duration, ) -> Curve
Obtain an arrival curve by inferring a delta-min vector from
any given arrival process T
.
The delta-min vector is chosen such that it covers all
arrivals until the given horizon
.
Sourcepub fn from_arrival_bound<T: ArrivalBound>(ab: &T, up_to_njobs: usize) -> Curve
pub fn from_arrival_bound<T: ArrivalBound>(ab: &T, up_to_njobs: usize) -> Curve
Obtain an arrival curve by inferring a delta-min vector from
any given arrival process T
.
The delta-min vector is chosen such that it covers at least
up_to_njobs
job arrivals.
Sourcepub fn from_trace(
arrival_times: impl Iterator<Item = Offset>,
prefix_jobs: usize,
) -> Curve
pub fn from_trace( arrival_times: impl Iterator<Item = Offset>, prefix_jobs: usize, ) -> Curve
Obtain an arrival curve by inferring a delta-min prefix from a given trace of arrival events, expressed as the offset of the event from a reference time zero.
The resultant delta-min vector will consist of prefix_jobs
entries (if there are a sufficient number of arrivals in the
trace).
Sourcepub fn extrapolate(&mut self, horizon: Duration)
pub fn extrapolate(&mut self, horizon: Duration)
Extend the underlying delta-min prefix by exploiting the
subadditivity
of proper arrival curves until the delta-min prefix covers
intervals of length horizon
.
Sourcepub fn extrapolate_steps(&mut self, n: usize)
pub fn extrapolate_steps(&mut self, n: usize)
Extend the underlying delta-min prefix by exploiting the
subadditivity
of proper arrival curves by n
elements.
Sourcepub fn extrapolate_with_bound(&mut self, bound: (Duration, usize))
pub fn extrapolate_with_bound(&mut self, bound: (Duration, usize))
Extend the underlying delta-min prefix by one element while
exploiting both the
subadditivity
of proper arrival curves and the provided bound on the next
step. The bound is a tuple (delta
, njobs
), where njobs
must be the element that the underlying delta-min vector is
extrapolated to.
Sourcepub fn min_distance(&self, n: usize) -> Duration
pub fn min_distance(&self, n: usize) -> Duration
Return a lower bound on the length of an interval in which
n
arrival events occur.
Note: does not extrapolate, so extremely pessimistic if n
exceeds the length of the internal minimum-distance prefix.
Trait Implementations§
Source§impl ArrivalBound for Curve
impl ArrivalBound for Curve
Source§fn number_arrivals(&self, delta: Duration) -> usize
fn number_arrivals(&self, delta: Duration) -> usize
delta
.Source§fn steps_iter<'a>(&'a self) -> Box<dyn Iterator<Item = Duration> + 'a>
fn steps_iter<'a>(&'a self) -> Box<dyn Iterator<Item = Duration> + 'a>
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 moreSource§fn clone_with_jitter(&self, jitter: Duration) -> Box<dyn ArrivalBound>
fn clone_with_jitter(&self, jitter: Duration) -> Box<dyn ArrivalBound>
dyn
object because the underlying
type may change.Source§fn 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>
Source§impl From<&ArrivalCurvePrefix> for Curve
impl From<&ArrivalCurvePrefix> for Curve
Source§fn from(ac: &ArrivalCurvePrefix) -> Self
fn from(ac: &ArrivalCurvePrefix) -> Self
Source§impl From<ArrivalCurvePrefix> for Curve
impl From<ArrivalCurvePrefix> for Curve
Source§fn from(ac: ArrivalCurvePrefix) -> Self
fn from(ac: ArrivalCurvePrefix) -> Self
Auto Trait Implementations§
impl Freeze for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnwindSafe for Curve
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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