|
||||||||||
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.AbstractState<T>
public abstract class AbstractState<T>
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.util.List<IFluent>> |
fluentMap
|
protected java.util.List<IFluent> |
fluents
|
protected T |
nativeState
|
Constructor Summary | |
---|---|
AbstractState(T state)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.util.List<IMove[]> |
getCombinedLegalMoves()
Returns the combined legal moves. |
java.util.List<IFluent> |
getFluentByName(java.lang.String name)
Returns the fluents with the given name. |
java.util.List<java.lang.String> |
getFluentNames()
Returns the fluents with the given name. |
java.util.List<IFluent> |
getFluents()
Returns a list containing all fluents of the game state. |
int |
getGoalValue(int roleIndex)
Returns the goal value for the player specified by roleIndex of the state if the state is a goal state; otherwise -1. |
int[] |
getGoalValues()
Returns the goal values in the same order as IGame.getRoleNames() |
IMove[][] |
getLegalMoves()
Returns an array of the legal moves of each player. |
T |
getNativeState()
Returns the state object that was provided by the reasoner. |
int |
hashCode()
|
abstract void |
initFluentList()
|
boolean |
isTerminal()
Returns true if the state is a terminal state; otherwise false. |
void |
setGoalValues(int[] goalValues)
Sets the goal value of the game state. |
void |
setLegalMoves(IMove[][] legalMovesArray)
Sets the legal moves for this game state. |
void |
setTerminal()
Sets the terminal flag of the state. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final T nativeState
protected java.util.List<IFluent> fluents
protected java.util.Map<java.lang.String,java.util.List<IFluent>> fluentMap
Constructor Detail |
---|
public AbstractState(T state)
Method Detail |
---|
public abstract void initFluentList()
public java.util.List<IMove[]> getCombinedLegalMoves()
IGameState
getCombinedLegalMoves
in interface IGameState
public java.util.List<IFluent> getFluentByName(java.lang.String name)
IGameState
getFluentByName
in interface IGameState
public java.util.List<IFluent> getFluents()
IGameState
getFluents
in interface IGameState
public java.util.List<java.lang.String> getFluentNames()
IGameState
getFluentNames
in interface IGameState
public int[] getGoalValues()
IGameState
getGoalValues
in interface IGameState
IGame.getRoleNames()
public boolean isTerminal()
IGameState
isTerminal
in interface IGameState
public int getGoalValue(int roleIndex)
IGameState
getGoalValue
in interface IGameState
public void setGoalValues(int[] goalValues)
IGameState
setGoalValues
in interface IGameState
public void setTerminal()
IGameState
setTerminal
in interface IGameState
public T getNativeState()
IGameState
getNativeState
in interface IGameState
public IMove[][] getLegalMoves()
IGameState
getLegalMoves
in interface IGameState
public void setLegalMoves(IMove[][] legalMovesArray)
IGameState
setLegalMoves
in interface IGameState
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |