|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Board
Interface to simulate board of game.
| Method Summary | |
|---|---|
long |
getZobristKey()
Get Zobrist key, a long number reflecting a board position to be used for faster and more space efficient transposition tables and opening books. To use this feature, the following should be done: Declares transpositionMaxIndex to be (power of two) - 1 somewhere in program initialization. e.g. |
boolean |
isUnquiet()
Indicates that a position is not in quiescence state, i.e. |
void |
updateZobristKeyOnTurn(int turn)
Updates zobrist key when turn changes. |
| Method Detail |
|---|
long getZobristKey()
transpositionMaxIndex = (long) (Math.pow(2, 20) - 1);
transpositionTable = new TranspositionTable[(int) transpositionMaxIndex + 1];
private long zobristKey = 0;
private long[][] zsquares = new long[Constants.SQNUM][2];
Random rnd = new Random();
for (int i = 0; i < Constants.SQNUM; i++) {
for (int j = 0; j < 2; j++) {
zsquares[i][j] = rnd.nextLong();
}
}
zobrist values for each color having turn to moveprivate long[] zturn = new long[2];
zturn[0] = rnd.nextLong(); zturn[1] = rnd.nextLong(); zobristKey = 0;
zobristKey ^= zsquares[index][turn];
zobristKey ^= zturn[turn];
return zobristKey;
void updateZobristKeyOnTurn(int turn)
turn - boolean isUnquiet()
|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||