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, Sc> Termination<S> for BestScoreTermination<Sc>where
S: PlanningSolution<Score = Sc>,
Sc: Score,
impl<S, Sc> Termination<S> for BestScoreTermination<Sc>where
S: PlanningSolution<Score = Sc>,
Sc: Score,
Source§fn is_terminated(&self, solver_scope: &SolverScope<S>) -> bool
fn is_terminated(&self, solver_scope: &SolverScope<S>) -> 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