pub struct BestScoreFeasibleTermination<S, F>{ /* private fields */ }Expand description
Terminates when the best score becomes feasible.
A score is considered feasible when it meets a feasibility check defined by a user-provided function. For HardSoftScore, this typically means hard score >= 0 (no hard constraint violations).
§Zero-Erasure Design
The feasibility check function F is stored as a concrete generic type
parameter, eliminating virtual dispatch overhead when checking termination.
Implementations§
Source§impl<S, F> BestScoreFeasibleTermination<S, F>
impl<S, F> BestScoreFeasibleTermination<S, F>
Source§impl<S: PlanningSolution> BestScoreFeasibleTermination<S, fn(&S::Score) -> bool>
impl<S: PlanningSolution> BestScoreFeasibleTermination<S, fn(&S::Score) -> bool>
Sourcepub fn score_at_least_zero() -> Self
pub fn score_at_least_zero() -> Self
Creates a termination that checks if score >= zero.
This is the typical feasibility check for most score types.
Trait Implementations§
Source§impl<S, F> Debug for BestScoreFeasibleTermination<S, F>
impl<S, F> Debug for BestScoreFeasibleTermination<S, F>
Source§impl<S, D, F> Termination<S, D> for BestScoreFeasibleTermination<S, F>
impl<S, D, F> Termination<S, D> for BestScoreFeasibleTermination<S, F>
Source§fn is_terminated(&self, solver_scope: &SolverScope<'_, S, D>) -> bool
fn is_terminated(&self, solver_scope: &SolverScope<'_, S, D>) -> bool
Returns true if solving should terminate.
Auto Trait Implementations§
impl<S, F> Freeze for BestScoreFeasibleTermination<S, F>where
F: Freeze,
impl<S, F> RefUnwindSafe for BestScoreFeasibleTermination<S, F>where
F: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, F> Send for BestScoreFeasibleTermination<S, F>
impl<S, F> Sync for BestScoreFeasibleTermination<S, F>
impl<S, F> Unpin for BestScoreFeasibleTermination<S, F>
impl<S, F> UnwindSafe for BestScoreFeasibleTermination<S, F>where
F: UnwindSafe,
S: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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