pub struct MoveCountTermination<S: PlanningSolution> { /* private fields */ }Expand description
Terminates when a maximum number of moves have been evaluated.
This termination condition requires a StatisticsCollector to be attached
to the SolverScope. If no collector is attached, it will never terminate.
§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> Termination<S> for MoveCountTermination<S>
impl<S: PlanningSolution> Termination<S> for MoveCountTermination<S>
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<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