Class VariableSleep

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

    public class VariableSleep
    extends Transformer
    An actor that calls Thread.sleep() on the current thread the first time fire() is called. The sleep delays the inputs for a certain amount of real time, specified by the sleepTime input.

    Note that one way to slow down the execution of a model while running inside vergil is to turn on animation.

    If the width of the output port is less than that of the input port, the tokens in the extra channels are lost.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Yang Zhao, based on Sleep by Jie Liu, Christopher Hylands
    Pt.AcceptedRating:
    Yellow (cxh)
    Pt.ProposedRating:
    Yellow (cxh)
    • Field Detail

      • defaultSleepTime

        public Parameter defaultSleepTime
        The sleepTime amount, in milliseconds This parameter must contain a LongToken. The default value of this parameter is 0, meaning that this actor will not sleep the current thread at all.
      • sleepTime

        public TypedIOPort sleepTime
        An input port receives the value of sleep time.