Class ActionsAttribute

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

    public class ActionsAttribute
    extends AbstractActionsAttribute
    An attribute associated with Ptera events containing executable actions. The actions are written as assignments separated with semicolons. They can be executed either to change the values of the variables assigned to, or to send output tokens to ports.

    This class is similar to CommitActionsAttribute and OutputActionsAttribute in FSM. The difference is that in Ptera, no distinction is made between commit actions and output actions. The destination of an assignment can be either a variable or a port. If a port and a variable have the same name in a Ptera model, then assigning to that name causes output to be sent to the port instead of changing the value of the variable.

    Another difference between this class and those in FSM is that in Ptera, events are allowed to receive parameters. The parameters can be referred to in the actions associated with that event.

    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Thomas Huining Feng
    See Also:
    CommitActionsAttribute
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Yellow (tfeng)
    • Constructor Detail

      • ActionsAttribute

        public ActionsAttribute​(Workspace workspace)
        Construct an ActionsAttribute in the specified workspace with an empty string as a name. The attribute is added to the directory of the workspace. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the attribute.
    • Method Detail

      • _getDestination

        protected NamedObj _getDestination​(java.lang.String name)
                                    throws IllegalActionException
        Given a destination name, return a NamedObj that matches that destination. This method never returns null (throw an exception instead).
        Specified by:
        _getDestination in class AbstractActionsAttribute
        Parameters:
        name - The name of the destination, or null if none is found.
        Returns:
        An object (like a port or a variable) with the specified name.
        Throws:
        IllegalActionException - If the associated FSMActor does not have a destination with the specified name.