pub trait ConstructionForager<S, M>: Send + Debugwhere
S: PlanningSolution,
M: Move<S>,{
// Required method
fn pick_move_index<D: ScoreDirector<S>>(
&self,
placement: &Placement<S, M>,
score_director: &mut D,
) -> Option<usize>;
}Expand description
Trait for selecting a move during construction.
Foragers evaluate candidate moves and pick one based on their strategy. Returns the index of the selected move, not a cloned move.
§Type Parameters
S- The planning solution typeM- The move type
Required Methods§
Sourcefn pick_move_index<D: ScoreDirector<S>>(
&self,
placement: &Placement<S, M>,
score_director: &mut D,
) -> Option<usize>
fn pick_move_index<D: ScoreDirector<S>>( &self, placement: &Placement<S, M>, score_director: &mut D, ) -> Option<usize>
Picks a move index from the placement’s candidates.
Returns None if no suitable move is found.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.