lnsc.page
Interface State

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
AbstractState

public interface State
extends java.lang.Cloneable

Defines a state as generally understand in RL and other AI problems.


Method Summary
 boolean areActionsFixed()
          Indicates whether the list of actions is fixed (always the same) or not.
 java.lang.Object clone()
           
 void doAction(Action a)
          Do an action.
 int getActionCount()
          Indicates how many actions it generates.
 Action[] getActions()
          Returns the list of available action from the current state.
 java.util.Enumeration getActionsEnumerator()
          Returns an iterator that list the available actions from the current state.
 State[] getNextStates(Action a)
          Returns the list state following the current state under a given action.
 State[] getObservableStates()
          Returns the list state of observable states for the agents.
 double getProbability()
          Probability of the state, for non-deterministic StateGenerators only.
 double getValue()
          Value associated to the state.
 boolean isCloneable()
          Indicates whether or not the state can be copied
 boolean isDeterministic()
          Indicates whether only the resulting state is returned or whether a list of possible next states is returned.
 boolean isFinal()
          Indicates whether or not a state is final (generally a goal state).
 boolean isObservable()
          Indicates whether of not a state is observable by agents.
 boolean isValid()
          Indicates whether the state is valid or not.
 boolean supportsDo()
          Indicates whether or not do action is supported locally.
 boolean supportsUndo()
          Indicates whether or not undo action is supported.
 DataSet toDataSet()
          Similar to the toString method, but return state content in the form of a DataSet.
 void undoAction()
          Undo last action done.
 

Method Detail

areActionsFixed

public boolean areActionsFixed()
Indicates whether the list of actions is fixed (always the same) or not.

Returns:
true if the list of action is independent of the state, false otherwise

clone

public java.lang.Object clone()

doAction

public void doAction(Action a)
Do an action.


getActionCount

public int getActionCount()
Indicates how many actions it generates. For fixed it should return the number of actions, for unfixed, it should return -1.

Returns:
Number of actions.

getActions

public Action[] getActions()
Returns the list of available action from the current state.

Returns:
The list of available action.

getActionsEnumerator

public java.util.Enumeration getActionsEnumerator()
Returns an iterator that list the available actions from the current state.

Returns:
The actions enumerator.

getNextStates

public State[] getNextStates(Action a)
Returns the list state following the current state under a given action.

Parameters:
a - The action to apply.
Returns:
The list of available action.

getObservableStates

public State[] getObservableStates()
Returns the list state of observable states for the agents.

Returns:
The list of observable states.

getProbability

public double getProbability()
Probability of the state, for non-deterministic StateGenerators only.

Returns:
state probability.

getValue

public double getValue()
Value associated to the state.

Returns:
value of the sate.

isCloneable

public boolean isCloneable()
Indicates whether or not the state can be copied

Returns:
true if the clone function is implemented.

isDeterministic

public boolean isDeterministic()
Indicates whether only the resulting state is returned or whether a list of possible next states is returned. (Does not necessarly tells whether the environment is really deterministic or not!)

Returns:
true if their is only one resulting state, false otherwise.

isFinal

public boolean isFinal()
Indicates whether or not a state is final (generally a goal state).

Returns:
true if it is a final state (end of episode), false otherwise.

isObservable

public boolean isObservable()
Indicates whether of not a state is observable by agents. (Has nothing to do with java.util.Observable!)

Returns:
true us the state is fully obervable by agents.

isValid

public boolean isValid()
Indicates whether the state is valid or not.

Returns:
true if it is valid, false otherwise.

supportsDo

public boolean supportsDo()
Indicates whether or not do action is supported locally.

Returns:
true if the do function is implemented.

supportsUndo

public boolean supportsUndo()
Indicates whether or not undo action is supported.

Returns:
true if the undo function is implemented.

toDataSet

public DataSet toDataSet()
Similar to the toString method, but return state content in the form of a DataSet. Can be null.

Returns:
A DataSet containing a description of the State.

undoAction

public void undoAction()
Undo last action done.