pub trait Phase<S: PlanningSolution, D: ScoreDirector<S>>: Send + Debug {
// Required methods
fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D>);
fn phase_type_name(&self) -> &'static str;
}Expand description
A phase of the solving process.
Phases are executed in sequence by the solver. Each phase has its own strategy for exploring or constructing solutions.
§Type Parameters
S- The planning solution typeD- The score director type
Required Methods§
Sourcefn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D>)
fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D>)
Executes this phase.
The phase should modify the working solution in the solver scope and update the best solution when improvements are found.
Sourcefn phase_type_name(&self) -> &'static str
fn phase_type_name(&self) -> &'static str
Returns the name of this phase type.
Implementations on Foreign Types§
Source§impl<S, D, Prev, P> Phase<S, D> for (Prev, P)
Blanket impl: any (Prev, P) where both implement Phase is itself a Phase.
impl<S, D, Prev, P> Phase<S, D> for (Prev, P)
Blanket impl: any (Prev, P) where both implement Phase is itself a Phase.
Combined with the () no-op impl, this covers all nested tuple arities:
((), P1)— single phase(((), P1), P2)— two phases((((), P1), P2), P3)— three phases, etc.
Built by SolverFactoryBuilder::with_phase() which wraps (self.phases, phase).
fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D>)
fn phase_type_name(&self) -> &'static str
Source§impl<S: PlanningSolution, D: ScoreDirector<S>> Phase<S, D> for ()
Unit type implements Phase as a no-op (empty phase list).
impl<S: PlanningSolution, D: ScoreDirector<S>> Phase<S, D> for ()
Unit type implements Phase as a no-op (empty phase list).