pub struct Window<T> {
pub start: TimeUnit,
pub end: WindowEnd,
/* private fields */
}Expand description
Type representing a Window based on the papers Definition 1.
With an extra Type Parameter to indicate the Window type
Fields§
§start: TimeUnitThe Start point of the Window
end: WindowEndThe End Point of the Window
Implementations§
Source§impl<T> Window<T>
impl<T> Window<T>
Sourcepub fn new<I: Into<TimeUnit>, E: Into<WindowEnd>>(start: I, end: E) -> Self
pub fn new<I: Into<TimeUnit>, E: Into<WindowEnd>>(start: I, end: E) -> Self
Create a new Window
Sourcepub fn length(&self) -> WindowEnd
pub fn length(&self) -> WindowEnd
Calculate the window length as defined in Definition 1. of the paper
Sourcepub fn overlaps(&self, other: &Self) -> bool
pub fn overlaps(&self, other: &Self) -> bool
Calculate the overlap (Ω) of two windows as defined in Definition 2. of the paper
Sourcepub fn adjacent(&self, other: &Self) -> bool
pub fn adjacent(&self, other: &Self) -> bool
Determine if two windows are adjacent, a special case of overlapping
Used by AggregationIterator to take advantage of the relaxed invariant of CurveIterator as opposed to Curve
Sourcepub fn delta<Q: WindowType>(
supply: &Self,
demand: &Window<Q>,
) -> WindowDeltaResult<T, Q>where
T: WindowType,
pub fn delta<Q: WindowType>(
supply: &Self,
demand: &Window<Q>,
) -> WindowDeltaResult<T, Q>where
T: WindowType,
Calculate the Window delta as defined in Definition 6. of the paper
Sourcepub fn budget_group(&self, interval: TimeUnit) -> UnitNumber
pub fn budget_group(&self, interval: TimeUnit) -> UnitNumber
Calculate the Budget Group that the window falls into given a splitting interval
See Section 6.2 §3
Sourcepub fn aggregate(&self, other: &Self) -> Option<Self>
pub fn aggregate(&self, other: &Self) -> Option<Self>
Calculate the aggregation (⊕) of two windows as defined in Definition 4. of the paper