org.eclipse.palamedes.gdl.core.model
Interface IGameState

All Known Implementing Classes:
AbstractState, StateAdapter

public interface IGameState

IGameState provides an interface for general interaction with a single game state. Usually it is a Wrapper around a state object which was given by the games reasoner. AbstractState provides some basic functionality for such a wrapper.

See Also:
AbstractState

Method Summary
 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.
 java.lang.Object getNativeState()
          Returns the state object that was provided by the reasoner.
 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[][] moves)
          Sets the legal moves for this game state.
 void setTerminal()
          Sets the terminal flag of the state.
 

Method Detail

getCombinedLegalMoves

java.util.List<IMove[]> getCombinedLegalMoves()
Returns the combined legal moves.


getLegalMoves

IMove[][] getLegalMoves()
Returns an array of the legal moves of each player. If not already resolved the method returns null.


getGoalValue

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.


getGoalValues

int[] getGoalValues()
Returns the goal values in the same order as IGame.getRoleNames()

See Also:
IGame.getRoleNames()

isTerminal

boolean isTerminal()
Returns true if the state is a terminal state; otherwise false.


setGoalValues

void setGoalValues(int[] goalValues)
Sets the goal value of the game state. If the value is unknown it should get a -1.


setTerminal

void setTerminal()
Sets the terminal flag of the state.


setLegalMoves

void setLegalMoves(IMove[][] moves)
Sets the legal moves for this game state.


getFluentNames

java.util.List<java.lang.String> getFluentNames()
Returns the fluents with the given name.


getFluentByName

java.util.List<IFluent> getFluentByName(java.lang.String name)
Returns the fluents with the given name.


getFluents

java.util.List<IFluent> getFluents()
Returns a list containing all fluents of the game state.


getNativeState

java.lang.Object getNativeState()
Returns the state object that was provided by the reasoner.