Class FeedBackDelay
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity<T>
-
- ptolemy.actor.AtomicActor<TypedIOPort>
-
- ptolemy.actor.TypedAtomicActor
-
- ptolemy.domains.dde.kernel.DDEActor
-
- ptolemy.domains.dde.kernel.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)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description Parameter
delay
The delay for this actor.TypedIOPort
input
The input port.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
The output port.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.TypedAtomicActor
_typesValid
-
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
getNextToken
-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Field Detail
-
delay
public Parameter delay
The delay for this actor. The initial default value is a double with value 1.0.
-
input
public TypedIOPort input
The input port.
-
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
The output port.
-
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
-
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 interfaceExecutable
- Overrides:
fire
in classAtomicActor<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.
-
initialize
public void initialize() throws IllegalActionException
Initialize this actor by setting all receivers so that they do not hide NullTokens.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- If there is an error when when attempting to access the receivers of this actor.- See Also:
NullToken
,DDEReceiver
-
-