Sampler
ptolemy.domains.de.lib.Sampler

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> 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.

Author(s): Jie Liu, Edward A. Lee, Steve Neuendorffer, Elaine Cheong
Version:$Id: Sampler.doc.html,v 1.1 2006/02/22 18:41:22 mangal Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Yellow (eal)


trigger
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.


initialValue
The value that is output when no input has yet been received. The type should be the same as the input port.