Skip to main content

LocalSearchForager

Trait LocalSearchForager 

Source
pub trait LocalSearchForager<S, M>: Send + Debug
where S: PlanningSolution, M: Move<S>,
{ // Required methods fn step_started(&mut self, best_score: S::Score, last_step_score: S::Score); fn add_move_index(&mut self, index: usize, score: S::Score); fn is_quit_early(&self) -> bool; fn pick_move_index(&mut self) -> Option<(usize, S::Score)>; }
Expand description

Trait for collecting and selecting moves in local search.

Foragers are responsible for:

  • Collecting accepted move indices during move evaluation
  • Deciding when to quit evaluating early
  • Selecting the best move index to apply

§Type Parameters

  • S - The planning solution type
  • M - The move type (for trait bounds only, moves are never stored)

Required Methods§

Source

fn step_started(&mut self, best_score: S::Score, last_step_score: S::Score)

Source

fn add_move_index(&mut self, index: usize, score: S::Score)

Source

fn is_quit_early(&self) -> bool

Source

fn pick_move_index(&mut self) -> Option<(usize, S::Score)>

Implementors§