pub trait Strategy<G: Game> {
// Required method
fn choose_move(&mut self, state: &G::S) -> Option<G::M>;
// Provided methods
fn set_timeout(&mut self, _timeout: Duration) { ... }
fn set_max_depth(&mut self, _depth: u8) { ... }
fn principal_variation(&self) -> Vec<G::M> { ... }
}
Expand description
Defines a method of choosing a move for the current player.
Required Methods§
fn choose_move(&mut self, state: &G::S) -> Option<G::M>
Provided Methods§
sourcefn set_timeout(&mut self, _timeout: Duration)
fn set_timeout(&mut self, _timeout: Duration)
For strategies that can ponder indefinitely, set the timeout. This can be changed between calls to choose_move.
sourcefn set_max_depth(&mut self, _depth: u8)
fn set_max_depth(&mut self, _depth: u8)
Set the maximum depth to evaluate (instead of the timeout). This can be changed between calls to choose_move.
sourcefn principal_variation(&self) -> Vec<G::M>
fn principal_variation(&self) -> Vec<G::M>
From the last choose_move call, return the principal variation, i.e. the best sequence of moves for both players.