public class MiniMaxPlayer extends Player
Modifier and Type | Class and Description |
---|---|
class |
MiniMaxPlayer.Leaf
leaf that is waiting to be opened
|
class |
MiniMaxPlayer.Node
holds the information about the state, the best/worst value (depending on
the node type, and the depth that is used when propagating the values
from the leaf nodes up the search tree
|
static class |
MiniMaxPlayer.NodeType
opened nodes are MAX if it is this player's turn, states when it is opponent's turn are MIN
|
Player.boardType, Player.playerType
Modifier and Type | Field and Description |
---|---|
static double |
mmRatio
the percentage each of the moves will be used
|
Constructor and Description |
---|
MiniMaxPlayer(GameSpecification specs,
Heuristic heuristic)
create a minimax player for the specified game with the heuristic provided
|
Modifier and Type | Method and Description |
---|---|
java.util.HashMap<Move,GameState> |
expand(GameState state,
java.util.HashSet<Move> moves,
double ratio)
the only difference to standard minimax player is that here we ignore some
of the moves when we expand a move
|
Move |
move(GameState state,
java.util.ArrayList<Move> allowedMoves)
make one minimax move: try to expand the game tree as far as it gets,
evaluating the rest with the heuristic when the time is used up
|
MiniMaxPlayer.Node |
newNode(MiniMaxPlayer.Node previous,
GameState gs)
creates a new node that was reached by performing some move from the previous node.
|
isComputer, otherMoved, ratioTimeLeft, setMaximumNumberOfNodes, setMaxTime, setPlayerNumber, startMove, timeUsed
public MiniMaxPlayer(GameSpecification specs, Heuristic heuristic)
public MiniMaxPlayer.Node newNode(MiniMaxPlayer.Node previous, GameState gs) throws java.lang.Exception
java.lang.Exception
public java.util.HashMap<Move,GameState> expand(GameState state, java.util.HashSet<Move> moves, double ratio) throws java.lang.Exception
java.lang.Exception