ArrivalCurvePrefix

Struct ArrivalCurvePrefix 

Source
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

Source

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.

Source

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

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.
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 ArrivalCurvePrefix

Source§

fn clone(&self) -> ArrivalCurvePrefix

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 ArrivalCurvePrefix

Source§

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

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

impl From<&ArrivalCurvePrefix> for Curve

Source§

fn from(ac: &ArrivalCurvePrefix) -> Self

Converts to this type from the input type.
Source§

impl From<ArrivalCurvePrefix> for Curve

Source§

fn from(ac: ArrivalCurvePrefix) -> Self

Converts to this type from the input type.

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.