pub trait Evaluator {
type G: Game;
// Required method
fn evaluate(&self, s: &<Self::G as Game>::S) -> Evaluation;
// Provided method
fn generate_noisy_moves(
&self,
_state: &<Self::G as Game>::S,
_moves: &mut Vec<<Self::G as Game>::M>
) { ... }
}
Expand description
Evaluates a game’s positions.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn generate_noisy_moves(
&self,
_state: &<Self::G as Game>::S,
_moves: &mut Vec<<Self::G as Game>::M>
)
fn generate_noisy_moves( &self, _state: &<Self::G as Game>::S, _moves: &mut Vec<<Self::G as Game>::M> )
Optional interface to support strategies using quiescence search.
A “noisy” move is a threatening move that requires a response.
The term comes from chess, where capturing a piece is considered a noisy move. Capturing a piece is often the first move out of an exchange of captures. Evaluating the board state after only the first capture can give a misleadingly high score. The solution is to continue the search among only noisy moves and find the score once the board state settles.
Noisy moves are not inherent parts of the rules, but engine decisions, so they are implemented in Evaluator instead of Game.