Skip to main content

MaybeTermination

Trait MaybeTermination 

Source
pub trait MaybeTermination<S: PlanningSolution, D: ScoreDirector<S>>: Send {
    // Required method
    fn should_terminate(&self, solver_scope: &SolverScope<'_, S, D>) -> bool;

    // Provided method
    fn install_inphase_limits(&self, _solver_scope: &mut SolverScope<'_, S, D>) { ... }
}
Expand description

Marker trait for termination types that can be used in Solver.

Required Methods§

Source

fn should_terminate(&self, solver_scope: &SolverScope<'_, S, D>) -> bool

Checks if the solver should terminate.

Provided Methods§

Source

fn install_inphase_limits(&self, _solver_scope: &mut SolverScope<'_, S, D>)

Installs in-phase termination limits on the solver scope.

This allows Termination conditions (step count, move count, etc.) to fire inside the phase step loop, not only between phases (T1 fix).

The default implementation is a no-op. Override for terminations that express a concrete limit via a scope field.

Implementations on Foreign Types§

Source§

impl<S: PlanningSolution, D: ScoreDirector<S>, T: Termination<S, D>> MaybeTermination<S, D> for Option<T>

Source§

fn should_terminate(&self, solver_scope: &SolverScope<'_, S, D>) -> bool

Source§

fn install_inphase_limits(&self, solver_scope: &mut SolverScope<'_, S, D>)

Implementors§