Phase

Trait Phase 

Source
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 type
  • D - The score director type

Required Methods§

Source

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.

Source

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

Returns the name of this phase type.

Implementations on Foreign Types§

Source§

impl<S, D, P1> Phase<S, D> for ((), P1)
where S: PlanningSolution, D: ScoreDirector<S>, P1: Phase<S, D>,

Source§

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

Source§

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

Source§

impl<S, D, P1, P2> Phase<S, D> for (((), P1), P2)
where S: PlanningSolution, D: ScoreDirector<S>, P1: Phase<S, D>, P2: Phase<S, D>,

Source§

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

Source§

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

Source§

impl<S, D, P1, P2, P3> Phase<S, D> for ((((), P1), P2), P3)
where S: PlanningSolution, D: ScoreDirector<S>, P1: Phase<S, D>, P2: Phase<S, D>, P3: Phase<S, D>,

Source§

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

Source§

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

Source§

impl<S, D, P1, P2, P3, P4> Phase<S, D> for (((((), P1), P2), P3), P4)
where S: PlanningSolution, D: ScoreDirector<S>, P1: Phase<S, D>, P2: Phase<S, D>, P3: Phase<S, D>, P4: Phase<S, D>,

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

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

Source§

impl<S, D, G, T, E, V> Phase<S, D> for BasicConstructionPhase<S, G, T, E, V>
where S: PlanningSolution, S::Score: Score, D: ScoreDirector<S>, G: Fn(&S, usize) -> Option<usize> + Send, T: Fn(&mut S, usize, Option<usize>) + Send, E: Fn(&S) -> usize + Send, V: Fn(&S) -> usize + Send,

Source§

impl<S, D, G, T, E, V> Phase<S, D> for BasicLocalSearchPhase<S, G, T, E, V>
where S: PlanningSolution, S::Score: Score, D: ScoreDirector<S>, G: Fn(&S, usize) -> Option<usize> + Send, T: Fn(&mut S, usize, Option<usize>) + Send, E: Fn(&S) -> usize + Send, V: Fn(&S) -> usize + Send,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<S, D, M, MS0, MS1, MS2, MS3, MS4> Phase<S, D> for VndPhase<(MS0, MS1, MS2, MS3, MS4), M>
where S: PlanningSolution, D: ScoreDirector<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, M, MS0, MS1, MS2, MS3, MS4, MS5> Phase<S, D> for VndPhase<(MS0, MS1, MS2, MS3, MS4, MS5), M>
where S: PlanningSolution, D: ScoreDirector<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, M, MS0, MS1, MS2, MS3, MS4, MS5, MS6> Phase<S, D> for VndPhase<(MS0, MS1, MS2, MS3, MS4, MS5, MS6), M>
where S: PlanningSolution, D: ScoreDirector<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, M, MS0, MS1, MS2, MS3, MS4, MS5, MS6, MS7> Phase<S, D> for VndPhase<(MS0, MS1, MS2, MS3, MS4, MS5, MS6, MS7), M>
where S: PlanningSolution, D: ScoreDirector<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, M, MS, A, Fo> Phase<S, D> for LocalSearchPhase<S, M, MS, A, Fo>
where S: PlanningSolution, D: ScoreDirector<S>, M: Move<S>, MS: MoveSelector<S, M>, A: Acceptor<S>, Fo: LocalSearchForager<S, M>,

Source§

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

Source§

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

Source§

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