pub struct FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,{ /* private fields */ }Expand description
A forager that picks the first accepted move that improves on the last step’s score.
Once a move with a score strictly better than the previous step is found, the forager quits immediately and selects that move. If no such move exists, it falls back to the best among all accepted moves.
Implementations§
Source§impl<S> FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
impl<S> FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
Trait Implementations§
Source§impl<S> Clone for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
impl<S> Clone for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
Source§impl<S> Debug for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
impl<S> Debug for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
Source§impl<S> Default for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
impl<S> Default for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
Source§impl<S, M> LocalSearchForager<S, M> for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
M: Move<S>,
impl<S, M> LocalSearchForager<S, M> for FirstLastStepScoreImprovingForager<S>where
S: PlanningSolution,
M: Move<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 FirstLastStepScoreImprovingForager<S>
impl<S> RefUnwindSafe for FirstLastStepScoreImprovingForager<S>
impl<S> Send for FirstLastStepScoreImprovingForager<S>
impl<S> Sync for FirstLastStepScoreImprovingForager<S>
impl<S> Unpin for FirstLastStepScoreImprovingForager<S>
impl<S> UnsafeUnpin for FirstLastStepScoreImprovingForager<S>
impl<S> UnwindSafe for FirstLastStepScoreImprovingForager<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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