Struct shakmaty_syzygy::Tablebase [−][src]
A collection of tables.
Methods
impl<S: Position + Clone + Syzygy> Tablebase<S>
[src]
impl<S: Position + Clone + Syzygy> Tablebase<S>
pub fn new() -> Tablebase<S>
[src]
pub fn new() -> Tablebase<S>
Create an empty collection of tables.
pub fn add_directory<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
pub fn add_directory<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
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.
Errors
Returns an error result when:
- The
path
does not exist. path
is not a directory.- The process lacks permissions to list the directory.
pub fn probe_wdl(&self, pos: &S) -> Result<Wdl, SyzygyError>
[src]
pub fn probe_wdl(&self, pos: &S) -> Result<Wdl, SyzygyError>
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.
Errors
See SyzygyError
for possible error
conditions.
pub fn probe_dtz(&self, pos: &S) -> Result<Dtz, SyzygyError>
[src]
pub fn probe_dtz(&self, pos: &S) -> Result<Dtz, SyzygyError>
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.
Errors
See SyzygyError
for possible error
conditions.
pub fn best_move(&self, pos: &S) -> Result<Option<(Move, Dtz)>, SyzygyError>
[src]
pub fn best_move(&self, pos: &S) -> Result<Option<(Move, Dtz)>, SyzygyError>
Trait Implementations
impl<S: Debug + Position + Clone + Syzygy> Debug for Tablebase<S>
[src]
impl<S: Debug + Position + Clone + Syzygy> Debug for Tablebase<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: Position + Clone + Syzygy> Default for Tablebase<S>
[src]
impl<S: Position + Clone + Syzygy> Default for Tablebase<S>