ptolemy.domains.sdf.lib
Class VariableLattice

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.actor.lib.Transformer
                              extended byptolemy.actor.lib.Lattice
                                  extended byptolemy.domains.sdf.lib.VariableLattice
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, java.io.Serializable, ptolemy.actor.TypedActor

public class VariableLattice
extends Lattice

This actor implements an FIR filter with a lattice structure where the reflection coefficients are supplied at an input port. The blockSize parameter specifies the number of inputs of the filter that are processed per coefficient set provided on the newCoefficients input. If no coefficients are provided on that input port, then the default coefficients defined in the base class are used. In all other respects, the behavior of this actor is the same as that of the base class.

Since:
Ptolemy II 1.0
Version:
$Id: VariableLattice.java,v 1.20 2004/04/13 05:12:26 cxh Exp $
Author:
Edward A. Lee
See Also:
Serialized Form
Accepted Rating:
Yellow (cxh)
Proposed Rating:
Yellow (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
 ptolemy.data.expr.Parameter blockSize
          The number of inputs that use each each coefficient set.
 ptolemy.data.expr.Parameter input_tokenConsumptionRate
          The parameter that gives the number of tokens consumed by the input port.
 ptolemy.actor.TypedIOPort newCoefficients
          The input for new coefficient values.
 ptolemy.data.expr.Parameter output_tokenProductionRate
          The parameter that gives the number of tokens produces by the output port.
 
Fields inherited from class ptolemy.actor.lib.Lattice
_backward, _backwardCache, _forward, _forwardCache, _order, _reflectionCoefficients, reflectionCoefficients
 
Fields inherited from class ptolemy.actor.lib.Transformer
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
VariableLattice(ptolemy.kernel.CompositeEntity container, java.lang.String name)
          Construct an actor with the given container and name.
 
Method Summary
 void attributeChanged(ptolemy.kernel.util.Attribute attribute)
          If the argument is the blockSize parameter, then set the production and consumption attributes of the ports and invalidate the schedule.
 java.lang.Object clone(ptolemy.kernel.util.Workspace workspace)
          Clone the actor into the specified workspace.
 void fire()
          Consume the inputs and produce the outputs of the filter.
 boolean prefire()
          Return false if the input does not have enough tokens to fire.
 
Methods inherited from class ptolemy.actor.lib.Lattice
_doFilter, _reallocate, initialize, postfire
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, 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, 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, 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

blockSize

public ptolemy.data.expr.Parameter blockSize
The number of inputs that use each each coefficient set. This is an integer that defaults to 1.


newCoefficients

public ptolemy.actor.TypedIOPort newCoefficients
The input for new coefficient values. This is an array of doubles.


input_tokenConsumptionRate

public ptolemy.data.expr.Parameter input_tokenConsumptionRate
The parameter that gives the number of tokens consumed by the input port. This is set equal to blockSize.


output_tokenProductionRate

public ptolemy.data.expr.Parameter output_tokenProductionRate
The parameter that gives the number of tokens produces by the output port. This is set equal to blockSize.

Constructor Detail

VariableLattice

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

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

attributeChanged

public void attributeChanged(ptolemy.kernel.util.Attribute attribute)
                      throws ptolemy.kernel.util.IllegalActionException
If the argument is the blockSize parameter, then set the production and consumption attributes of the ports and invalidate the schedule.

Overrides:
attributeChanged in class Lattice
Parameters:
attribute - The attribute that changed.
Throws:
ptolemy.kernel.util.IllegalActionException - If the block size is invalid, or if the base class throws it.

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 resets the type constraints.

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

fire

public void fire()
          throws ptolemy.kernel.util.IllegalActionException
Consume the inputs and produce the outputs of the filter.

Specified by:
fire in interface ptolemy.actor.Executable
Overrides:
fire in class Lattice
Throws:
ptolemy.kernel.util.IllegalActionException - If parameter values are invalid, or if there is no director.

prefire

public boolean prefire()
                throws ptolemy.kernel.util.IllegalActionException
Return false if the input does not have enough tokens to fire. Otherwise, return true.

Specified by:
prefire in interface ptolemy.actor.Executable
Overrides:
prefire in class Lattice
Returns:
False if the number of input tokens available is not at least equal to the blockSize parameter.
Throws:
ptolemy.kernel.util.IllegalActionException - If the superclass throws it.