Package ptolemy.domains.metroII.kernel
Class TimeScheduler
- java.lang.Object
-
- ptolemy.domains.metroII.kernel.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeScheduler
clone()
Clone a time scheduler.double
getTime()
Get the current time.void
initialize(int numModel)
Initialize the current time value and the number of models.void
resolve(java.lang.Iterable<metroIIcomm.Event.Builder> metroIIEventList)
Resolve the time constraints.void
turnOffDebugging()
Turn off debugging printing.void
turnOnDebugging()
Turn on debugging printing.
-
-
-
Method Detail
-
clone
public TimeScheduler clone() throws java.lang.CloneNotSupportedException
Clone a time scheduler.- Overrides:
clone
in classjava.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 interfaceConstraintSolver
- 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.
-
-