Class FeedBackDelay

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

    public class FeedBackDelay
    extends DDEActor
    FeedBackDelay actors are used to add delay to feedback topologies. If a FeedBackDelay actor consumes a token (real or Null), it has the option of producing an equivalent token on the output with an incremented time stamp value. Alternatively, the FeedBackDelay actor will simply produce the token without altering the time stamp.

    Two parameters - nullDelay and realDelay - are available for determining whether an FeedBackDelay actor increments the time stamp of produced output tokens. The default value of nullDelay (realDelay) is true (false). If the nullDelay (realDelay) parameter is set to true, then the time stamps of NullTokens (real tokens) will be incremented as they pass through this actor.

    The delay value that is applied (given that one of the above parameters is true) is determined by the setDelay() and getDelay() methods. More elaborate delay values can be made available by overriding the getDelay() method in derived classes.

    FeedBackDelay actors are effective for preventing Zeno conditions involving cycles of null tokens. If a DDE model has a feedback topology, a FeedBackDelay actor should be added into the feedback loop.

    The delay value of a FeedBackDelay actor must be wisely chosen. The delay value should be smaller than any other successive time stamp increment found in a given DDE model. This means that if a particular model might have any two time stamps with time difference delta, then the delay value should be smaller than delta.

    Since:
    Ptolemy II 0.4
    Version:
    $Id$
    Author:
    John S. Davis II
    See Also:
    NullToken
    Pt.AcceptedRating:
    Red (yuhong)
    Pt.ProposedRating:
    Red (davisj)
    • Field Detail

      • delay

        public Parameter delay
        The delay for this actor. The initial default value is a double with value 1.0.
      • nullDelay

        public Parameter nullDelay
        The boolean parameter that indicates whether a delay value will be added to the time stamp of null tokens that are produced by this actor. This parameter defaults to true.
      • realDelay

        public Parameter realDelay
        The boolean parameter that indicates whether a delay value will be added to the time stamp of real tokens that are produced by this actor. This parameter defaults to false.
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Consume a single input token and produce an identical output token. If the input token is a NullToken and the nullDelay parameter is set to true, then produce an output NullToken to have a time stamp with a delay specified by getDelay(). Otherwise produce a NullToken that does not have a delayed time stamp value. If the input token is a real token and the realDelay parameter is set to true, then produce an output real token to have a time stamp with a delay specified by getDelay(). Otherwise produce a real token that does not have a delayed time stamp value.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class AtomicActor<TypedIOPort>
        Throws:
        IllegalActionException - If there is an error when sending the output token or setting the current time.
      • getDelay

        public double getDelay()
                        throws IllegalActionException
        Return the delay value of this actor.
        Returns:
        The delay value of this actor.
        Throws:
        IllegalActionException - If there is a problem reading the delay token.