pub struct BestScoreTermination<Sc: Score> { /* private fields */ }Expand description
Terminates when the best score reaches or exceeds a target score.
This is useful when you know what score you’re aiming for (e.g., a perfect score of 0 for constraint satisfaction problems).
§Example
use solverforge_solver::termination::BestScoreTermination;
use solverforge_core::score::SimpleScore;
// Terminate when score reaches 0 (no constraint violations)
let term: BestScoreTermination<SimpleScore> = BestScoreTermination::new(SimpleScore::of(0));Implementations§
Trait Implementations§
Source§impl<Sc: Clone + Score> Clone for BestScoreTermination<Sc>
impl<Sc: Clone + Score> Clone for BestScoreTermination<Sc>
Source§fn clone(&self) -> BestScoreTermination<Sc>
fn clone(&self) -> BestScoreTermination<Sc>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, D, Sc> Termination<S, D> for BestScoreTermination<Sc>
impl<S, D, Sc> Termination<S, D> for BestScoreTermination<Sc>
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<Sc> Freeze for BestScoreTermination<Sc>where
Sc: Freeze,
impl<Sc> RefUnwindSafe for BestScoreTermination<Sc>where
Sc: RefUnwindSafe,
impl<Sc> Send for BestScoreTermination<Sc>
impl<Sc> Sync for BestScoreTermination<Sc>
impl<Sc> Unpin for BestScoreTermination<Sc>where
Sc: Unpin,
impl<Sc> UnwindSafe for BestScoreTermination<Sc>where
Sc: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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