Class TimedDelay

  • 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:
    SimpleDelay

    @Deprecated
    public class TimedDelay
    extends DETransformer
    Deprecated.
    Use actor.lib.TimeDelay.
    This actor delays the input by a specified amount of time. The amount of the time is required to be non-negative and has a default value 1.0. The input and output types are unconstrained, except that the output type must be the same as that of the input.

    This actor keeps a local FIFO queue to store all received but not processed inputs. The behavior of this actor on each firing is to read a token from the input, if there is one, store it into the local queue, and output the previously received token that is scheduled to be produced at the current time.

    During the postfire() method, this actor schedules itself to fire again to produce the just received token on the corresponding output channel after the appropriate time delay. Note that if the value of delay is 0.0, the actor schedules itself to fire at the current model time.

    Occasionally, this actor is useful with the delay parameter set to 0.0. The time stamp of the output will equal that of the input, but there is a "microstep" delay. The discrete-event domain in Ptolemy II has a "super dense" model of time, meaning that a signal from one actor to another can contain multiple events with the same time stamp. These events are "simultaneous," but nonetheless have a well-defined sequential ordering determined by the order in which they are produced. If \textit{delay} is 0.0, then the fire() method of this actor always produces on its output port the event consumed in the \textit{previous iteration} with the same time stamp, if there was one. If there wasn't such a previous iteration, then it produces no output. Its postfire() method consumes and records the input for use in the next iteration, if there is such an input, and also requests a refiring at the current time. This refire request triggers the next iteration (at the same time stamp), on which the output is produced.

    A consequence of this strategy is that this actor is able to produce an output (or assert that there is no output) before the input with the same time is known. Hence, it can be used to break causality loops in feedback systems. The DE director will leverage this when determining the precedences of the actors. It is sometimes useful to think of this zero-valued delay as an infinitesimal delay.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Edward A. Lee, Lukito Muliadi, Haiyang Zheng
    See Also:
    VariableDelay, Server
    Pt.AcceptedRating:
    Yellow (hyzheng)
    Pt.ProposedRating:
    Green (hyzheng)
    • Field Detail

      • delay

        public Parameter delay
        Deprecated.
        The amount of delay. The default for this parameter is 1.0. This parameter must contain a DoubleToken with a non-negative value, or an exception will be thrown when it is set.
      • _currentInput

        protected Token _currentInput
        Deprecated.
        Current input.
      • _currentOutput

        protected Token _currentOutput
        Deprecated.
        Current output.
      • _delay

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

        protected CalendarQueue _delayedOutputTokens
        Deprecated.
        A local event queue to store the delayed output tokens.
    • Constructor Detail

      • TimedDelay

        public TimedDelay​(CompositeEntity container,
                          java.lang.String name)
                   throws NameDuplicationException,
                          IllegalActionException
        Deprecated.
        Construct an actor with the specified container and name. Constrain that the output type to be the same as the input type.
        Parameters:
        container - The composite entity to contain this one.
        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.