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.
-
BLOCK_WAIT_TIME
-
-
Minimax(Board, int, boolean, Game)
- Creates a minimax object with the given board and ply (search depth).
-
findBestMove()
- Finds and returns the best move within the current ply.
-
getCutoffs()
- Gets the number of cutoffs made during last search.
-
getEvaluations()
- Gets the number of conditional checks made on evaluations.
-
getMaxDepth()
- Returns the maximum depth traveled to in this evaluation set
-
getPercievedAdvantage()
- Gets the last player to evaluate's percieved advantage.
-
getPly()
- Returns the current ply (depth) used in minimax search
-
main(String[])
- Minimax algorithm tester
-
quit()
- Causes the algorithm to be halted and the thread
running the algorithm to exit.
-
run()
- Runs algorithm and reports back to the call-back object.
-
setPly(int)
- Sets the search ply (depth) of the algorithm
BLOCK_WAIT_TIME
public static final int BLOCK_WAIT_TIME
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
setPly
public final synchronized void setPly(int Ply)
- Sets the search ply (depth) of the algorithm
- Parameters:
- Ply - The ply of the search (depth)
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
getEvaluations
public final int getEvaluations()
- Gets the number of conditional checks made on evaluations.
- Returns:
- The number of conditional evaluation checks made
getCutoffs
public final int getCutoffs()
- Gets the number of cutoffs made during last search.
- Returns:
- The number of alpha/beta cutoffs made
getPly
public final int getPly()
- Returns the current ply (depth) used in minimax search
- Returns:
- The current ply (depth) of searching
getMaxDepth
public final int getMaxDepth()
- Returns the maximum depth traveled to in this evaluation set
- Returns:
- The maximum depth in this search
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
quit
public final void quit()
- Causes the algorithm to be halted and the thread
running the algorithm to exit.
run
public void run()
- Runs algorithm and reports back to the call-back object.
main
public static void main(String args[])
- Minimax algorithm tester
All Packages Class Hierarchy This Package Previous Next Index