Class SmoothSignal

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class SmoothSignal
    extends Transformer
    Given inputs that are either doubles or SmoothTokens, 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.

    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (eal)
    Pt.ProposedRating:
    Yellow (eal)