Struct shakmaty_syzygy::Tablebase[][src]

pub struct Tablebase<S: Position + Clone + Syzygy> { /* fields omitted */ }
Expand description

A collection of tables.

Implementations

Create an empty collection of tables.

Add all relevant tables from a directory.

Tables are selected by filename, e.g. KQvKP.rtbz. The files are not actually opened. This happens lazily when probing.

Note that probing generally requires tables for the specific material composition, as well as material compositions that are transitively reachable by captures and promotions. These are sometimes distributed separately, so make sure to add tables from all relevant directories.

Returns the number of added table files.

Errors

Returns an error result when:

  • The path does not exist.
  • path is not a directory.
  • The process lacks permissions to list the directory.

Add a table file.

The file is not actually opened. This happens lazily when probing.

Errors

Returns an error when no file exists at the given path or the filename does not indicate that it is a valid table file (e.g. KQvKP.rtbz).

Probe tables for the Wdl value of a position.

This indicates if the position is winning, lost or drawn with or without the 50-move rule, assuming pos is reached directly after a capture or pawn move.

Errors

See SyzygyError for possible error conditions.

Probe tables for the Dtz value of a position.

Min-maxing the DTZ of the available moves guarantees achieving the optimal outcome under the 50-move rule.

Requires both WDL and DTZ tables.

Errors

See SyzygyError for possible error conditions.

Select a DTZ-optimal move.

Requires both WDL and DTZ tables.

Errors

See SyzygyError for possible error conditions.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.