ptolemy.domains.dde.kernel
Class FeedBackDelay

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.domains.dde.kernel.DDEActor
                              extended byptolemy.domains.dde.kernel.FeedBackDelay
All Implemented Interfaces:
Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor

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: FeedBackDelay.java,v 1.26 2004/04/13 03:28:34 cxh Exp $
Author:
John S. Davis II
See Also:
NullToken, Serialized Form
Accepted Rating:
Red (yuhong)
Proposed Rating:
Red (davisj)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 Parameter delay
           
 TypedIOPort input
           
 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.
 TypedIOPort output
           
 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.
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
FeedBackDelay()
          Construct a FeedBackDelay with no container and a name that is an empty string.
FeedBackDelay(CompositeEntity container, java.lang.String name)
          Construct a FeedBackDelay with the specified container and name.
FeedBackDelay(Workspace workspace)
          Construct a FeedBackDelay with the specified workspace and a name that is an empty string.
 
Method Summary
 void fire()
          Consume a single input token and produce an identical output token.
 double getDelay()
          Return the delay value of this actor.
 void initialize()
          Initialize this actor by setting all receivers so that they do not hide NullTokens.
 
Methods inherited from class ptolemy.domains.dde.kernel.DDEActor
getLastPort, getNextToken
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, postfire, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Field Detail

delay

public Parameter delay

input

public TypedIOPort input

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.


output

public TypedIOPort output

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.

Constructor Detail

FeedBackDelay

public FeedBackDelay()
              throws IllegalActionException,
                     NameDuplicationException
Construct a FeedBackDelay with no container and a name that is an empty string.

Throws:
IllegalActionException - If the constructor of the superclass throws an IllegalActionException.
NameDuplicationException - If the constructor of the superclass throws a NameDuplicationException .

FeedBackDelay

public FeedBackDelay(Workspace workspace)
              throws IllegalActionException,
                     NameDuplicationException
Construct a FeedBackDelay with the specified workspace and a name that is an empty string.

Parameters:
workspace - The workspace for this FeedBackDelay.
Throws:
IllegalActionException - If the constructor of the superclass throws an IllegalActionException.
NameDuplicationException - If the constructor of the superclass throws a NameDuplicationException .

FeedBackDelay

public FeedBackDelay(CompositeEntity container,
                     java.lang.String name)
              throws IllegalActionException,
                     NameDuplicationException
Construct a FeedBackDelay with the specified container and name.

Parameters:
container - The container of this FeedBackDelay.
name - The name of this FeedBackDelay.
Throws:
IllegalActionException - If the constructor of the superclass throws an IllegalActionException.
NameDuplicationException - If the constructor of the superclass throws a NameDuplicationException .
Method Detail

getDelay

public double getDelay()
                throws IllegalActionException
Return the delay value of this actor.

Returns:
The delay value of this actor.
Throws:
IllegalActionException

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
Throws:
IllegalActionException - If there is an error when sending the output token or setting the current time.

initialize

public void initialize()
                throws IllegalActionException
Initialize this actor by setting all receivers so that they do not hide NullTokens.

Specified by:
initialize in interface Executable
Overrides:
initialize in class AtomicActor
Throws:
IllegalActionException - If there is an error when when attempting to access the receivers of this actor.
See Also:
NullToken, DDEReceiver