lnsc.page
Class AbstractStateWithGen

java.lang.Object
  |
  +--lnsc.page.AbstractState
        |
        +--lnsc.page.AbstractStateWithGen
All Implemented Interfaces:
java.lang.Cloneable, State

public abstract class AbstractStateWithGen
extends AbstractState

Optional basis for class implementing State interface. Derived classes constructor must fill the protected variables. Add necessary state information and properties. This implementation uses ActionGenerator and StateGenerator to respond to State.getActions() and State.getNextStates(lnsc.page.Action) (and for State#getActionsEnumerator) calls. When states are not observable, it uses a (@link StateGenerator} with null action to generate the observable states for the agents. It does not support local Do or Undo operation (within an instance do operation) nor clone operation (by default). State and Action generators properties should be passed to to local variable (isDeterministic, areActionsFixed, ActionCount), oservable state generator should be should be deterministic (return a single state).


Constructor Summary
AbstractStateWithGen()
           
 
Method Summary
 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.
 
Methods inherited from class lnsc.page.AbstractState
areActionsFixed, clone, doAction, getActionCount, getProbability, getValue, isCloneable, isDeterministic, isFinal, isObservable, isValid, supportsDo, supportsUndo, toDataSet, toString, undoAction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractStateWithGen

public AbstractStateWithGen()
Method Detail

getActions

public Action[] getActions()
Description copied from interface: State
Returns the list of available action from the current state.

Returns:
The list of available action.

getActionsEnumerator

public java.util.Enumeration getActionsEnumerator()
Description copied from interface: State
Returns an iterator that list the available actions from the current state.

Specified by:
getActionsEnumerator in interface State
Overrides:
getActionsEnumerator in class AbstractState
Returns:
The actions enumerator.

getNextStates

public State[] getNextStates(Action a)
Description copied from interface: State
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()
Description copied from interface: State
Returns the list state of observable states for the agents.

Specified by:
getObservableStates in interface State
Overrides:
getObservableStates in class AbstractState
Returns:
The list of observable states.