All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class taxman.Minimax

java.lang.Object
   |
   +----taxman.Minimax

public class Minimax
extends Object
implements Runnable
This is the implementation of Minimax with alpha/beta pruning. One downside to Minimax is its massive usage of space and stack. These two problems are helped by the use of undo which allows the same program state structure (board, etc) to be used for all tests. Since only one move is evaluated at a time, the program can effectively undo moves to find the best move.


Variable Index

 o BLOCK_WAIT_TIME

Constructor Index

 o Minimax(Board, int, boolean, Game)
Creates a minimax object with the given board and ply (search depth).

Method Index

 o findBestMove()
Finds and returns the best move within the current ply.
 o getCutoffs()
Gets the number of cutoffs made during last search.
 o getEvaluations()
Gets the number of conditional checks made on evaluations.
 o getMaxDepth()
Returns the maximum depth traveled to in this evaluation set
 o getPercievedAdvantage()
Gets the last player to evaluate's percieved advantage.
 o getPly()
Returns the current ply (depth) used in minimax search
 o main(String[])
Minimax algorithm tester
 o quit()
Causes the algorithm to be halted and the thread running the algorithm to exit.
 o run()
Runs algorithm and reports back to the call-back object.
 o setPly(int)
Sets the search ply (depth) of the algorithm

Variables

 o BLOCK_WAIT_TIME
 public static final int BLOCK_WAIT_TIME

Constructors

 o Minimax
 public Minimax(Board B,
                int Ply,
                boolean DoCutoffs,
                Game cb)
Creates a minimax object with the given board and ply (search depth).

Parameters:
B - The board object to use for search
Ply - The depth of the search (can be changed)
DoCutoffs - True if the algorithm should use alpha/beta pruning
cb - Call back function to use when algorithm finds a valid number

Methods

 o setPly
 public final synchronized void setPly(int Ply)
Sets the search ply (depth) of the algorithm

Parameters:
Ply - The ply of the search (depth)
 o getPercievedAdvantage
 public final int getPercievedAdvantage()
Gets the last player to evaluate's percieved advantage. A positive number means it is believed the player will win. A negative number means it is believed the player will lose.

Returns:
The percieved advantage of the last player to evaluate
 o getEvaluations
 public final int getEvaluations()
Gets the number of conditional checks made on evaluations.

Returns:
The number of conditional evaluation checks made
 o getCutoffs
 public final int getCutoffs()
Gets the number of cutoffs made during last search.

Returns:
The number of alpha/beta cutoffs made
 o getPly
 public final int getPly()
Returns the current ply (depth) used in minimax search

Returns:
The current ply (depth) of searching
 o getMaxDepth
 public final int getMaxDepth()
Returns the maximum depth traveled to in this evaluation set

Returns:
The maximum depth in this search
 o findBestMove
 public final synchronized Object findBestMove()
Finds and returns the best move within the current ply. The best move is given w.r.t the current player.

Returns:
An object representing the best move
 o quit
 public final void quit()
Causes the algorithm to be halted and the thread running the algorithm to exit.

 o run
 public void run()
Runs algorithm and reports back to the call-back object.

 o main
 public static void main(String args[])
Minimax algorithm tester


All Packages  Class Hierarchy  This Package  Previous  Next  Index