Class ResettableTimer

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

    public class ResettableTimer
    extends Transformer
    Produce an output after the time specified on the input has elapsed. If the input value is 0.0, then the output will be produced at the next superdense time index (i.e., on the next firing, but at the current time). If the input is negative, this actor will cancel the previously requested output, if it has not yet been produced by the time the negative input is received. The value of the output is specified by the value parameter.

    If the preemptive parameter is true (the default), then if a new input arrives before the previous timer request has expired, then that timer request is canceled. If an input arrives at the same time that the previous timer request expires, an output is produced immediately. The timer request is not cancelled.

    If the preemptive parameter is false, then the new input will cause the timer to start only after the currently pending timer (if any is pending) expires.

    When the preemptive parameter is true, this actor resembles the VariableDelay actor in the DE domain, except that arrivals of new inputs before the delay has expired causes the previously scheduled output to be canceled. Also, the output value is given in this actor by the value parameter instead of by the input.

    When the preemptive parameter is false, this actor resembles the Server actor in the DE domain, except that the time delay is specified by the single input. The Server actor, by contrast, has separate inputs for service time and payload, and the service time experienced by a payload depends on the most recently arrived service time input at the time that the payload service begins, not at the time the payload arrives.

    If this actor is used in a modal model and is in a mode that is not active for some time, then no outputs will be produced for the times it is inactive. If it becomes active again before the scheduled time to produce an output, then it will produce that output. If it is not preemptive, then upon becoming active again, it will behave as if it had been active during the intervening time, calculating when the outputs should have been produced, and discarding them if the calculated time falls in the inactive period.

    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (eal)
    Pt.ProposedRating:
    Yellow (eal)