pub struct SearchResult {}
Expand description
The results found from running a search on some root position.
Fields§
§best_move: Move
The best move to make for a position discovered from search.
score: Cp
The centipawn score of making the best move, with absolute Cp (+White, -Black).
pv: Line
The principal variation, or a sequence of the best moves that result in an evaluation of at least score
Cp.
player: Color
The player to move for the root position that was searched.
depth: PlyKind
Depth (aka ply, half move) that was searched to. This depth is only fully searched if the stopped
flag is false.
nodes: u64
Total number of nodes visited in a search, including main search nodes and quiescence nodes.
q_nodes: u64
Total number of nodes visited in a quiescence search.
elapsed: Duration
Total time elapsed from the start to the end of a search.
q_elapsed: Duration
Total time elapsed spent in quiescence search, within main search.
stopped: bool
Flag that indicates this search was aborted.
cut_nodes: u64
Number of nodes where a beta-cutoff was performed.
pv_nodes: u64
Number of nodes that improved local alpha value without reaching beta.
all_nodes: u64
Number of nodes that did not improve alpha or result in a cutoff.
tt_hits: u64
Number of times a position was found in the transposition table.
tt_cuts: u64
Number of times a tt hit score could be used and returned immediately.
Implementations§
Source§impl SearchResult
impl SearchResult
Sourcepub fn add_metrics(&mut self, other: Self)
pub fn add_metrics(&mut self, other: Self)
Add the following metrics from other
to this Result:
nodes, q_nodes, elapsed, q_elapsed, beta_cutoffs, alpha_increases, tt_hits, tt_cuts.
Sourcepub fn quiescence_ratio(&self) -> f64
pub fn quiescence_ratio(&self) -> f64
Returns the percentage of elapsed time of search that was in quiescence.
Example: elapsed=2.0s, q_elapsed=0.5s, quiescence_ratio=0.25
Sourcepub fn tt_cut_ratio(&self) -> f64
pub fn tt_cut_ratio(&self) -> f64
Returns the percentage of tt hits that result in tt cuts.
Sourcepub fn relative_score(&self) -> Cp
pub fn relative_score(&self) -> Cp
Converts the score of the search into one that is relative to search’s root player.
Sourcepub fn absolute_score(&self) -> Cp
pub fn absolute_score(&self) -> Cp
Converts the score of the search into one that is absolute, with White as + and Black as -.
Trait Implementations§
Source§impl Clone for SearchResult
impl Clone for SearchResult
Source§fn clone(&self) -> SearchResult
fn clone(&self) -> SearchResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SearchResult
impl Debug for SearchResult
Source§impl Default for SearchResult
Note that this default is technically illegal and does not represent any actual search.
impl Default for SearchResult
Note that this default is technically illegal and does not represent any actual search.