pub struct MaximumDailyLoad {
pub entity: EntityRef,
pub limit: u64,
pub penalty: Option<SoftPenalty>,
}Expand description
Hard cap on the total occupied duration one entity may accumulate inside a single period bucket (e.g. one day): “sum of occupied duration per resource/participant and period bucket <= limit”.
Buckets come from the ScheduleTemplate — one bucket per DayTemplate, repeated over the
cycle; without a schedule template the whole modeled horizon counts as a single bucket. The
limit is applied separately to each entity’s assignments: a resource counts the activities that
require it (weighted by the requirement’s units), a participant counts the activities it
attends.
With a SoftPenalty (see Self::soft) the cap becomes a preference: every unit over the
limit costs the penalty’s weight instead of ruling the assignment out.
Fields§
§entity: EntityRefResource or participant the limit applies to.
limit: u64Maximum occupied duration per bucket.
penalty: Option<SoftPenalty>None: a hard rule. Some: a preference scored at the penalty’s level.
Implementations§
Source§impl MaximumDailyLoad
impl MaximumDailyLoad
pub const fn new(entity: EntityRef, limit: u64) -> Self
Sourcepub fn soft(self, penalty: SoftPenalty) -> Self
pub fn soft(self, penalty: SoftPenalty) -> Self
Turns the cap into a preference: each unit over the limit costs penalty.weight.