ptolemy.domains.sdf.lib
Class DelayLine

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.sdf.lib.SDFTransformer
                              extended byptolemy.domains.sdf.lib.DelayLine
All Implemented Interfaces:
Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, SequenceActor, java.io.Serializable, TypedActor

public class DelayLine
extends SDFTransformer

This actor reads tokens from its input port, and for each token read outputs an array that contains the current token as the first token, followed by some number of previously read tokens. The length of the output array is the same as that of the array in the initialValues parameter. That parameter also provides the initial values when there are no previously read tokens.

Note that this actor is not a simple sample delay. Use the SampleDelay actor to achieve a simple sample delay.

Since:
Ptolemy II 1.0
Version:
$Id: DelayLine.java,v 1.21 2004/04/13 05:12:27 cxh Exp $
Author:
Steve Neuendorffer
See Also:
SampleDelay, Serialized Form
Accepted Rating:
Yellow (neuendor)
Proposed Rating:
Yellow (yuhong)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 Parameter initialValues
          The initial values of the delay line.
 
Fields inherited from class ptolemy.domains.sdf.lib.SDFTransformer
input, input_tokenConsumptionRate, output, output_tokenInitProduction, output_tokenProductionRate
 
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
DelayLine(CompositeEntity container, java.lang.String name)
          Construct an actor with the given container and name.
 
Method Summary
 void attributeTypeChanged(Attribute attribute)
          Override the base class to allow type changes on initialValues.
 void fire()
          Consume a token from the input, push it onto the delay line and produce the output ArrayToken containing the current state of the delay line.
 void initialize()
          Initialize this actor by reading the value of initialValues.
 java.util.List typeConstraintList()
          Return the type constraint that the type of the elements of the output array is no less than the type of the input port.
 
Methods inherited from class ptolemy.domains.sdf.lib.SDFTransformer
prefire
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, clone, newPort
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, 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, 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

initialValues

public Parameter initialValues
The initial values of the delay line. This parameter must contain an ArrayToken. The default value is an array that contains 4 integer tokens. Changes to this parameter after initialize() has been invoked are ignored until the next execution of the model.

Constructor Detail

DelayLine

public DelayLine(CompositeEntity container,
                 java.lang.String name)
          throws NameDuplicationException,
                 IllegalActionException
Construct an actor with the given container and name.

Parameters:
container - The container.
name - The name of this actor.
Throws:
IllegalActionException - If the actor cannot be contained by the proposed container.
NameDuplicationException - If the container already has an actor with this name.
Method Detail

attributeTypeChanged

public void attributeTypeChanged(Attribute attribute)
                          throws IllegalActionException
Override the base class to allow type changes on initialValues.

Overrides:
attributeTypeChanged in class TypedAtomicActor
Parameters:
attribute - The attribute whose type changed.
Throws:
IllegalActionException - If type changes are not allowed on the specified attribute.

fire

public void fire()
          throws IllegalActionException
Consume a token from the input, push it onto the delay line and produce the output ArrayToken containing the current state of the delay line.

Specified by:
fire in interface Executable
Overrides:
fire in class AtomicActor
Throws:
IllegalActionException - If not enough tokens are available.

initialize

public void initialize()
                throws IllegalActionException
Initialize this actor by reading the value of initialValues.

Specified by:
initialize in interface Executable
Overrides:
initialize in class AtomicActor
Throws:
IllegalActionException - If a derived class throws it.

typeConstraintList

public java.util.List typeConstraintList()
Return the type constraint that the type of the elements of the output array is no less than the type of the input port.

Specified by:
typeConstraintList in interface TypedActor
Overrides:
typeConstraintList in class TypedAtomicActor
Returns:
A list of inequalities.
See Also:
Inequality