public abstract class OpeningBook extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
OpeningBook.SelectionModel
An enumeration type for mathematical models used in the process of selecting one from all the available opening moves for a position.
|
Modifier and Type | Field and Description |
---|---|
protected SeekableByteChannel |
bookStream |
protected Path |
path |
protected OpeningBook |
secondaryBook |
Modifier | Constructor and Description |
---|---|
protected |
OpeningBook(String filePath)
It instantiates a Book object on the opening book file specified by filePath; if the file cannot be accessed, an IOException is
thrown.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
abstract Move |
getMove(Position pos,
OpeningBook.SelectionModel selection)
Picks and returns an opening move for the Position0 from all the relevant entries found in the PolyGlot book based on the specified
mathematical model for selection.
|
String |
getPrimaryFilePath()
Returns the path to the main book file this object has been instantiated on.
|
String |
getSecondaryFilePath()
Returns the path to the secondary book file.
|
protected Path path
protected SeekableByteChannel bookStream
protected OpeningBook secondaryBook
protected OpeningBook(String filePath) throws Exception
filePath
- The path to the book.Exception
- If the book cannot be accessed.public String getPrimaryFilePath()
public String getSecondaryFilePath()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public abstract Move getMove(Position pos, OpeningBook.SelectionModel selection) throws Exception
pos
- The position for which an opening move is sought.selection
- The mathematical model to be applied when selecting the move.Exception
- If anything goes wrong.Copyright © 2020. All rights reserved.