pub struct ArrivalCurvePrefix { /* private fields */ }
Expand description
An alternate representation of an arbitrary arrival curve intended primarily for input purposes.
Whereas the Curve arrival bound is based on a delta-min
representation, this variant expresses the underlying arrival
curve by means of a finite sequence of steps
and a horizon
.
This makes this representation easier to use in cases where an
arrival curve is not already given in delta-min representation.
Up to the horizon
, this representation produces exact results.
Beyond the horizon, it uses a quick, but potentially quite
pessimistic extrapolation. For better extrapolation, convert the
ArrivalCurvePrefix to a Curve (via std::convert::From) and
use its extrapolation facilities (or simply wrap it as an
ExtrapolatingCurve).
Implementations§
Source§impl ArrivalCurvePrefix
impl ArrivalCurvePrefix
Sourcepub fn new(
horizon: Duration,
steps: Vec<(Duration, usize)>,
) -> ArrivalCurvePrefix
pub fn new( horizon: Duration, steps: Vec<(Duration, usize)>, ) -> ArrivalCurvePrefix
Construct a new ArrivalCurvePrefix
from a given horizon
and a sequence of steps
.
The given sequence of steps
is a list of tuples of the form
(delta, n)
, with the meaning that the arrival curve first assumes
the value n
for the interval length delta
.
The given sequence of steps
must be contained in the
horizon and strictly monotonic in n
.
Sourcepub fn from_arrival_bound_until<T: ArrivalBound>(
ab: &T,
horizon: Duration,
) -> ArrivalCurvePrefix
pub fn from_arrival_bound_until<T: ArrivalBound>( ab: &T, horizon: Duration, ) -> ArrivalCurvePrefix
Obtain an arrival-curve prefix by recording all steps of a
given arbitrary arrival process T
until a given horizon.
The steps
vector covers all arrivals until the given horizon
.
Trait Implementations§
Source§impl ArrivalBound for ArrivalCurvePrefix
impl ArrivalBound for ArrivalCurvePrefix
Source§fn number_arrivals(&self, delta: Duration) -> usize
fn number_arrivals(&self, delta: Duration) -> usize
delta
.Source§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 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 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 Clone for ArrivalCurvePrefix
impl Clone for ArrivalCurvePrefix
Source§fn clone(&self) -> ArrivalCurvePrefix
fn clone(&self) -> ArrivalCurvePrefix
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ArrivalCurvePrefix
impl Debug for ArrivalCurvePrefix
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 ArrivalCurvePrefix
impl RefUnwindSafe for ArrivalCurvePrefix
impl Send for ArrivalCurvePrefix
impl Sync for ArrivalCurvePrefix
impl Unpin for ArrivalCurvePrefix
impl UnwindSafe for ArrivalCurvePrefix
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