Register
ptolemy.domains.de.lib.Register

A register is a stateful actor with a trigger port that accepts read requests. <p> In the fire() method, if there is an event on the <i>trigger</i> input port, this actor will produce an output event. The value of the output event will be the previously recorded event from the <i>input</i> port, or the value of the <i>initialValue</i> parameter if there has been no previous input event. If, however, <i>initialValue</i> contains no value, then no output will be produced. In the postfire() method, if there is an input event on the <i>input</i> port, then its value is recorded to be used in future firings as the value of the output. <p> 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. <p> This class extends Sampler. Unlike its base class, this actor can be used to break dependencies in a feedback loop in that the input tokens are consumed from the input ports after the outputs are generated. Another difference is that the Register actor can be fired when either the trigger port or the input port has a token, while the Sampler can only be fired when the trigger port receives a token. <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.

Author(s): Edward A. Lee, Haiyang Zheng
Version:$Id: Register.doc.html,v 1.1 2006/02/22 18:41:22 mangal Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Red (eal)