Class MetroIISRDirector

  • All Implemented Interfaces:
    java.lang.Cloneable, Executable, Initializable, SuperdenseTimeDirector, PeriodicDirector, GetFirable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class MetroIISRDirector
    extends SRDirector
    implements GetFirable
    MetroIISRDirector is a Synchronous Reactive (SR) director that adapts to MetroII semantics.

    In MetroIISRDirector, the actor firing will first trigger a MetroII event to be PROPOSED. The firing will not be executed until the MetroII event is NOTIFIED. In other words, all the actors under MetroIISRDirector are considered as MetroII actors.

    By using a MetroIISRDirector, the user understands the firing of the MetroII actor might be affected by MetroIIDirector on the upper level and the architectural model which the MetroII actor is mapped onto. This introduces some non-determinisms and thus the way it reaches the fixed point depends on the architectural implementation. The MetroIISRDirector guarantees that the states are not updated (postfire() are not called) until the model reaches the fixed point. These non-determinisms are desirable and can be used to optimize the architectures.

    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Liangpeng Guo
    Pt.AcceptedRating:
    Red (glp)
    Pt.ProposedRating:
    Red (glp)
    • Constructor Detail

      • MetroIISRDirector

        public MetroIISRDirector()
                          throws IllegalActionException,
                                 NameDuplicationException
        Constructs a director in the default workspace with an empty string as its name. The director is added to the list of objects in the workspace. Increment the version number of the workspace.
        Throws:
        IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container.
        NameDuplicationException - If the container already contains an entity with the specified name.
      • MetroIISRDirector

        public MetroIISRDirector​(Workspace workspace)
                          throws IllegalActionException,
                                 NameDuplicationException
        Constructs a director in the given workspace with an empty name. The director is added to the list of objects in the workspace. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace for this object.
        Throws:
        IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container.
        NameDuplicationException - If the container already contains an entity with the specified name.
      • MetroIISRDirector

        public MetroIISRDirector​(CompositeEntity container,
                                 java.lang.String name)
                          throws IllegalActionException,
                                 NameDuplicationException
        Constructs a director in the given container with the given name. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace.
        Parameters:
        container - Container of the director.
        name - Name of this director.
        Throws:
        IllegalActionException - If the director is not compatible with the specified container.
        NameDuplicationException - If the name collides with an attribute in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clones the object into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there).
        Overrides:
        clone in class SRDirector
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        The new Attribute.
        Throws:
        java.lang.CloneNotSupportedException - Not thrown in this base class
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • adapter

        public net.jimblackler.Utils.YieldAdapterIterable<java.lang.Iterable<metroIIcomm.Event.Builder>> adapter()
        Returns the iterator for the caller function of getfire().
        Specified by:
        adapter in interface GetFirable
        Returns:
        iterator the iterator for the caller function of getfire().
      • getfire

        public void getfire​(net.jimblackler.Utils.ResultHandler<java.lang.Iterable<metroIIcomm.Event.Builder>> resultHandler)
                     throws net.jimblackler.Utils.CollectionAbortedException
        the actor firing will first trigger a MetroII event to be PROPOSED. The firing will not be executed until the MetroII event is NOTIFIED. In other words, all the actors under MetroIISRDirector are considered as MetroII actors. By using a MetroIISRDirector, the user understands the firing of the MetroII actor might be affected by MetroIIDirector on the upper level and the architectural model which the MetroII actor is mapped onto.
        Specified by:
        getfire in interface GetFirable
        Parameters:
        resultHandler - iterable of events 'yield returned'.
        Throws:
        net.jimblackler.Utils.CollectionAbortedException
      • _init

        public void _init()
        Initializes the object.