pub trait LocalSearchForager<S, M>: Send + Debugwhere
S: PlanningSolution,
M: Move<S>,{
// Required methods
fn step_started(
&mut self,
best_score: S::Score,
last_step_score: S::Score,
step_seed: u64,
);
fn add_move_index(
&mut self,
index: CandidateId,
score: S::Score,
) -> ForagerDecision;
fn is_quit_early(&self) -> bool;
fn pick_move_index(&mut self) -> Option<(CandidateId, S::Score)>;
// Provided method
fn accepted_count_limit(&self) -> Option<usize> { ... }
}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 typeM- The move type (for trait bounds only, moves are never stored)
Required Methods§
fn step_started( &mut self, best_score: S::Score, last_step_score: S::Score, step_seed: u64, )
fn add_move_index( &mut self, index: CandidateId, score: S::Score, ) -> ForagerDecision
fn is_quit_early(&self) -> bool
fn pick_move_index(&mut self) -> Option<(CandidateId, S::Score)>
Provided Methods§
fn accepted_count_limit(&self) -> Option<usize>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".