Output the most recent input token when the <i>trigger</i> port
receives a token. If no token has been received on the <i>input</i>
port when a token is received on the <i>trigger</i> port, then the
value of the <i>initialValue</i> parameter is produced. If, however,
the <i>initialValue</i> parameter contains no value, then no output is
produced. The inputs can be of any token type, but the <i>output</i>
port is constrained to be of a type at least that of the <i>input</i>
port and the <i>initialValue</i> parameter (if it has a value).
<p> Both the <i>input</i> port and the <i>output</i> port are multiports.
Generally, their widths should match. Otherwise, if the width of the
<i>input</i> is greater than the width of the <i>output</i>, the extra
input tokens will not appear on any output, although they will be
consumed from the input port. If the width of the <i>output</i> is
greater than that of the <i>input</i>, then the last few channels of
the <i>output</i> will never emit tokens.
<p> The <i>trigger</i> port is a multiport. Whenever a trigger is received
on any channel the actor fires and produces an output. Multiple triggers
with the same timestamp are considered as one trigger.
<p> Note: If the width of the input changes during execution, then the
most recent inputs are forgotten, as if the execution of the model
were starting over.
<p> This actor is similar to the Inhibit actor in that it modifies a
stream of events based on the presence or absence of events from
another input. This actor reacts to the presence of the other event,
whereas Inhibit reacts to the absence of it.
<p> This actor is different from the Register actor in that the input
tokens are consumed from the input ports before the outputs are generated.
Note that this actor is also different from the
<a href="../../../../ptolemy/actor/lib/Sampler.xml">ptolemy.actor.lib.Sampler</a> actor, which produces the <i>current</i> input on the
output when a <i>trigger</i> input is present, rather than the most
recently received input signal.
Jie Liu, Edward A. Lee, Steve Neuendorffer, Elaine Cheong
$Id: MostRecent.java 69608 2014-07-30 18:15:49Z cxh $
Ptolemy II 10.0
Yellow (eal)
Yellow (eal)
The trigger port, which has undeclared type. If this port
receives a token, then the most recent token from the
<i>input</i> port will be emitted on the <i>output</i> port.
The value that is output when no input has yet been received.
If this is changed during execution, then the output will match
the new value until another input is received.
The type should be the same as the input port.