pub struct ScoreCalculationCountTermination<S: PlanningSolution> { /* private fields */ }Expand description
Terminates when a maximum number of score calculations is reached.
§Example
use solverforge_solver::termination::ScoreCalculationCountTermination;
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 10,000 score calculations
let termination = ScoreCalculationCountTermination::<MySolution>::new(10_000);Implementations§
Trait Implementations§
Source§impl<S: Clone + PlanningSolution> Clone for ScoreCalculationCountTermination<S>
impl<S: Clone + PlanningSolution> Clone for ScoreCalculationCountTermination<S>
Source§fn clone(&self) -> ScoreCalculationCountTermination<S>
fn clone(&self) -> ScoreCalculationCountTermination<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 ScoreCalculationCountTermination<S>
impl<S: PlanningSolution> Debug for ScoreCalculationCountTermination<S>
Source§impl<S: PlanningSolution, D: ScoreDirector<S>> Termination<S, D> for ScoreCalculationCountTermination<S>
impl<S: PlanningSolution, D: ScoreDirector<S>> Termination<S, D> for ScoreCalculationCountTermination<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 ScoreCalculationCountTermination<S>
impl<S> RefUnwindSafe for ScoreCalculationCountTermination<S>
impl<S> Send for ScoreCalculationCountTermination<S>
impl<S> Sync for ScoreCalculationCountTermination<S>
impl<S> Unpin for ScoreCalculationCountTermination<S>
impl<S> UnwindSafe for ScoreCalculationCountTermination<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