Class TimeScheduler

  • All Implemented Interfaces:
    java.lang.Cloneable, ConstraintSolver

    public class TimeScheduler
    extends java.lang.Object
    implements ConstraintSolver, java.lang.Cloneable
    TimeScheduler is a ConstraintSolver that handles the time quantity for MetroIIDirector.
    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Liangpeng Guo
    Pt.AcceptedRating:
    Red (glp)
    Pt.ProposedRating:
    Red (glp)
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeScheduler()
      Construct a time scheduler.
    • Constructor Detail

      • TimeScheduler

        public TimeScheduler()
        Construct a time scheduler.
    • Method Detail

      • clone

        public TimeScheduler clone()
                            throws java.lang.CloneNotSupportedException
        Clone a time scheduler.
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • initialize

        public void initialize​(int numModel)
        Initialize the current time value and the number of models.
        Parameters:
        numModel - the number of models to be synchronized.
      • turnOnDebugging

        public void turnOnDebugging()
        Turn on debugging printing.
      • turnOffDebugging

        public void turnOffDebugging()
        Turn off debugging printing.
      • resolve

        public void resolve​(java.lang.Iterable<metroIIcomm.Event.Builder> metroIIEventList)
        Resolve the time constraints. Notified only the next events with the most recent time tag.
        Specified by:
        resolve in interface ConstraintSolver
        Parameters:
        metroIIEventList - a list of MetroII events to be updated.
      • getTime

        public double getTime()
        Get the current time.
        Returns:
        the double valued current time tag.