|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.conversation.Fsm
Contains the attributes and behavior of a finite state machine instance.
Fsms have a class structure in which instances of a class have the
same arcs and states, with the exception that instances may have
differing actions and sub fsms on their arcs.
Subclass fsms inherit states and arcs from their superclass fsm.
A subclass fsm may override arcs which would otherwise be inherited.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Field Summary | |
protected Performative |
defaultPerformative
default performative for the initial state |
protected FsmClass |
fsmClass
class of the fsm instance |
protected java.util.HashMap |
fsmStates
dictionary of fsm states, stateName --> State |
protected State |
initialState
inital fsm state |
protected java.lang.String |
name
name of the fsm instance |
Constructor Summary | |
protected |
Fsm(java.lang.String name)
Constructs a new Fsm object given the fsm name |
Method Summary | |
void |
addState(State fsmState)
Records the stateId and associated State |
void |
addState(java.lang.String stateId,
State fsmState)
Records the stateId and associated State |
Performative |
getDefaultPerformative()
Returns the default performative. |
FsmClass |
getFsmClass()
Returns the fsm class. |
State |
getInitialState()
Returns the initial fsm state. |
java.lang.String |
getName()
Returns the fsm name. |
State |
getState(java.lang.String stateId)
Returns the state having the given id. |
void |
setDefaultPerformative(Performative defaultPerformative)
Sets the default performative. |
void |
setInitialState(State initialState)
Sets the initial fsm state. |
java.lang.String |
toString()
Returns a string representation of this object. |
protected void |
validateIntegrity()
Validates fsm integrity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected FsmClass fsmClass
protected State initialState
protected Performative defaultPerformative
protected java.util.HashMap fsmStates
Constructor Detail |
protected Fsm(java.lang.String name)
name
- the fsm nameMethod Detail |
public java.lang.String getName()
public FsmClass getFsmClass()
public void setInitialState(State initialState)
initialState
- the initial fsm statepublic State getInitialState()
public void setDefaultPerformative(Performative defaultPerformative)
defaultPerformative
- the default performative for the initial state, for those
cases in which the performative is computed, rather than input directly from the userpublic Performative getDefaultPerformative()
public void addState(State fsmState)
fsmFsmState
- the FSM node identified by its stateIdpublic void addState(java.lang.String stateId, State fsmState)
stateId
- the given stateIdfsmState
- the FSM node identified by the stateIdpublic State getState(java.lang.String stateId)
stateId
- the state idpublic java.lang.String toString()
toString
in class java.lang.Object
protected void validateIntegrity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |