|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.domains.fsm.kernel.State
public class State
A State has two ports: one for linking incoming transitions, the other for outgoing transitions. When the FSMActor containing a state is the mode controller of a modal model, the state can be refined by one or more instances of TypedActor. The refinements must have the same container as the FSMActor. During execution of a modal model, only the mode controller and the refinements of the current state of the mode controller react to input to the modal model and produce output. The outgoing transitions from a state are either preemptive or non-preemptive. When a modal model is fired, if a preemptive transition from the current state of the mode controller is chosen, the refinements of the current state are not fired. Otherwise the refinements are fired before choosing a non-preemptive transition.
Transition
,
FSMActor
,
FSMDirector
,
Serialized Form
Yellow (kienhuis) |
Yellow (liuxj) |
Nested Class Summary | |
---|---|
private static class |
State.InvisibleModalModel
An attribute that marks a modal model is created because the designer opens a design pattern whose top-level is an FSMActor. |
private static class |
State.UpdateContentsRequest
A change request the updates the refinements of a state if it contains a configure element. |
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private Configurer |
_configurer
|
private java.lang.String |
_configureSource
|
private java.util.List |
_nonpreemptiveTransitionList
|
private java.util.List |
_preemptiveTransitionList
|
private TypedActor[] |
_refinement
|
private long |
_refinementVersion
|
private long |
_transitionListVersion
|
private boolean |
_visited
|
ComponentPort |
incomingPort
The port linking incoming transitions. |
Parameter |
isFinalState
An indicator of whether this state is a final state. |
Parameter |
isInitialState
An indicator of whether this state is the initial state. |
ComponentPort |
outgoingPort
The port linking outgoing transitions. |
StringAttribute |
refinementName
Attribute specifying one or more names of refinements. |
Parameter |
saveRefinementsInConfigurer
A boolean attribute to decide refinements of this state should be exported as configurations of this state or not. |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
State(CompositeEntity container,
java.lang.String name)
Construct a state with the given name contained by the specified composite entity. |
Method Summary | |
---|---|
protected void |
_exportMoMLContents(java.io.Writer output,
int depth)
Write a MoML description of the contents of this object, which in this class are the attributes plus the ports. |
private void |
_populateRefinements()
Move the refinements in the configurer of this state to the closest modal model above this state in the model hierarchy. |
private void |
_updateTransitionLists()
Update the cached transition lists. |
void |
attributeChanged(Attribute attribute)
React to a change in an attribute. |
java.lang.Object |
clone(Workspace workspace)
Clone the state into the specified workspace. |
void |
configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
Configure the object with data from the specified input source (a URL) and/or textual data. |
void |
dropObject(NamedObj target,
java.util.List dropObjects,
java.lang.String moml)
React to a list of objects being dropped onto a target. |
Configurer |
getConfigurer()
Get the Configurer object for this entity. |
java.lang.String |
getConfigureSource()
Return the input source that was specified the last time the configure method was called. |
java.lang.String |
getConfigureText()
Return the text string that represents the current configuration of this object. |
NamedObj |
getObjectInRefinement(java.lang.String name)
Get a NamedObj with the given name in the refinement of this state, if any. |
TypedActor[] |
getRefinement()
Return the refinements of this state. |
boolean |
isVisited()
Return true if this state has been visited. |
java.util.List |
nonpreemptiveTransitionList()
Return the list of non-preemptive outgoing transitions from this state. |
java.util.List |
preemptiveTransitionList()
Return the list of preemptive outgoing transitions from this state. |
void |
setVisited(boolean visited)
Set the flag that indicates whether this state has been visited with the given boolean value. |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_addPort, _adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, newPort, propagateExistence, setContainer, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _removePort, _validateSettables, connectedPortList, connectedPorts, connectionsChanged, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getDisplayName, getFullName, getName, getName |
Field Detail |
---|
public ComponentPort incomingPort
public Parameter isFinalState
public Parameter isInitialState
public ComponentPort outgoingPort
public StringAttribute refinementName
public Parameter saveRefinementsInConfigurer
private java.lang.String _configureSource
private Configurer _configurer
private java.util.List _nonpreemptiveTransitionList
private java.util.List _preemptiveTransitionList
private TypedActor[] _refinement
private long _refinementVersion
private long _transitionListVersion
private boolean _visited
Constructor Detail |
---|
public State(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of the state.
IllegalActionException
- If the state cannot be contained
by the proposed container.
NameDuplicationException
- If the name coincides with
that of an entity already in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If thrown by the superclass
attributeChanged() method.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class ComponentEntity
workspace
- The workspace for the new state.
java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void configure(java.net.URL base, java.lang.String source, java.lang.String text) throws java.lang.Exception
This method is defined to throw a very general exception to allow classes that implement the interface to use whatever exceptions are appropriate.
configure
in interface Configurable
base
- The base relative to which references within the input
are found, or null if this is not known, or there is none.source
- The input source, which specifies a URL, or null
if none.text
- Configuration information given as text, or null if
none.
java.lang.Exception
- If something goes wrong.public void dropObject(NamedObj target, java.util.List dropObjects, java.lang.String moml) throws IllegalActionException
dropObject
in interface DropTargetHandler
target
- The target on which the objects are dropped.dropObjects
- The list of objects dropped onto the target.moml
- The moml string generated for the dropped objects.
IllegalActionException
- If the handling is unsuccessful.public java.lang.String getConfigureSource()
getConfigureSource
in interface Configurable
public java.lang.String getConfigureText()
getConfigureText
in interface Configurable
public Configurer getConfigurer()
Configurer
object for this entity.
getConfigurer
in interface ConfigurableEntity
public NamedObj getObjectInRefinement(java.lang.String name) throws IllegalActionException
name
- The name of the NamedObj.
IllegalActionException
- If the refinement cannot be found, or
if a comma-separated list is malformed.public TypedActor[] getRefinement() throws IllegalActionException
IllegalActionException
- If the specified refinement
cannot be found, or if a comma-separated list is malformed.public boolean isVisited()
public java.util.List nonpreemptiveTransitionList()
public java.util.List preemptiveTransitionList()
public void setVisited(boolean visited)
visited
- The boolean flag indicating whether this state has been
visited.protected void _exportMoMLContents(java.io.Writer output, int depth) throws java.io.IOException
_exportMoMLContents
in class Entity
output
- The output to write to.depth
- The depth in the hierarchy, to determine indenting.
java.io.IOException
- If an I/O error occurs.NamedObj.exportMoML(Writer, int)
private void _populateRefinements() throws IllegalActionException
IllegalActionException
private void _updateTransitionLists()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |