pub enum Constraint {
Precedence {
before: String,
after: String,
min_delay_ms: i64,
},
Capacity {
resource_id: String,
max_capacity: i32,
},
TimeWindow {
activity_id: String,
start_ms: i64,
end_ms: i64,
},
NoOverlap {
resource_id: String,
activity_ids: Vec<String>,
},
TransitionCost {
from_category: String,
to_category: String,
cost_ms: i64,
},
Synchronize {
activity_ids: Vec<String>,
},
}Expand description
A scheduling constraint.
Constraints define the rules that a valid schedule must satisfy. The scheduler’s job is to find an assignment that satisfies all hard constraints while optimizing objectives.
Variants§
Precedence
Activity after cannot start until before finishes + min_delay_ms.
§Reference
Pinedo (2016), “Scheduling”, precedence constraints (Ch. 2.1)
Capacity
At most max_capacity activities may use resource_id simultaneously.
TimeWindow
Activity must be scheduled within [start_ms, end_ms).
NoOverlap
Listed activities cannot overlap on the given resource. This is a mutual exclusion constraint (disjunctive resource).
TransitionCost
Sequence-dependent setup time between activity categories.
When transitioning from from_category to to_category,
cost_ms additional time is incurred.
Synchronize
Listed activities must start at the same time.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn precedence(before: impl Into<String>, after: impl Into<String>) -> Self
pub fn precedence(before: impl Into<String>, after: impl Into<String>) -> Self
Creates a zero-delay precedence constraint.
Sourcepub fn precedence_with_delay(
before: impl Into<String>,
after: impl Into<String>,
delay_ms: i64,
) -> Self
pub fn precedence_with_delay( before: impl Into<String>, after: impl Into<String>, delay_ms: i64, ) -> Self
Creates a precedence constraint with a minimum delay.
Sourcepub fn capacity(resource_id: impl Into<String>, max: i32) -> Self
pub fn capacity(resource_id: impl Into<String>, max: i32) -> Self
Creates a capacity constraint.
Sourcepub fn time_window(
activity_id: impl Into<String>,
start_ms: i64,
end_ms: i64,
) -> Self
pub fn time_window( activity_id: impl Into<String>, start_ms: i64, end_ms: i64, ) -> Self
Creates a time window constraint.
Sourcepub fn no_overlap(
resource_id: impl Into<String>,
activity_ids: Vec<String>,
) -> Self
pub fn no_overlap( resource_id: impl Into<String>, activity_ids: Vec<String>, ) -> Self
Creates a no-overlap (disjunctive) constraint.
Sourcepub fn synchronize(activity_ids: Vec<String>) -> Self
pub fn synchronize(activity_ids: Vec<String>) -> Self
Creates a synchronization constraint.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more