public class SmoothSignal extends Transformer
SmoothToken
s, construct
a SmoothToken output. If all the inputs are doubles, then channel 0
specifies the value of the output, channel 1 specifies the first
derivative, channel 2 specifies the second derivative, etc.
If any channel is missing an input, then the most recently received
input on that channel is used.
If any of the inputs is a SmoothToken, then in addition to their values specifying the value and derivatives of the output, their derivatives will be used as the derivatives of the output. For example, if channel zero has a smoothToken(1.0, {1.0, 2.0}) and channel one has a smoothToken(2.0, {3.0}), then the output will be a smoothToken(1.0, {2.0, 3.0}).
The inputs need not arrive all at once. Each time an input arrives, the value of the input is interpreted as an update to the output value or one of the derivatives. Any previously arrived input tokens that are instances of SmoothToken are extrapolated before being used to update the output. So for example, if this actor receives only an event on channel 0 at time 0 with value smoothToken(1.0, {1.0}), then it will produce an output with value smoothToken(1.0, {1.0}) at time 0. If then at time 1 it receives only an event on channel 1 with value smoothToken(-1.0, {1.0}), then it will first extrapolate the event it previously received on channel 0, to value smoothToken(2.0, {1.0}), and then combine it with the update on channel 1 to yield smoothToken(2.0, {-1.0, 1.0}). The new token updates the first derivative to -1.0, overwriting the previously specified first derivative of 1.0. The new token also provides a second derivative 1.0. Any derivatives provided by higher numbered channels will overwrite derivatives provided by lower numbered channels.
Entity.ContainedObjectsIterator
input, output
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
SmoothSignal(CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified
name.
|
Modifier and Type | Method and Description |
---|---|
void |
fire()
Consume and record all available inputs and produce the current
value on all output channels.
|
void |
initialize()
Initialize this actor by clearing any stored inputs.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public SmoothSignal(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor within the container.IllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the name coincides with
an actor already in the container.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director or
if the number of input channels does not equal the number of
output channels.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If the width of the input does
not match the width of the output.