Class GiottoScheduler

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

    public class GiottoScheduler
    extends Scheduler
    This class generates schedules for the actors in a CompositeActor according to the Giotto semantics.

    A schedule is represented by a list. Consider the following CompositeActor:

     +-----------------------+
     |           A           |
     +-----------------------+
     +-----------------------+
     |           B           |
     +-----------------------+
     +---------+   +---------+
     |    C    |   |    C    |
     +---------+   +---------+
     
    There are three actors A, B, and C, where C runs twice as often as A and B. The list representing the schedule for this CompositeActor looks as follows:
     +-------+                         +-------+
     | | | --------------------------->| | |nil|
     +-|-----+                         +-|-----+
     |                                 |
     V                                 V
     +-------+  +-------+  +-------+   +-------+
     | | | ---->| | | ---->| | |nil|   | | |nil|
     +-|-----+  +-|-----+  +-|-----+   +-|-----+
     |          |          |           |
     V          V          V           V
     +---+      +---+      +---+       +---+
     | A |      | B |      | c |       | c |
     +---+      +---+      +---+       +---+
    
     
    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Christoph Kirsch, Haiyang Zheng
    Pt.AcceptedRating:
    Red (eal)
    Pt.ProposedRating:
    Yellow (cm)
    • Field Detail

      • _DEFAULT_GIOTTO_FREQUENCY

        protected static final int _DEFAULT_GIOTTO_FREQUENCY
        The default Giotto frequency. Actors without a frequency parameter will execute with this frequency.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GiottoScheduler

        public GiottoScheduler()
        Construct a Giotto scheduler with no container (director) in the default workspace.
      • GiottoScheduler

        public GiottoScheduler​(Workspace workspace)
        Construct a Giotto scheduler in the given workspace. If the workspace argument is null, use the default workspace. The scheduler is added to the list of objects in the workspace. Increment the version number of the workspace.
        Parameters:
        workspace - Object for synchronization and version tracking.
    • Method Detail

      • getLCM

        public int getLCM()
        Returns the LCM value.
        Returns:
        an int representing the LCM value
      • _getMinTimeStep

        protected double _getMinTimeStep​(double period)
        Return the unit of time increment for director. This method will be called by the director. It should not be called until the director call getSchedule() and the returned schedule is invalid. It is not synchronized on the workspace.
        Parameters:
        period - Giotto model period given in 'period' parameter of director
        Returns:
        unit of time increment for director.