Skip to main content

Phase

Trait Phase 

Source
pub trait Phase<S: PlanningSolution, D: Director<S>, BestCb: ProgressCallback<S> = ()>: Send + Debug {
    // Required methods
    fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D, BestCb>);
    fn phase_type_name(&self) -> &'static str;

    // Provided methods
    fn on_solver_terminal(
        &mut self,
        _solver_scope: &mut SolverScope<'_, S, D, BestCb>,
    ) { ... }
    fn candidate_trace_plan(&self) -> CandidateTracePhasePlan { ... }
}
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 type
  • D - The score director type
  • BestCb - The best-solution callback type (default ())

Required Methods§

Source

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

Source

fn phase_type_name(&self) -> &'static str

Provided Methods§

Source

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

Runs once when the enclosing solver reaches its terminal boundary.

The solver invokes this after it has attempted every configured top-level phase and before it snapshots final statistics. It runs for ordinary completion as well as cancellation or configured termination, including phases whose Self::solve method was skipped. Implementors can use it to publish terminal-only diagnostics; the default preserves the existing phase lifecycle unchanged.

Source

fn candidate_trace_plan(&self) -> CandidateTracePhasePlan

Returns the exact resolved-plan provenance this phase can prove.

A phase that does not override this method is deliberately marked opaque. Candidate traces must never synthesize a lookalike plan for custom or foreign phases; a consumer can then reject that comparison rather than accepting a misleading fallback.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S, D, BestCb, Prev, P> Phase<S, D, BestCb> for (Prev, P)
where S: PlanningSolution, D: Director<S>, BestCb: ProgressCallback<S>, Prev: Phase<S, D, BestCb>, P: Phase<S, D, BestCb>,

Source§

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

Source§

fn phase_type_name(&self) -> &'static str

Source§

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

Source§

impl<S: PlanningSolution, D: Director<S>, BestCb: ProgressCallback<S>> Phase<S, D, BestCb> for ()

Source§

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

Source§

fn phase_type_name(&self) -> &'static str

Source§

fn candidate_trace_plan(&self) -> CandidateTracePhasePlan

Implementors§

Source§

impl<S, D, BestCb, Dec> Phase<S, D, BestCb> for ExhaustiveSearchPhase<Dec>
where S: PlanningSolution, D: Director<S>, BestCb: ProgressCallback<S>, Dec: ExhaustiveSearchDecider<S, D>,

Source§

impl<S, D, BestCb, M, P, Fo> Phase<S, D, BestCb> for ConstructionHeuristicPhase<S, M, P, Fo>
where S: PlanningSolution, S::Score: Copy, D: Director<S>, BestCb: ProgressCallback<S>, M: Move<S>, P: EntityPlacer<S, M>, Fo: ConstructionForager<S, M>,

Source§

impl<S, D, BestCb, M, Source, A, Fo> Phase<S, D, BestCb> for LocalSearchPhase<S, M, Source, A, Fo>
where S: PlanningSolution, D: Director<S>, BestCb: ProgressCallback<S>, M: Move<S>, Source: MoveCursorSource<S, M> + Debug + Send, A: Acceptor<S>, Fo: LocalSearchForager<S, M>,

Source§

impl<S, D, BestCb, PD, Part, SDF, PF, CP> Phase<S, D, BestCb> for PartitionedSearchPhase<S, PD, Part, SDF, PF, CP>
where S: PlanningSolution + 'static, D: Director<S>, BestCb: ProgressCallback<S>, PD: Director<S> + 'static, Part: SolutionPartitioner<S>, SDF: Fn(S) -> PD + Send + Sync, PF: Fn() -> CP + Send + Sync, CP: ChildPhases<S, PD> + Send,

Source§

impl<S, D, ProgressCb, P> Phase<S, D, ProgressCb> for PhaseSequence<P>
where S: PlanningSolution, D: Director<S>, ProgressCb: ProgressCallback<S>, P: Phase<S, D, ProgressCb>,

Source§

impl<S, D, ProgressCb> Phase<S, D, ProgressCb> for NoRuntimeExtensionPhase
where S: PlanningSolution, D: Director<S>, ProgressCb: ProgressCallback<S>,

Source§

impl<S, E, D, BestCb> Phase<S, D, BestCb> for ListCheapestInsertionPhase<S, E>
where S: PlanningSolution, S::Score: Copy + Ord, E: Copy + Send + Sync + 'static, D: Director<S>, BestCb: ProgressCallback<S>,

Source§

impl<S, E, D, BestCb> Phase<S, D, BestCb> for ListClarkeWrightPhase<S, E>
where S: PlanningSolution, E: Copy + Into<usize> + Send + Sync + 'static, D: Director<S>, BestCb: ProgressCallback<S>,

Source§

impl<S, E, D, BestCb> Phase<S, D, BestCb> for ListConstructionPhase<S, E>
where S: PlanningSolution, E: Copy + Send + Sync + 'static, D: Director<S>, BestCb: ProgressCallback<S>,

Source§

impl<S, E, D, BestCb> Phase<S, D, BestCb> for ListKOptPhase<S, E>
where S: PlanningSolution, E: Copy + Send + Sync + 'static, D: Director<S>, BestCb: ProgressCallback<S>,

Source§

impl<S, E, D, BestCb> Phase<S, D, BestCb> for ListRegretInsertionPhase<S, E>
where S: PlanningSolution, E: Copy + Send + Sync + 'static, D: Director<S>, BestCb: ProgressCallback<S>,

Source§

impl<S, V, D> Phase<S, D> for KOptPhase<S, V>
where S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static, D: Director<S>,