pub trait StatsCollector {
// Provided methods
fn pre(&mut self) { ... }
fn etc(&mut self) { ... }
fn recursive(&mut self) { ... }
fn tt_read(&mut self) { ... }
fn const_db_read(&mut self) { ... }
fn db_skip(&mut self, _nimber: u8) { ... }
fn db_cut(&mut self, _nimber: u8) { ... }
fn unknown(&mut self) { ... }
fn exact(&mut self, _nimber: u8) { ... }
fn reset(&mut self) { ... }
}Expand description
Collects statistics for search process.
Search events are indicated with calling self methods by the search algorithm.
Phases of search of a single position are indicated by calling (in the order):
pre (which is called for each node), ETC (only by the algorithms that use ETC), recursive.
Searching of a single position can finish in any phase and is indicated by calling one of:
exact, unknown, or db_cut.
Reading from databases are indicated by calling TT_read and const_db_read
(which is usually done in pre or ETC phase).
Just after TT_read or const_db_read, db_cut or db_skip can be called.
Statistics are collected up to the time of calling reset.
To enable collecting and averaging statistics from many searches (for many initial positions),
solvers never call reset (i.e. it must by called manually).
Default implementations of all StatsCollector methods do nothing.
Provided Methods§
Sourcefn pre(&mut self)
fn pre(&mut self)
Called by the search algorithm at the begging of each recursive call (for each position). It enables investigating the shape of the search tree (of depth-first search process). Visiting of each node is finished by calling one of: exact, unknown, db_cut.
Sourcefn recursive(&mut self)
fn recursive(&mut self)
Called by the search algorithm just before loop that iterates over moves and recursively calls the algorithm.
Sourcefn const_db_read(&mut self)
fn const_db_read(&mut self)
Called for each reading from const (end) database.
Sourcefn db_skip(&mut self, _nimber: u8)
fn db_skip(&mut self, _nimber: u8)
Called when value (passed nimber) read from database (transposition table or const database) caused skipping position (usually by ETC). Type of database can be find by checking which call, TT_read or const_db_read, directly preceded db_cut.
Sourcefn db_cut(&mut self, _nimber: u8)
fn db_cut(&mut self, _nimber: u8)
Called when value (passed nimber) read from database (transposition table or const database) caused pruning. Type of database can be find by checking which call, TT_read or const_db_read, directly preceded db_cut.
Sourcefn unknown(&mut self)
fn unknown(&mut self)
Called for each position which was recursively searched, but whose nimber wasn’t established (due to pruning algorithm).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".