ptolemy.domains.de.lib
Class VariableDelay

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.de.kernel.DEActor
                              extended byptolemy.domains.de.lib.DETransformer
                                  extended byptolemy.domains.de.lib.VariableDelay
All Implemented Interfaces:
ptolemy.actor.Actor, ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.actor.Executable, ptolemy.kernel.util.Instantiable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, SequenceActor, java.io.Serializable, TimedActor, ptolemy.actor.TypedActor

public class VariableDelay
extends DETransformer

This actor works exactly as the ptolemy.domains.de.lib.TimedDelay actor, except that the amount of time delayed is specified by an incoming token through the delay port parameter.

Since:
Ptolemy II 1.0
Version:
$Id: VariableDelay.java,v 1.36.2.2 2004/06/20 03:10:44 cxh Exp $
Author:
Jie Liu, Haiyang Zheng
See Also:
FunctionDependency, TimedDelay, Server, SampleDelay, Serialized Form
Accepted Rating:
Red (liuj)
Proposed Rating:
Red (liuj)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
 PortParameter delay
          The amount specifying delay.
 
Fields inherited from class ptolemy.domains.de.lib.DETransformer
input, output
 
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
VariableDelay(ptolemy.kernel.CompositeEntity container, java.lang.String name)
          Construct an actor with the specified container and name.
 
Method Summary
 java.lang.Object clone(ptolemy.kernel.util.Workspace workspace)
          Clone the actor into the specified workspace.
 void fire()
          Read one token from the input and save it so that the postfire method can produce it to the output.
 boolean postfire()
          Produce token that was read in the fire() method, if there was one.
 void pruneDependencies()
          Override the base class to declare that the output does not depend on the input or delay ports in a firing.
 
Methods inherited from class ptolemy.domains.de.kernel.DEActor
newPort
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, prefire, preinitialize, 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
initialize, iterate, 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 PortParameter delay
The amount specifying delay.

Constructor Detail

VariableDelay

public VariableDelay(ptolemy.kernel.CompositeEntity container,
                     java.lang.String name)
              throws ptolemy.kernel.util.NameDuplicationException,
                     ptolemy.kernel.util.IllegalActionException
Construct an actor with the specified container and name. Specify the IODependence attribute of the input and output ports.

Parameters:
container - The composite actor to contain this one.
name - The name of this actor.
Throws:
ptolemy.kernel.util.IllegalActionException - If the entity cannot be contained by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an actor with this name.
Method Detail

clone

public java.lang.Object clone(ptolemy.kernel.util.Workspace workspace)
                       throws java.lang.CloneNotSupportedException
Clone the actor into the specified workspace. This calls the base class and then sets the parameter.

Parameters:
workspace - The workspace for the new object.
Returns:
A new actor.
Throws:
java.lang.CloneNotSupportedException - If a derived class has has an attribute that cannot be cloned.

fire

public void fire()
          throws ptolemy.kernel.util.IllegalActionException
Read one token from the input and save it so that the postfire method can produce it to the output. Read one token from the delay input, if there is any. Use the new delay for later input tokens.

Throws:
ptolemy.kernel.util.IllegalActionException - If there is no director.

postfire

public boolean postfire()
                 throws ptolemy.kernel.util.IllegalActionException
Produce token that was read in the fire() method, if there was one. The output is produced with a time offset equal to the value of the delay parameter.

Throws:
ptolemy.kernel.util.IllegalActionException - If there is no director.

pruneDependencies

public void pruneDependencies()
Override the base class to declare that the output does not depend on the input or delay ports in a firing.