pub struct Interval {
pub id: usize,
pub earliest_start: i64,
pub latest_end: i64,
pub duration: i64,
pub demand: i64,
}Expand description
An interval (task) in a schedule
Fields§
§id: usizeInterval identifier
earliest_start: i64Earliest start time
latest_end: i64Latest end time
duration: i64Duration (fixed for now)
demand: i64Resource consumption (for cumulative)
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn new(
id: usize,
earliest_start: i64,
latest_end: i64,
duration: i64,
) -> Self
pub fn new( id: usize, earliest_start: i64, latest_end: i64, duration: i64, ) -> Self
Create a new interval
Sourcepub fn with_demand(self, demand: i64) -> Self
pub fn with_demand(self, demand: i64) -> Self
Create interval with resource demand
Sourcepub fn latest_start(&self) -> i64
pub fn latest_start(&self) -> i64
Latest possible start time
Sourcepub fn earliest_end(&self) -> i64
pub fn earliest_end(&self) -> i64
Earliest possible end time
Sourcepub fn is_feasible(&self) -> bool
pub fn is_feasible(&self) -> bool
Check if interval can be scheduled
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Interval
impl<'de> Deserialize<'de> for Interval
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl UnwindSafe for Interval
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
Mutably borrows from an owned value. Read more