Output the most recent input token when the
trigger port receives a token. If no token has been received on the
input port when a token is received on the
trigger port, then the value of the
initialValue parameter is produced. If, however, the
initialValue parameter contains no value, then no output is produced. The inputs can be of any token type, but the
output port is constrained to be of a type at least that of the
input port and the
initialValue parameter (if it has a value).
Both the input port and the output port are multiports. Generally, their widths should match. Otherwise, if the width of the input is greater than the width of the output, the extra input tokens will not appear on any output, although they will be consumed from the input port. If the width of the output is greater than that of the input, then the last few channels of the output will never emit tokens.
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.
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.
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 Jie Liu, Edward A. Lee, Steve Neuendorffer, Elaine Cheong
@version $Id: Sampler.java,v 1.46 2005/07/08 19:58:15 cxh Exp $
@since Ptolemy II 0.3
@Pt.ProposedRating Yellow (eal)
@Pt.AcceptedRating Yellow (eal)
@see ptolemy.domains.de.lib.Inhibit
@see ptolemy.domains.de.lib.Register