Opening

5.5 Subsystem Opening (Blackbox)

Intent/Responsibility

This subsystem provides opening libraries and implements the Polyglot opening book format. This format is currently the only one available, which is not proprietary. Corresponding book files and associated tools are freely available on the Internet.

Interfaces

The Opening subsystem provides its functionality via the Java interface
org.dokchess.opening.OpeningLibrary.

The class org.dokchess.opening.polyglot.PolyglotOpeningBook provides one possible implementation.

Interface OpeningLibrary and class PolyglottOpeningBook

Fig.: Schnittstelle Eroeffnungsbibliothek, Implementierung PolyglotOpeningBook


Method Short description
lookUpMove Returns a standard move for the specified position from the library, or null.
Table: Methods of the interface OpeningLibrary

PolyglotOpeningBook

The PolyglotOpeningBook class is an adapter for the Polyglot opening book file format. Implementation of OpeningLibrary that reads a binary file in the appropriate format and returns a move to the specified position, if the library contains any.

Method Short description
PolyglotOpeningBook Constructor, expects the input file.
setSelectionMode Sets the mode to select a move, if there is more than one candidate in the library for the given position.
Table: Methods of the class PolyglotOpeningBook (in addition to interface OpeningLibrary):

→ Concept 8.2 Chess Domain Model describes the types used in the interface as call and return parameters (Move, Position).

Files

The implementation, unit tests and test data for the Polyglot file format are located below the packages
org.dokchess.opening…

Open Issues

  • The implemented options for a move selection from the Polyglot opening book in case of several candidates are limited (the first, the most often played, by chance).
  • The implementation can not handle multiple library files at the same time. It can therefore not mix them to combine the knowledge.