public abstract class GameNode
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX
constant integers designating player MAXimizing and MINimizing utility
|
static int |
MIN
constant integers designating player MAXimizing and MINimizing utility
|
GameNode |
parent
variable
parent - parent of this game node |
protected int |
player
first player MAXimizer by default
|
int |
prevMove
previous move applied to reach this node.
|
static int |
UNDEFINED_MOVE
undefined move constant
|
| Constructor and Description |
|---|
GameNode() |
| Modifier and Type | Method and Description |
|---|---|
GameNode |
childClone()
childClone - returns a clone of this node
that has been made a child of this node and has a depth
one greater than this. |
java.lang.Object |
clone()
clone - deep copy of game node; This will
generally need to be overridden. |
abstract java.util.ArrayList<GameNode> |
expand()
expand - return an ArrayList of all possible next
game states |
abstract boolean |
gameOver()
Return result of terminal state test.
|
int |
getPlayer()
getPlayer - return the current player
(GameNode.MAX or GameNode.MIN). |
abstract double |
utility()
Return the estimated utility of the current game position,
unless game is over.
|
public static final int MAX
public static final int MIN
public static final int UNDEFINED_MOVE
protected int player
public int prevMove
public GameNode parent
parent - parent of this game nodepublic int getPlayer()
getPlayer - return the current player
(GameNode.MAX or GameNode.MIN).int value GameNode.MAX or
GameNode.MINpublic abstract java.util.ArrayList<GameNode> expand()
expand - return an ArrayList of all possible next
game statesVector of all possible next game
statespublic GameNode childClone()
childClone - returns a clone of this node
that has been made a child of this node and has a depth
one greater than this.SearchNode valuepublic java.lang.Object clone()
clone - deep copy of game node; This will
generally need to be overridden.clone in class java.lang.ObjectObject valuepublic abstract boolean gameOver()
public abstract double utility()