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 TimeSchedulerclone()Clone a time scheduler.doublegetTime()Get the current time.voidinitialize(int numModel)Initialize the current time value and the number of models.voidresolve(java.lang.Iterable<metroIIcomm.Event.Builder> metroIIEventList)Resolve the time constraints.voidturnOffDebugging()Turn off debugging printing.voidturnOnDebugging()Turn on debugging printing.
-
-
-
Method Detail
-
clone
public TimeScheduler clone() throws java.lang.CloneNotSupportedException
Clone a time scheduler.- Overrides:
clonein 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:
resolvein 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.
-
-