EDI 1.0 API
EDI Core
This module is where the core of the EDI game engine is implemented. You can view the full source code for the project here.
General Structure
As a heuristic game tree search program, EDI's core engine is made up of the following parts:-
The game state tree; i.e., how a game state is represented and how child states are computed. This is implemented in the
statepackage. -
The static evaluation of a game state; i.e., the heuristic method used to assess how favorable a game state is for each player. This is implemented in the
evalpackage. -
The traversal of the game tree; i.e., the search method used to decide which path (i.e., move) is most favorable for a given player. This is implemented in the
searchpackage.
Each of these classes also rely on the bitboard package to compute and represent certain properties of the game state. The player package is where the three core components (the game tree, static evaluation, and tree traversal) are combined to make a functioning program to make decisions and communicate with the tournament's game server. Finally, the view package is used to print output and receive input via the command-line interface.
Terminology and Conventions
Throughout this module, certain values are encoded in ways that might not be obvious to the reader. In this section, we explicitly define the conventions and terminology we use.
-
The color of a player (or player color) refers to a
bytethat represents either the White (0) or the Black player (1). These constants are defined in theCclass, so you can just useC.WHITEorC.BLACKinstead of literals. -
A position index is a
bytethat represents a given position on a board. Since Amazons is played on a 10-by-10 board, there are 100 unique board position indices, enumerated 0 through 99.-
The board is represented in row-major order, so if
posis a position index, you can get the row frompos / 10and the column frompos % 10. -
As is convention, rows are counted from top-to-bottom (so row
1appears "below" row0) and columns are counted from left-to-right.
-
The board is represented in row-major order, so if
-
The four cardinal directions are defined based on the row-major ordering of the board. Namely,
- A Northern position has a lesser row index.
- A Southern position has a greater row index.
- An Eastern position has a greater column index.
- A Western position has a lesser column index.
Pif you need to represent them. -
An occupancy board is a bitboard where each position is flagged if and only if the square is occupied by a queen or an arrow. For more information about bitboards, see
BitBoard. Occupancy boards are the primary bitboard we use to help represent a board state, in conjunction with thebyte[8]that represents queens. -
A queens array is a
byte[8]which holds the position indices of all eight queens on the board. It is always expected the the first four queens are those belonging to White, and the last four are those belonging to Black.