pub struct LocalSearchPhaseFactory<S, M, MS, A, Fo>where
S: PlanningSolution,
M: Move<S>,
MS: MoveSelector<S, M>,
A: Acceptor<S>,
Fo: LocalSearchForager<S, M>,{ /* private fields */ }Expand description
Zero-erasure factory for local search phases.
All types flow through generics - MoveSelector MS, Acceptor A,
and Forager Fo are all concrete types.
§Type Parameters
S- The planning solution typeM- The move typeMS- The move selector type (concrete)A- The acceptor type (concrete)Fo- The forager type (concrete)
Implementations§
Source§impl<S, M, MS, A, Fo> LocalSearchPhaseFactory<S, M, MS, A, Fo>where
S: PlanningSolution,
M: Move<S>,
MS: MoveSelector<S, M>,
A: Acceptor<S>,
Fo: LocalSearchForager<S, M>,
impl<S, M, MS, A, Fo> LocalSearchPhaseFactory<S, M, MS, A, Fo>where
S: PlanningSolution,
M: Move<S>,
MS: MoveSelector<S, M>,
A: Acceptor<S>,
Fo: LocalSearchForager<S, M>,
Sourcepub fn new(move_selector: MS, acceptor: A, forager: Fo) -> Self
pub fn new(move_selector: MS, acceptor: A, forager: Fo) -> Self
Creates a new factory with concrete components.
Sourcepub fn with_step_limit(self, limit: u64) -> Self
pub fn with_step_limit(self, limit: u64) -> Self
Sets step limit.
Source§impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, HillClimbingAcceptor, AcceptedCountForager<S>>
impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, HillClimbingAcceptor, AcceptedCountForager<S>>
Sourcepub fn hill_climbing(move_selector: MS) -> Self
pub fn hill_climbing(move_selector: MS) -> Self
Creates a hill climbing local search.
Source§impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, TabuSearchAcceptor<S>, AcceptedCountForager<S>>
impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, TabuSearchAcceptor<S>, AcceptedCountForager<S>>
Sourcepub fn tabu_search(move_selector: MS, tabu_size: usize) -> Self
pub fn tabu_search(move_selector: MS, tabu_size: usize) -> Self
Creates a tabu search local search.
Source§impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, SimulatedAnnealingAcceptor, AcceptedCountForager<S>>
impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, SimulatedAnnealingAcceptor, AcceptedCountForager<S>>
Sourcepub fn simulated_annealing(
move_selector: MS,
starting_temp: f64,
decay_rate: f64,
) -> Self
pub fn simulated_annealing( move_selector: MS, starting_temp: f64, decay_rate: f64, ) -> Self
Creates a simulated annealing local search.
Source§impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, LateAcceptanceAcceptor<S>, AcceptedCountForager<S>>
impl<S, M, MS> LocalSearchPhaseFactory<S, M, MS, LateAcceptanceAcceptor<S>, AcceptedCountForager<S>>
Sourcepub fn late_acceptance(move_selector: MS, size: usize) -> Self
pub fn late_acceptance(move_selector: MS, size: usize) -> Self
Creates a late acceptance local search.
Trait Implementations§
Source§impl<S, D, M, MS, A, Fo> PhaseFactory<S, D> for LocalSearchPhaseFactory<S, M, MS, A, Fo>where
S: PlanningSolution,
D: ScoreDirector<S>,
M: Move<S> + Send + Sync + 'static,
MS: MoveSelector<S, M> + Clone + Send + Sync + 'static,
A: Acceptor<S> + Clone + Send + Sync + 'static,
Fo: LocalSearchForager<S, M> + Clone + Send + Sync + 'static,
impl<S, D, M, MS, A, Fo> PhaseFactory<S, D> for LocalSearchPhaseFactory<S, M, MS, A, Fo>where
S: PlanningSolution,
D: ScoreDirector<S>,
M: Move<S> + Send + Sync + 'static,
MS: MoveSelector<S, M> + Clone + Send + Sync + 'static,
A: Acceptor<S> + Clone + Send + Sync + 'static,
Fo: LocalSearchForager<S, M> + Clone + Send + Sync + 'static,
Auto Trait Implementations§
impl<S, M, MS, A, Fo> Freeze for LocalSearchPhaseFactory<S, M, MS, A, Fo>
impl<S, M, MS, A, Fo> RefUnwindSafe for LocalSearchPhaseFactory<S, M, MS, A, Fo>
impl<S, M, MS, A, Fo> Send for LocalSearchPhaseFactory<S, M, MS, A, Fo>
impl<S, M, MS, A, Fo> Sync for LocalSearchPhaseFactory<S, M, MS, A, Fo>
impl<S, M, MS, A, Fo> Unpin for LocalSearchPhaseFactory<S, M, MS, A, Fo>
impl<S, M, MS, A, Fo> UnwindSafe for LocalSearchPhaseFactory<S, M, MS, A, Fo>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more