|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lnsc.page.AbstractState
Optional basis for class implementing State
interface. Derived
classes constructor must fill the protected variables. Add necessary state
information and properties. By default do, undo and clone are not supported,
but can be added in derived classes. When setting IsCloneable to true,
basic cloning is automatically inherited from Object. By default states are
observable, and hence getObservableStates return itself. Default
implementation for getActionsEnumerator()
uses State.getActions()
.
Constructor Summary | |
AbstractState()
|
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. |
java.util.Enumeration |
getActionsEnumerator()
Returns an iterator that list the available actions from the current state. |
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. |
java.lang.String |
toString()
|
void |
undoAction()
Undo last action done. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface lnsc.page.State |
getActions, getNextStates |
Constructor Detail |
public AbstractState()
Method Detail |
public boolean areActionsFixed()
State
areActionsFixed
in interface State
public java.lang.Object clone()
clone
in interface State
clone
in class java.lang.Object
public void doAction(Action a)
State
doAction
in interface State
public int getActionCount()
State
getActionCount
in interface State
public java.util.Enumeration getActionsEnumerator()
State
getActionsEnumerator
in interface State
public State[] getObservableStates()
State
getObservableStates
in interface State
public double getProbability()
State
getProbability
in interface State
public double getValue()
State
getValue
in interface State
public boolean isCloneable()
State
isCloneable
in interface State
public boolean isDeterministic()
State
isDeterministic
in interface State
public boolean isFinal()
State
isFinal
in interface State
public boolean isObservable()
State
isObservable
in interface State
public boolean isValid()
State
isValid
in interface State
public boolean supportsDo()
State
supportsDo
in interface State
public boolean supportsUndo()
State
supportsUndo
in interface State
public DataSet toDataSet()
State
toDataSet
in interface State
public java.lang.String toString()
toString
in class java.lang.Object
public void undoAction()
State
undoAction
in interface State
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |