pub trait Termination<S: PlanningSolution, D: ScoreDirector<S>, BestCb: BestSolutionCallback<S> = ()>: Send + Debug {
// Required method
fn is_terminated(
&self,
solver_scope: &SolverScope<'_, S, D, BestCb>,
) -> bool;
// Provided method
fn install_inphase_limits(
&self,
_solver_scope: &mut SolverScope<'_, S, D, BestCb>,
) { ... }
}Expand description
Trait for determining when to stop solving.
§Type Parameters
S- The planning solution typeD- The score director typeBestCb- The best-solution callback type (default())
Required Methods§
Sourcefn 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.
Provided Methods§
Sourcefn 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.
This allows the termination to fire inside the phase step loop (T1 fix). The default implementation is a no-op.