Skip to main content

StatsCollector

Trait StatsCollector 

Source
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§

Source

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.

Source

fn etc(&mut self)

Called by the search algorithm at the begging of ETC phase.

Source

fn recursive(&mut self)

Called by the search algorithm just before loop that iterates over moves and recursively calls the algorithm.

Source

fn tt_read(&mut self)

Called for each reading from transposition table.

Source

fn const_db_read(&mut self)

Called for each reading from const (end) database.

Source

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.

Source

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.

Source

fn unknown(&mut self)

Called for each position which was recursively searched, but whose nimber wasn’t established (due to pruning algorithm).

Source

fn exact(&mut self, _nimber: u8)

Called for each position whose nimber (given as parameter) is calculated and writen to TT; called for each writing to TT.

Source

fn reset(&mut self)

Reset statistics.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StatsCollector for ()

Source§

impl<SC1: StatsCollector, SC2: StatsCollector, SC3: StatsCollector, SC4: StatsCollector> StatsCollector for (SC1, SC2, SC3, SC4)

Source§

fn pre(&mut self)

Source§

fn etc(&mut self)

Source§

fn recursive(&mut self)

Source§

fn tt_read(&mut self)

Source§

fn const_db_read(&mut self)

Source§

fn db_skip(&mut self, nimber: u8)

Source§

fn db_cut(&mut self, nimber: u8)

Source§

fn unknown(&mut self)

Source§

fn exact(&mut self, nimber: u8)

Source§

fn reset(&mut self)

Source§

impl<SC1: StatsCollector, SC2: StatsCollector, SC3: StatsCollector> StatsCollector for (SC1, SC2, SC3)

Source§

fn pre(&mut self)

Source§

fn etc(&mut self)

Source§

fn recursive(&mut self)

Source§

fn tt_read(&mut self)

Source§

fn const_db_read(&mut self)

Source§

fn db_skip(&mut self, nimber: u8)

Source§

fn db_cut(&mut self, nimber: u8)

Source§

fn unknown(&mut self)

Source§

fn exact(&mut self, nimber: u8)

Source§

fn reset(&mut self)

Source§

impl<SC1: StatsCollector, SC2: StatsCollector> StatsCollector for (SC1, SC2)

Source§

fn pre(&mut self)

Source§

fn etc(&mut self)

Source§

fn recursive(&mut self)

Source§

fn tt_read(&mut self)

Source§

fn const_db_read(&mut self)

Source§

fn db_skip(&mut self, nimber: u8)

Source§

fn db_cut(&mut self, nimber: u8)

Source§

fn unknown(&mut self)

Source§

fn exact(&mut self, nimber: u8)

Source§

fn reset(&mut self)

Source§

impl<SC1: StatsCollector> StatsCollector for (SC1,)

Source§

fn pre(&mut self)

Source§

fn etc(&mut self)

Source§

fn recursive(&mut self)

Source§

fn tt_read(&mut self)

Source§

fn const_db_read(&mut self)

Source§

fn db_skip(&mut self, nimber: u8)

Source§

fn db_cut(&mut self, nimber: u8)

Source§

fn unknown(&mut self)

Source§

fn exact(&mut self, nimber: u8)

Source§

fn reset(&mut self)

Implementors§