public class MinimaxSearcher extends java.lang.Object implements GameTreeSearcher
| Constructor and Description |
|---|
MinimaxSearcher(int depthLimit)
Creates a new
MinimaxSearcher instance with
the given depth limit. |
| Modifier and Type | Method and Description |
|---|---|
double |
eval(GameNode node)
eval - return the depth-limited minimax value
of the given node |
int |
getBestMove()
getBestMove - Return the best move for the
node most recently evaluated. |
int |
getNodeCount()
getNodeCount - returns the number of nodes
searched for the previous node evaluation |
double |
minimaxEval(GameNode node,
int depthLeft)
maximize - MAX node evaluation of minimax
procedure. |
public MinimaxSearcher(int depthLimit)
MinimaxSearcher instance with
the given depth limit.depthLimit - an int value - the depth of
the minimax search treepublic double eval(GameNode node)
eval - return the depth-limited minimax value
of the given nodeeval in interface GameTreeSearchernode - a GameNode valuedouble value - depth-limited
minimax valuepublic double minimaxEval(GameNode node, int depthLeft)
maximize - MAX node evaluation of minimax
procedure.node - a GameNode valuedepthLeft - an int valuedouble valuepublic int getBestMove()
getBestMove - Return the best move for the
node most recently evaluated.getBestMove in interface GameTreeSearcherint value encoding the movepublic int getNodeCount()
getNodeCount - returns the number of nodes
searched for the previous node evaluationgetNodeCount in interface GameTreeSearcherint value - number of nodes
searched