pub enum AnyForager<S: PlanningSolution> {
AcceptedCount(AcceptedCountForager<S>),
FirstAccepted(FirstAcceptedForager<S>),
BestScore(BestScoreForager<S>),
BestScoreImproving(FirstBestScoreImprovingForager<S>),
LastStepScoreImproving(FirstLastStepScoreImprovingForager<S>),
}Expand description
A concrete enum over all built-in forager types.
Returned by ForagerBuilder::build to avoid Box<dyn LocalSearchForager<S, M>>.
Dispatches to the inner forager via match — fully monomorphized.
Variants§
AcceptedCount(AcceptedCountForager<S>)
Collects up to N accepted moves, picks the best.
FirstAccepted(FirstAcceptedForager<S>)
Picks the first accepted move.
BestScore(BestScoreForager<S>)
Evaluates all moves, picks the best score overall.
BestScoreImproving(FirstBestScoreImprovingForager<S>)
Picks the first move that improves on the all-time best.
LastStepScoreImproving(FirstLastStepScoreImprovingForager<S>)
Picks the first move that improves on the last step’s score.
Trait Implementations§
Source§impl<S: PlanningSolution> Debug for AnyForager<S>
impl<S: PlanningSolution> Debug for AnyForager<S>
Source§impl<S: PlanningSolution, M: Move<S>> LocalSearchForager<S, M> for AnyForager<S>
impl<S: PlanningSolution, M: Move<S>> LocalSearchForager<S, M> for AnyForager<S>
Source§fn step_started(&mut self, best_score: S::Score, last_step_score: S::Score)
fn step_started(&mut self, best_score: S::Score, last_step_score: S::Score)
Called at the start of each step to reset state. Read more
Source§fn add_move_index(&mut self, index: usize, score: S::Score)
fn add_move_index(&mut self, index: usize, score: S::Score)
Adds an accepted move index to the forager. Read more
Source§fn is_quit_early(&self) -> bool
fn is_quit_early(&self) -> bool
Returns true if the forager has collected enough moves and
wants to stop evaluating more.
Auto Trait Implementations§
impl<S> Freeze for AnyForager<S>
impl<S> RefUnwindSafe for AnyForager<S>
impl<S> Send for AnyForager<S>
impl<S> Sync for AnyForager<S>
impl<S> Unpin for AnyForager<S>
impl<S> UnsafeUnpin for AnyForager<S>
impl<S> UnwindSafe for AnyForager<S>
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