|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.genethello.gametheory.GameTheory
net.sf.genethello.brain.Brain
public class Brain
A 'best move' searching class extending GameTheory class. It ables to search game tree up to certain depth using various algorithms such as NegaMax, AlphaBeta, NegaScout, MTD (Memory-enhanced Test Driver), and optionally with history table, transposition table and iterative deepening technique.
| Field Summary | |
|---|---|
protected Chromosome |
chromosome
Chromosome of the brain. |
| Fields inherited from class net.sf.genethello.gametheory.GameTheory |
|---|
bestmove, board, depth, historyTable, moveLength, step, timesUp, transpositionMaxIndex, transpositionTable, unquiet |
| Constructor Summary | |
|---|---|
Brain(IGame game,
Chromosome chromosome,
long timeQuota)
Creates new instance of brain. |
|
| Method Summary | |
|---|---|
void |
DoMove(int i)
Does move using i'th valid moves. |
protected void |
DoMove(Move mv)
Does move using valid move mv. |
int |
Eval()
Evaluates value of move to be taken. |
void |
Generate()
Generates array of valid moves. |
Chromosome |
getChromosome()
Get the value of chromosome |
Move |
getMove(int i)
Gets i'th move. |
Move |
getRandomMove()
Gets random move from array of valid moves. |
void |
halveHistoryTable()
Halves values of history table to avoid bad record in the past dominates the rating. |
int |
HistoryIndex(int i)
Searches index of an i-th move from array of history table. |
int |
HistoryIndex(Move mv)
Searches index of a move from array of history table. |
void |
initBrain()
Initializes brain. |
void |
initHistoryTable()
Initializes history table. |
void |
initTranspositionTable()
Initializes transposition table. |
int |
IterativeMTD()
Calls _IterativeMTD() with time constraint. |
protected void |
PrintBoard()
Print the board. |
protected void |
PrintMove(Move mv)
Print move to standard output. |
void |
setBoard(Board b)
Sets game board. |
void |
setChromosome(Chromosome chromosome)
Set the value of chromosome |
void |
setTimeQuota(long time)
Sets time quota of in milliseconds. |
void |
UndoGenerate()
Undoes generation of valid moves. |
void |
UndoMove()
Undoes move. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Chromosome chromosome
| Constructor Detail |
|---|
public Brain(IGame game,
Chromosome chromosome,
long timeQuota)
game - game in which brain is usedchromosome - chromosome to be usedtimeQuota - time quota to think for a whole game (in ms)| Method Detail |
|---|
public final void initBrain()
public int Eval()
Eval in class GameTheorypublic void Generate()
Generate in class GameTheorypublic void UndoGenerate()
UndoGenerate in class GameTheorypublic void DoMove(int i)
DoMove in class GameTheoryi - index of valid movesprotected void DoMove(Move mv)
DoMove in class GameTheorymv - movepublic void UndoMove()
UndoMove in class GameTheorypublic Move getMove(int i)
getMove in class GameTheoryi - index of valid moves
public int HistoryIndex(int i)
HistoryIndex in class GameTheoryi - index of valid moves
public int HistoryIndex(Move mv)
HistoryIndex in class GameTheorymv - move
public Move getRandomMove()
public Chromosome getChromosome()
public void setChromosome(Chromosome chromosome)
chromosome - new value of chromosomeprotected void PrintBoard()
PrintBoard in class GameTheoryprotected void PrintMove(Move mv)
PrintMove in class GameTheorypublic void initHistoryTable()
public void initTranspositionTable()
public void setBoard(Board b)
b - boardpublic void halveHistoryTable()
public int IterativeMTD()
IterativeMTD in class GameTheorypublic void setTimeQuota(long time)
time - time quota (in ms)
|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||