|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.palamedes.gdl.core.model.utils.Game
public abstract class Game
Field Summary | |
---|---|
protected IGameNode |
initNode
|
protected GDLKnowledgeBase |
kb
|
protected static java.util.Random |
random
A random number generator. |
protected IReasoner |
reasoner
|
protected java.lang.String[] |
roleNames
|
protected java.lang.String |
sourceGDL
|
protected IGameTree |
tree
Game class protected stuff |
Constructor Summary | |
---|---|
Game()
|
Method Summary | |
---|---|
java.util.List<IMove[]> |
getCombinedMoves(IGameNode currentNode)
Returns a list of all moves combined. |
int[] |
getGoalValues(IGameNode currentNode)
Returns an array of the goal values of all players. |
IGameNode |
getInitialNode()
|
GDLKnowledgeBase |
getKnowledgeBase()
Returns the knowledge base that is used for this game. |
IMove[][] |
getLegalMoves(IGameNode currentNode)
Returns an array of the legal moves of each player. |
int |
getMaxSteps()
Returns the maximum number of steps if this information is known from the rules; otherwise -1; |
IGameNode |
getNextNode(IGameNode currentNode,
IMove[] moves)
Returns the child node of the parent that is connected through the specified moves. |
int |
getPerftValue(int depth,
IGameNode startNode)
Returns the perft(n) value starting from the given startNode. |
IMove[] |
getRandomMove(IGameNode currentNode)
Returns a random combined move. |
IReasoner |
getReasoner()
Returns the reasoner that is used for this game. |
int |
getRoleCount()
Returns the number of roles respective the number of players. |
int |
getRoleIndex(java.lang.String role)
Returns the index of the given role in the role name array. |
java.lang.String[] |
getRoleNames()
Returns the string representation of the role names as string array. |
java.lang.String |
getSourceGDL()
Returns the original GDL description for this game. |
IGameState |
getState(IGameNode currentNode)
Returns the game state associated with currentNode. |
IStatistic |
getStatistic()
|
IGameTree |
getTree()
This method returns the game tree. |
protected void |
init(java.lang.String gdl,
IReasoner initReasoner)
|
boolean |
isTerminal(IGameNode currentNode)
Returns true if the state of the node is a terminal state |
void |
regenerateNode(IGameNode node)
This method regenerates the game states if the game node lost its state information for one reason or another. |
static java.lang.String |
showGameNodePath(IGameNode node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.palamedes.gdl.core.model.IGame |
---|
init |
Field Detail |
---|
protected static final java.util.Random random
protected IGameTree tree
protected IReasoner reasoner
protected GDLKnowledgeBase kb
protected java.lang.String sourceGDL
protected java.lang.String[] roleNames
protected IGameNode initNode
Constructor Detail |
---|
public Game()
Method Detail |
---|
protected void init(java.lang.String gdl, IReasoner initReasoner)
public IGameTree getTree()
getTree
in interface IGame
public final java.lang.String getSourceGDL()
IGame
getSourceGDL
in interface IGame
public final java.lang.String[] getRoleNames()
IGame
getRoleNames
in interface IGame
public final IGameNode getInitialNode()
public int getRoleCount()
IGame
getRoleCount
in interface IGame
public int getRoleIndex(java.lang.String role)
IGame
getRoleIndex
in interface IGame
public java.util.List<IMove[]> getCombinedMoves(IGameNode currentNode) throws java.lang.InterruptedException
IGame
getCombinedMoves
in interface IGame
java.lang.InterruptedException
public IMove[][] getLegalMoves(IGameNode currentNode) throws java.lang.InterruptedException
IGame
getLegalMoves
in interface IGame
java.lang.InterruptedException
public IGameNode getNextNode(IGameNode currentNode, IMove[] moves) throws java.lang.InterruptedException
IGame
getNextNode
in interface IGame
java.lang.InterruptedException
public IMove[] getRandomMove(IGameNode currentNode) throws java.lang.InterruptedException
IGame
getRandomMove
in interface IGame
java.lang.InterruptedException
public int[] getGoalValues(IGameNode currentNode) throws java.lang.InterruptedException
IGame
getGoalValues
in interface IGame
java.lang.InterruptedException
public boolean isTerminal(IGameNode currentNode) throws java.lang.InterruptedException
IGame
isTerminal
in interface IGame
java.lang.InterruptedException
public IGameState getState(IGameNode currentNode) throws java.lang.InterruptedException
IGame
getState
in interface IGame
java.lang.InterruptedException
IGame.regenerateNode(IGameNode node)
public void regenerateNode(IGameNode node) throws java.lang.InterruptedException
IGame
regenerateNode
in interface IGame
java.lang.InterruptedException
public IStatistic getStatistic()
getStatistic
in interface IGame
public GDLKnowledgeBase getKnowledgeBase()
IGame
getKnowledgeBase
in interface IGame
public int getMaxSteps()
IGame
getMaxSteps
in interface IGame
public static java.lang.String showGameNodePath(IGameNode node)
public IReasoner getReasoner()
IGame
getReasoner
in interface IGame
public int getPerftValue(int depth, IGameNode startNode) throws java.lang.InterruptedException
IGame
getPerftValue
in interface IGame
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |