Class Action

  • All Implemented Interfaces:
    java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, Settable
    Direct Known Subclasses:

    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.

    Ptolemy II 8.0
    Xiaojun Liu
    See Also:
    ChoiceAction, CommitAction, Transition, FSMActor, Variable
    Yellow (liuxj)
    Yellow (liuxj)
    • 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.
        workspace - The workspace that will list the attribute.
      • Action

        public Action​(NamedObj container,
                      java.lang.String name)
               throws IllegalActionException,
        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.
        container - The container.
        name - The name of this action.
        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

      • getDestinations

        public abstract java.util.List getDestinations()
                                                throws IllegalActionException
        Return the list of destinations of assignments in this action.
        A list of IOPort for output actions, and a list of parameters for set actions.
        IllegalActionException - If the destination list cannot be constructed.
      • setContainer

        public void setContainer​(NamedObj container)
                          throws IllegalActionException,
        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.
        setContainer in class Attribute
        container - The proposed container.
        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: