ptolemy.actor.lib
Class VectorDisassembler
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Transformer
ptolemy.actor.lib.VectorDisassembler
- All Implemented Interfaces:
- Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor
- public class VectorDisassembler
- extends Transformer
An actor that disassembles a DoubleMatrixToken to a multiport output.
On each firing, read one column vector (i.e. a DoubleMatrixToken with
one column) from the input port and send out individual
DoubleTokens to each channel of the output port. If the width
of the output port (say, n) is less than the number of
rows (say, m) in the input token, then the first n
elements in the vector will be sent, and the remaining tokens are
discarded. If n is greater than m, then the last
n-m channels of the output port will never send tokens out.
This class throws an exception if the input is not a column vector.
For sequential domains like SDF, the combination of
domains.sdf.lib.MatrixToDouble and a Distributor is equivalent to this
actor. However, that combination will not work in CT, so we need this
actor.
- Since:
- Ptolemy II 2.0
- Version:
- $Id: VectorDisassembler.java,v 1.21 2004/04/13 03:05:07 cxh Exp $
- Author:
- Jie Liu, Elaine Cheong
- See Also:
VectorAssembler,
Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Method Summary |
void |
fire()
If there is a token at the input, read one column vector
(i.e. a DoubleMatrixToken with one column) from the input port,
and for each channel i of the output port, send send the ith
element of this column vector to this channel. |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, 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 |
VectorDisassembler
public VectorDisassembler(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 this actor cannot be contained
by the proposed container.
NameDuplicationException - If the container already has an
actor with this name.
fire
public void fire()
throws IllegalActionException
- If there is a token at the input, read one column vector
(i.e. a DoubleMatrixToken with one column) from the input port,
and for each channel i of the output port, send send the ith
element of this column vector to this channel. Otherwise, do
nothing.
Note: The output tokens are copies of the corresponding
elements in the input token.
- Specified by:
fire in interface Executable- Overrides:
fire in class AtomicActor
- Throws:
IllegalActionException - If there is no director, or
the input token has more than one column.