pub struct MoveCountTermination<S: PlanningSolution> { /* private fields */ }Expand description
Terminates when a maximum number of moves have been evaluated.
§Example
use solverforge_solver::termination::MoveCountTermination;
use solverforge_core::score::SimpleScore;
use solverforge_core::domain::PlanningSolution;
#[derive(Clone)]
struct MySolution;
impl PlanningSolution for MySolution {
type Score = SimpleScore;
fn score(&self) -> Option<Self::Score> { None }
fn set_score(&mut self, _: Option<Self::Score>) {}
}
// Terminate after evaluating 100,000 moves
let termination = MoveCountTermination::<MySolution>::new(100_000);Implementations§
Source§impl<S: PlanningSolution> MoveCountTermination<S>
impl<S: PlanningSolution> MoveCountTermination<S>
Trait Implementations§
Source§impl<S: Clone + PlanningSolution> Clone for MoveCountTermination<S>
impl<S: Clone + PlanningSolution> Clone for MoveCountTermination<S>
Source§fn clone(&self) -> MoveCountTermination<S>
fn clone(&self) -> MoveCountTermination<S>
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: PlanningSolution> Debug for MoveCountTermination<S>
impl<S: PlanningSolution> Debug for MoveCountTermination<S>
Source§impl<S: PlanningSolution, D: ScoreDirector<S>> Termination<S, D> for MoveCountTermination<S>
impl<S: PlanningSolution, D: ScoreDirector<S>> Termination<S, D> for MoveCountTermination<S>
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> Freeze for MoveCountTermination<S>
impl<S> RefUnwindSafe for MoveCountTermination<S>
impl<S> Send for MoveCountTermination<S>
impl<S> Sync for MoveCountTermination<S>
impl<S> Unpin for MoveCountTermination<S>
impl<S> UnwindSafe for MoveCountTermination<S>
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