Class HDFDirector

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

    public class HDFDirector
    extends SDFDirector
    The Heterochronous Dataflow (HDF) domain is an extension of the Synchronous Dataflow (SDF) domain and implements the HDF model of computation [1]. In SDF, the set of port rates (called rate signatures) of an actor are constant. In HDF, however, rate signatures are allowed to change between iterations of the HDF schedule.

    This director is often used with HDFFSMDirector. The HDFFSMDirector governs the execution of a modal model. The change of rate signatures can be modeled by state transitions of the modal model, in which each state refinement infers a set of rate signatures. Within each state, the HDF model behaves like an SDF model.

    This director recomputes the schedules dynamically. To improve efficiency, this director uses a CachedSDFScheduler. A CachedSDFScheduler caches schedules labeled by their corresponding rate signatures, with the most recently used at the beginning of the queue. Therefore, when a state in HDF is revisited, the schedule identified by its rate signatures in the cache is used. We do not need to recompute the schedule.

    The size of the cache in the CachedSDFScheduler is set by the scheduleCacheSize parameter of HDFDirector. The default value of this parameter is 100. If the cache is full, the least recently used schedule (at the end of the cache) is discarded.

    References

    1. A. Girault, B. Lee, and E. A. Lee, `` Hierarchical Finite State Machines with Multiple Concurrency Models, '' April 13, 1998.
    Since:
    Ptolemy II 5.0
    Version:
    $Id$
    Author:
    Ye Zhou. Contributor: Brian K. Vogel
    See Also:
    HDFFSMDirector, CachedSDFScheduler
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (zhouye)
    • Field Detail

      • scheduleCacheSize

        public Parameter scheduleCacheSize
        A parameter representing the size of the schedule cache to use. If the value is less than or equal to zero, then schedules will never be discarded from the cache. The default value is 100.

        Note that the number of schedules in an HDF model can be exponential in the number of actors. Setting the cache size to a very large value is therefore not recommended if the model contains a large number of HDF actors.

    • Constructor Detail

      • HDFDirector

        public HDFDirector()
                    throws IllegalActionException,
                           NameDuplicationException
        Construct 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.
      • HDFDirector

        public HDFDirector​(Workspace workspace)
                    throws IllegalActionException,
                           NameDuplicationException
        Construct a director in the 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.
      • HDFDirector

        public HDFDirector​(CompositeEntity container,
                           java.lang.String name)
                    throws IllegalActionException,
                           NameDuplicationException
        Construct 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. The HDFDirector will have a default scheduler of type SDFScheduler.
        Parameters:
        container - Container of the director.
        name - Name of this director.
        Throws:
        IllegalActionException - If the director is not compatible with the specified container. May be thrown in a derived class.
        NameDuplicationException - If the container is not a CompositeActor and the name collides with an entity in the container.