pub enum AnyTermination<S: PlanningSolution, D: Director<S>> {
Default(OrTermination<(TimeTermination,), S, D>),
WithBestScore(OrTermination<(TimeTermination, BestScoreTermination<S::Score>), S, D>),
WithStepCount(OrTermination<(TimeTermination, StepCountTermination), S, D>),
WithUnimprovedStep(OrTermination<(TimeTermination, UnimprovedStepCountTermination<S>), S, D>),
WithUnimprovedTime(OrTermination<(TimeTermination, UnimprovedTimeTermination<S>), S, D>),
}Expand description
Monomorphized termination enum for config-driven solver configurations.
Avoids repeated branching across termination overloads by capturing the selected termination variant upfront.
Variants§
Default(OrTermination<(TimeTermination,), S, D>)
WithBestScore(OrTermination<(TimeTermination, BestScoreTermination<S::Score>), S, D>)
WithStepCount(OrTermination<(TimeTermination, StepCountTermination), S, D>)
WithUnimprovedStep(OrTermination<(TimeTermination, UnimprovedStepCountTermination<S>), S, D>)
WithUnimprovedTime(OrTermination<(TimeTermination, UnimprovedTimeTermination<S>), S, D>)
Trait Implementations§
Source§impl<S: PlanningSolution, D: Director<S>> Debug for AnyTermination<S, D>
impl<S: PlanningSolution, D: Director<S>> Debug for AnyTermination<S, D>
Source§impl<S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>> Termination<S, D, BestCb> for AnyTermination<S, D>
impl<S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>> Termination<S, D, BestCb> for AnyTermination<S, D>
Source§fn is_terminated(&self, solver_scope: &SolverScope<'_, S, D, BestCb>) -> bool
fn is_terminated(&self, solver_scope: &SolverScope<'_, S, D, BestCb>) -> bool
Returns true if solving should terminate.
Source§fn install_inphase_limits(
&self,
solver_scope: &mut SolverScope<'_, S, D, BestCb>,
)
fn install_inphase_limits( &self, solver_scope: &mut SolverScope<'_, S, D, BestCb>, )
Installs this termination’s limit as an in-phase limit on the solver scope. Read more
Auto Trait Implementations§
impl<S, D> !Freeze for AnyTermination<S, D>
impl<S, D> !RefUnwindSafe for AnyTermination<S, D>
impl<S, D> Send for AnyTermination<S, D>
impl<S, D> !Sync for AnyTermination<S, D>
impl<S, D> Unpin for AnyTermination<S, D>
impl<S, D> UnsafeUnpin for AnyTermination<S, D>
impl<S, D> UnwindSafe for AnyTermination<S, D>
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> 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