pub trait LocalSearchForager<S: PlanningSolution, M: Move<S>>: Send + Debug {
// Required methods
fn step_started(&mut self);
fn add_move(&mut self, m: M, score: S::Score);
fn is_quit_early(&self) -> bool;
fn pick_move(&mut self) -> Option<(M, S::Score)>;
}Expand description
Trait for collecting and selecting moves in local search.
Foragers are responsible for:
- Collecting accepted moves during move evaluation
- Deciding when to quit evaluating early
- Selecting the best move to apply
§Type Parameters
S- The planning solution typeM- The move type
Required Methods§
Sourcefn step_started(&mut self)
fn step_started(&mut self)
Called at the start of each step to reset state.
Sourcefn 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.