Skip to main content

Phase

Trait Phase 

Source
pub trait Phase<S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S> = ()>: Send + Debug {
    // Required methods
    fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D, BestCb>);
    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 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>)

Executes this phase.

The phase should modify the working solution in the solver scope and update the best solution when improvements are found.

Source

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

Returns the name of this phase type.

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: BestSolutionCallback<S>, Prev: Phase<S, D, BestCb>, P: Phase<S, D, BestCb>,

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).

Source§

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

Source§

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

Source§

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

Unit type implements Phase as a no-op (empty phase list).

Source§

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

Source§

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

Implementors§

Source§

impl<S, D, BestCb, Dec> Phase<S, D, BestCb> for ExhaustiveSearchPhase<Dec>

Source§

impl<S, D, BestCb, M, MS0> Phase<S, D, BestCb> for VndPhase<(MS0,), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1> Phase<S, D, BestCb> for VndPhase<(MS0, MS1), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1, MS2> Phase<S, D, BestCb> for VndPhase<(MS0, MS1, MS2), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>, MS2: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1, MS2, MS3> Phase<S, D, BestCb> for VndPhase<(MS0, MS1, MS2, MS3), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>, MS2: MoveSelector<S, M>, MS3: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1, MS2, MS3, MS4> Phase<S, D, BestCb> for VndPhase<(MS0, MS1, MS2, MS3, MS4), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>, MS2: MoveSelector<S, M>, MS3: MoveSelector<S, M>, MS4: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1, MS2, MS3, MS4, MS5> Phase<S, D, BestCb> for VndPhase<(MS0, MS1, MS2, MS3, MS4, MS5), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>, MS2: MoveSelector<S, M>, MS3: MoveSelector<S, M>, MS4: MoveSelector<S, M>, MS5: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1, MS2, MS3, MS4, MS5, MS6> Phase<S, D, BestCb> for VndPhase<(MS0, MS1, MS2, MS3, MS4, MS5, MS6), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>, MS2: MoveSelector<S, M>, MS3: MoveSelector<S, M>, MS4: MoveSelector<S, M>, MS5: MoveSelector<S, M>, MS6: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS0, MS1, MS2, MS3, MS4, MS5, MS6, MS7> Phase<S, D, BestCb> for VndPhase<(MS0, MS1, MS2, MS3, MS4, MS5, MS6, MS7), M>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS0: MoveSelector<S, M>, MS1: MoveSelector<S, M>, MS2: MoveSelector<S, M>, MS3: MoveSelector<S, M>, MS4: MoveSelector<S, M>, MS5: MoveSelector<S, M>, MS6: MoveSelector<S, M>, MS7: MoveSelector<S, M>,

Source§

impl<S, D, BestCb, M, MS, A, Fo> Phase<S, D, BestCb> for LocalSearchPhase<S, M, MS, A, Fo>
where S: PlanningSolution, D: Director<S>, BestCb: BestSolutionCallback<S>, M: Move<S>, MS: MoveSelector<S, M>, A: Acceptor<S>, Fo: LocalSearchForager<S, M>,

Source§

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

Source§

impl<S, D, BestCb, PD, Part, SDF, PF, CP> Phase<S, D, BestCb> for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
where S: PlanningSolution + 'static, D: Director<S>, BestCb: BestSolutionCallback<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, E, D, BestCb> Phase<S, D, BestCb> for ListCheapestInsertionPhase<S, E>
where S: PlanningSolution, E: Copy + PartialEq + Eq + Hash + Send + Sync + 'static, D: Director<S>, BestCb: BestSolutionCallback<S>,

Source§

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

Source§

impl<S, E, D, BestCb> Phase<S, D, BestCb> for ListRegretInsertionPhase<S, E>
where S: PlanningSolution, E: Copy + PartialEq + Eq + Hash + Send + Sync + 'static, D: Director<S>, BestCb: BestSolutionCallback<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>,