Class MinimaxSearcher

java.lang.Object
  |
  +--MinimaxSearcher
All Implemented Interfaces:
GameTreeSearcher

public class MinimaxSearcher
extends java.lang.Object
implements GameTreeSearcher

MinimaxSearcher.java - a depth-limited minimax searcher without alpha-beta pruning Created: Wed Oct 16 16:15:26 2002


Constructor Summary
MinimaxSearcher(int depthLimit)
          Creates a new MinimaxSearcher instance with the given depth limit.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinimaxSearcher

public MinimaxSearcher(int depthLimit)
Creates a new MinimaxSearcher instance with the given depth limit.
Parameters:
depthLimit - an int value - the depth of the minimax search tree
Method Detail

eval

public double eval(GameNode node)
eval - return the depth-limited minimax value of the given node
Specified by:
eval in interface GameTreeSearcher
Parameters:
node - a GameNode value
Returns:
a double value - depth-limited minimax value

minimaxEval

public double minimaxEval(GameNode node,
                          int depthLeft)
maximize - MAX node evaluation of minimax procedure.
Parameters:
node - a GameNode value
depthLeft - an int value
Returns:
a double value

getBestMove

public int getBestMove()
getBestMove - Return the best move for the node most recently evaluated.
Specified by:
getBestMove in interface GameTreeSearcher
Returns:
an int value encoding the move

getNodeCount

public int getNodeCount()
getNodeCount - returns the number of nodes searched for the previous node evaluation
Specified by:
getNodeCount in interface GameTreeSearcher
Returns:
an int value - number of nodes searched