Class Timer

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

    @Deprecated
    public class Timer
    extends DETransformer
    Deprecated.
    Use VariableDelay instead, which is essentially identical, or ResettableTimer for a more reasonable timer behavior.
    A timer actor delays an event with a time delay specified by its input.

    When a timer actor receives an input, if the input value is bigger than 0.0, the timer schedules itself to fire again some time later to generate an output. The amount of delay is specified by the input value. The value of output is specified by the value parameter of this actor. If the input value is 0.0, an output is produced in the next firing with a bigger microstep. If the input is less than 0.0, an exception will be thrown.

    This actor is different from the NonInterruptibleTimer actor because the NonInterruptibleTimer actor delays the processing of a new input if it has not finished processing a previous input, while the Timer actor begins processing inputs immediately upon their arrival.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Jie Liu, Edward A. Lee, Haiyang Zheng
    Pt.AcceptedRating:
    Yellow (hyzheng)
    Pt.ProposedRating:
    Yellow (hyzheng)
    • Field Detail

      • value

        public Parameter value
        Deprecated.
        The value produced at the output. This can have any type, and it defaults to a boolean token with value true.
      • _causalityInterface

        protected CausalityInterface _causalityInterface
        Deprecated.
        The causality interface, if it has been created.
      • _delay

        protected double _delay
        Deprecated.
        The amount of delay.
      • _delayedOutputTokens

        protected CalendarQueue _delayedOutputTokens
        Deprecated.
        A local queue to store the delayed tokens.
      • _currentInput

        protected Token _currentInput
        Deprecated.
        Current input.
      • _currentOutput

        protected Token _currentOutput
        Deprecated.
        Current output.
    • Constructor Detail

      • Timer

        public Timer​(CompositeEntity container,
                     java.lang.String name)
              throws NameDuplicationException,
                     IllegalActionException
        Deprecated.
        Construct an actor with the specified container and name. Declare that the input can only receive double tokens and the output has a data type the same as the value parameter.
        Parameters:
        container - The container.
        name - The name of this actor.
        Throws:
        IllegalActionException - If the entity cannot be contained by the proposed container.
        NameDuplicationException - If the container already has an actor with this name.