pub struct LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S>,{ /* private fields */ }Expand description
Local search phase that improves an existing solution.
This phase iteratively:
- Generates candidate moves
- Evaluates each move
- Accepts/rejects based on the acceptor
- Applies the best accepted move
§Type Parameters
S- The planning solution typeM- The move type (must implementMove<S> + Clone)
§Performance
Uses MoveArena<M> for O(1) per-step cleanup instead of allocating
a new Vec each step.
Implementations§
Source§impl<S, M> LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S> + 'static,
impl<S, M> LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S> + 'static,
Sourcepub fn new(
move_selector: Box<dyn MoveSelector<S, M>>,
acceptor: Box<dyn Acceptor<S>>,
forager: Box<dyn LocalSearchForager<S, M>>,
step_limit: Option<u64>,
) -> Self
pub fn new( move_selector: Box<dyn MoveSelector<S, M>>, acceptor: Box<dyn Acceptor<S>>, forager: Box<dyn LocalSearchForager<S, M>>, step_limit: Option<u64>, ) -> Self
Creates a new local search phase.
Trait Implementations§
Source§impl<S, M> Debug for LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S>,
impl<S, M> Debug for LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S>,
Source§impl<S, M> Phase<S> for LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S>,
impl<S, M> Phase<S> for LocalSearchPhase<S, M>where
S: PlanningSolution,
M: Move<S>,
Source§fn solve(&mut self, solver_scope: &mut SolverScope<S>)
fn solve(&mut self, solver_scope: &mut SolverScope<S>)
Executes this phase. Read more
Source§fn phase_type_name(&self) -> &'static str
fn phase_type_name(&self) -> &'static str
Returns the name of this phase type.
Auto Trait Implementations§
impl<S, M> Freeze for LocalSearchPhase<S, M>
impl<S, M> !RefUnwindSafe for LocalSearchPhase<S, M>
impl<S, M> Send for LocalSearchPhase<S, M>
impl<S, M> !Sync for LocalSearchPhase<S, M>
impl<S, M> Unpin for LocalSearchPhase<S, M>where
M: Unpin,
impl<S, M> !UnwindSafe for LocalSearchPhase<S, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more