public abstract class EndGameTableBase extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
EndGameTableBase.DTM
A class containing the outcome of a position in an endgame tablebase and potentially the distance to mate from the position.
|
static class |
EndGameTableBase.EGTBStats
A simple container class for basic endgame tablebase probing stats.
|
static class |
EndGameTableBase.WDL
A simple enum for possible outcomes for positions in endgame tablebases.
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_NUMBER_OF_PIECES
The maximum number of pieces on the board for which there are endgame tablebases.
|
Constructor and Description |
---|
EndGameTableBase() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
areTableBasesAvailable(int piecesOnBoard)
It returns whether there are at least some tablebase files loaded for positions with the given number of pieces on the board.
|
abstract void |
clearCache()
Flushes the probing cache.
|
abstract EndGameTableBase.EGTBStats |
getStats()
Returns some basic usage stats about the endgame tablebase.
|
abstract void |
init(String path,
long cacheSize,
Object... args)
Initializes the probing code, potentially including the setting up of the cache.
|
abstract boolean |
isInit()
Returns whether the probing code has been initialized.
|
boolean |
isProbingLibLoaded()
Whether the last call to
loadProbingLibrary(String) resulted in the successful loading of the library. |
void |
loadProbingLibrary(String path)
Loads the probing library at the given path.
|
abstract EndGameTableBase.DTM |
probeDTM(Position pos,
boolean soft)
It probes for the given position and if found, it returns whether it is a win, loss, or draw; and in case it is a win or loss, it also
returns the distance to mate.
|
abstract EndGameTableBase.WDL |
probeWDL(Position pos,
boolean soft)
It probes for the given position and if found, it returns whether it is a winning position, a losing position, or a draw; else it
returns null.
|
abstract void |
resetStats()
Resets the endgame tablebase stats.
|
public static final int MAX_NUMBER_OF_PIECES
public void loadProbingLibrary(String path)
path
- The path to the shared library containing the probing code.public boolean isProbingLibLoaded()
loadProbingLibrary(String)
resulted in the successful loading of the library.public abstract void init(String path, long cacheSize, Object... args)
path
- The path to the folders containing the endgame tablebase files.cacheSize
- The size of the probing cache in bytes.args
- Optional arguments.public abstract boolean isInit()
public abstract void clearCache()
public abstract boolean areTableBasesAvailable(int piecesOnBoard)
piecesOnBoard
- The total number of pieces on the board.public abstract EndGameTableBase.EGTBStats getStats()
public abstract void resetStats()
public abstract EndGameTableBase.WDL probeWDL(Position pos, boolean soft)
pos
- The chess position to look for.soft
- Whether only the cache should be probed.public abstract EndGameTableBase.DTM probeDTM(Position pos, boolean soft)
pos
- The chess position to look for.soft
- Whether only the cache should be probed.Copyright © 2020. All rights reserved.