|
|||||||||
| 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 Statepublic java.lang.Object clone()
clone in interface Stateclone in class java.lang.Objectpublic void doAction(Action a)
State
doAction in interface Statepublic int getActionCount()
State
getActionCount in interface Statepublic java.util.Enumeration getActionsEnumerator()
State
getActionsEnumerator in interface Statepublic State[] getObservableStates()
State
getObservableStates in interface Statepublic double getProbability()
State
getProbability in interface Statepublic double getValue()
State
getValue in interface Statepublic boolean isCloneable()
State
isCloneable in interface Statepublic boolean isDeterministic()
State
isDeterministic in interface Statepublic boolean isFinal()
State
isFinal in interface Statepublic boolean isObservable()
State
isObservable in interface Statepublic boolean isValid()
State
isValid in interface Statepublic boolean supportsDo()
State
supportsDo in interface Statepublic boolean supportsUndo()
State
supportsUndo in interface Statepublic DataSet toDataSet()
State
toDataSet in interface Statepublic java.lang.String toString()
toString in class java.lang.Objectpublic void undoAction()
State
undoAction in interface State
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||