Package ptolemy.domains.modal.kernel
Class Action
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.AbstractSettableAttribute
-
- ptolemy.kernel.util.StringAttribute
-
- ptolemy.domains.modal.kernel.Action
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
- Direct Known Subclasses:
AbstractActionsAttribute
public abstract class Action extends StringAttribute
An Action is contained by a Transition in an FSMActor or an Event in an ERGController.When the FSMActor is fired, an enabled transition among the outgoing transitions of the current state is chosen. The choice actions contained by the chosen transition are executed. An action is a choice action if it implements the ChoiceAction marker interface. A choice action may be executed more than once during an iteration in domains with fixed-point semantics.
When the FSMActor is postfired, the chosen transition of the latest firing of the actor is committed. The commit actions contained by the transition are executed and the current state of the actor is set to the destination state of the transition. An action is a commit action if it implements the CommitAction marker interface.
- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Xiaojun Liu
- See Also:
ChoiceAction
,CommitAction
,Transition
,FSMActor
,Variable
- Pt.AcceptedRating:
- Yellow (liuxj)
- Pt.ProposedRating:
- Yellow (liuxj)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
execute()
Execute the action.abstract java.util.List
getDestinations()
Return the list of destinations of assignments in this action.void
setContainer(NamedObj container)
Set the container of this action.-
Methods inherited from class ptolemy.kernel.util.StringAttribute
_propagateValue, addValueListener, clone, exportMoML, getExpression, getVisibility, removeValueListener, setExpression, setVisibility, validate
-
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute
getDefaultExpression, getValueAsString
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
-
Methods inherited from interface ptolemy.kernel.util.Settable
getDisplayName
-
-
-
-
Constructor Detail
-
Action
public Action(Workspace workspace)
Construct an action in the specified workspace with an empty string as a name. The object is added to the directory of the workspace. Increment the version number of the workspace.- Parameters:
workspace
- The workspace that will list the attribute.
-
Action
public Action(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an action with the given name contained by the specified container. The container argument must not be null, or a NullPointerException will be thrown. This action will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.- Parameters:
container
- The container.name
- The name of this action.- Throws:
IllegalActionException
- If the action is not of an acceptable class for the container, or if the name contains a period.NameDuplicationException
- If the container already has an attribute with the name.
-
-
Method Detail
-
execute
public abstract void execute() throws IllegalActionException
Execute the action.- Throws:
IllegalActionException
- If the action cannot be successfully completed.
-
getDestinations
public abstract java.util.List getDestinations() throws IllegalActionException
Return the list of destinations of assignments in this action.- Returns:
- A list of IOPort for output actions, and a list of parameters for set actions.
- Throws:
IllegalActionException
- If the destination list cannot be constructed.
-
setContainer
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Set the container of this action. The proposed container must be an instance of Transition or Event or null, otherwise an IllegalActionException will be thrown. A null argument will remove the action from its container.- Overrides:
setContainer
in classAttribute
- Parameters:
container
- The proposed container.- Throws:
IllegalActionException
- If setting the container would result in a recursive containment structure, or if this action and container are not in the same workspace, or if the argument is not an instance of Transition or null.NameDuplicationException
- If the container already has an attribute with the name of this action.- See Also:
Attribute.getContainer()
-
-