ptolemy.domains.sdf.lib
Class LineCoder
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.sdf.lib.SDFTransformer
ptolemy.domains.sdf.lib.LineCoder
- All Implemented Interfaces:
- Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, SequenceActor, java.io.Serializable, TypedActor
- public class LineCoder
- extends SDFTransformer
A line coder, which converts a sequence of booleans into symbols.
- Since:
- Ptolemy II 0.2
- Version:
- $Id: LineCoder.java,v 1.44 2004/04/13 03:35:35 cxh Exp $
- Author:
- Edward A. Lee, Steve Neuendorffer
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
|
Field Summary |
Parameter |
table
The code table. |
Parameter |
wordLength
The word length is the number of boolean inputs that are consumed
to construct an index into the table. |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Constructor Summary |
LineCoder(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
initialOutputs. |
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace. |
void |
fire()
Consume the inputs and produce the corresponding symbol. |
void |
preinitialize()
Set up the consumption constant. |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, postfire, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup |
| 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.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 |
table
public Parameter table
- The code table. Its value is a token of type ArrayToken.
The array provides the symbol values to produce on the output.
The number of values in this array must be at least
2wordLength, or an exception
will be thrown. The number of tokens consumed by this actor when
it fires is log2(tableSize), where
tableSize is the length of the table. If all of these
values are false, then the first array entry is produced
as an output. If only the first one is true, then then second
array value is produced. In general, the N inputs consumed
are taken to be a binary digit that indexes the array,
where the first input is taken to be the low-order bit of the array.
The default code table has two entries, -1.0
and 1.0, so that input false values are mapped to -1.0,
and input true values are mapped to +1.0.
wordLength
public Parameter wordLength
- The word length is the number of boolean inputs that are consumed
to construct an index into the table. Its value is an IntToken,
with default value one.
LineCoder
public LineCoder(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.
attributeTypeChanged
public void attributeTypeChanged(Attribute attribute)
throws IllegalActionException
- Override the base class to allow type changes on
initialOutputs.
- Overrides:
attributeTypeChanged in class TypedAtomicActor
- Parameters:
attribute - The attribute whose type changed.
- Throws:
IllegalActionException - If type changes are not
allowed on the specified attribute.
clone
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
- Clone the actor into the specified workspace. This calls the
base class and then resets the type constraints.
- Overrides:
clone in class AtomicActor
- 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 IllegalActionException
- Consume the inputs and produce the corresponding symbol.
- Specified by:
fire in interface Executable- Overrides:
fire in class AtomicActor
- Throws:
IllegalActionException - If a runtime type error occurs.
preinitialize
public void preinitialize()
throws IllegalActionException
- Set up the consumption constant.
- Specified by:
preinitialize in interface Executable- Overrides:
preinitialize in class AtomicActor
- Throws:
IllegalActionException - If the length of the table is not
a power of two.