|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectknockabout.search.ItMinMaxSearchAlgorithm
Iterative deepening, real-time expectiminimax search algorithm
Field Summary | |
static int |
READY
|
static int |
SEARCHING
|
static int |
STOPPING
|
Constructor Summary | |
ItMinMaxSearchAlgorithm()
|
Method Summary | |
int |
getAverageBranchingFactor()
Average branching factor |
float |
getBestMoveUtility()
|
Heuristic |
getHeuristic()
|
GameState |
getInitialState()
|
int |
getMaxDepth()
|
int |
getNumberOfExploredNodes()
Number of min nodes + number of max nodes explored |
protected float |
max()
Note that this function will leave the board in the same configuration as the it was when the function was called, because the inverse move is always applied after each move tried. |
protected float |
min()
See max() |
void |
run()
|
Move |
search()
Evaluate the best move to do |
void |
setHeuristic(Heuristic heuristic)
The heuristic function to evaluate the utility of non terminal nodes |
void |
setInitialState(GameState initialState)
The initial state of the game |
protected float |
stochMax()
In the case of a stochastic node, average the possibilities |
protected float |
stochMin()
See stochMax() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int READY
public static final int SEARCHING
public static final int STOPPING
Constructor Detail |
public ItMinMaxSearchAlgorithm()
Method Detail |
public GameState getInitialState()
getInitialState
in interface SearchAlgorithm
public void setInitialState(GameState initialState)
SearchAlgorithm
setInitialState
in interface SearchAlgorithm
initialState
- public Move search()
SearchAlgorithm
search
in interface SearchAlgorithm
public void run()
run
in interface java.lang.Runnable
protected float max()
protected float stochMax()
protected float min()
protected float stochMin()
public int getMaxDepth()
getMaxDepth
in interface SearchAlgorithm
public Heuristic getHeuristic()
getHeuristic
in interface SearchAlgorithm
public void setHeuristic(Heuristic heuristic)
setHeuristic
in interface SearchAlgorithm
heuristic
- public float getBestMoveUtility()
getBestMoveUtility
in interface SearchAlgorithm
public int getNumberOfExploredNodes()
getNumberOfExploredNodes
in interface SearchAlgorithm
public int getAverageBranchingFactor()
getAverageBranchingFactor
in interface SearchAlgorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |