pub struct TimePreference {
pub category: String,
pub level: ScoreLevel,
pub entity: EntityRef,
pub windows: Vec<(TimeWindow, i64)>,
}Expand description
A soft preference of one entity for or against time windows — “rather not on Monday morning”, “ideally the first two periods”.
Every unit of time the entity occupies inside a window scores that window’s value: positive
values are wanted and raise the score, negative ones are unwanted and lower it. A resource
counts its requirement’s units, a participant counts once. Windows of one preference should
not overlap; where they do, both values apply. Which windows exist — every day of every cycle
week, say — is the caller’s business: schedulr only measures occupancy against them.
Fields§
§category: StringStable category shown in Solution::score_components.
level: ScoreLevel§entity: EntityRefResource, participant or single activity whose occupancy is measured.
windows: Vec<(TimeWindow, i64)>(window, value per occupied unit).
Implementations§
Source§impl TimePreference
impl TimePreference
pub fn new( category: impl Into<String>, level: ScoreLevel, entity: EntityRef, windows: Vec<(TimeWindow, i64)>, ) -> Self
Trait Implementations§
Source§impl Clone for TimePreference
impl Clone for TimePreference
Source§impl Debug for TimePreference
impl Debug for TimePreference
impl Eq for TimePreference
Source§impl PartialEq for TimePreference
impl PartialEq for TimePreference
impl StructuralPartialEq for TimePreference
Auto Trait Implementations§
impl Freeze for TimePreference
impl RefUnwindSafe for TimePreference
impl Send for TimePreference
impl Sync for TimePreference
impl Unpin for TimePreference
impl UnsafeUnpin for TimePreference
impl UnwindSafe for TimePreference
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