pub struct BreakFeatureBuilder { /* private fields */ }
Expand description
Provides a way to build a feature to schedule an optional break. Here, optional means that break sometimes can be skipped due to constraint violations or suboptimal search path in solution space.
Implementations§
Source§impl BreakFeatureBuilder
impl BreakFeatureBuilder
Sourcepub fn set_violation_code(self, violation_code: ViolationCode) -> Self
pub fn set_violation_code(self, violation_code: ViolationCode) -> Self
Sets constraint violation code which is used to report back the reason of job’s unassignment. If not set, default violation code is used.
Sourcepub fn set_is_break_single<F>(self, func: F) -> Self
pub fn set_is_break_single<F>(self, func: F) -> Self
Sets a function which specifies whether a given single job can be considered as a break job.
Sourcepub fn set_policy<F>(self, func: F) -> Self
pub fn set_policy<F>(self, func: F) -> Self
Sets a break policy. If not set, then BreakPolicy::SkipIfNoIntersection is used.
Sourcepub fn set_belongs_to_route<F>(self, func: F) -> Self
pub fn set_belongs_to_route<F>(self, func: F) -> Self
Sets a function which specifies whether a given route can serve a given break. This function should return false, if the job is not break. If not set, any break job can be assigned to any route.
Sourcepub fn build(self) -> GenericResult<Feature>
pub fn build(self) -> GenericResult<Feature>
Builds a optional break feature.
Auto Trait Implementations§
impl Freeze for BreakFeatureBuilder
impl !RefUnwindSafe for BreakFeatureBuilder
impl Send for BreakFeatureBuilder
impl Sync for BreakFeatureBuilder
impl Unpin for BreakFeatureBuilder
impl !UnwindSafe for BreakFeatureBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more