
BooleanSelect |
ptolemy.actor.lib.BooleanSelect |
A type polymorphic select with boolean valued control. In an
iteration, if an input token is available at the control input,
that token is read, and its value is noted. Its value specifies the
input port that should be read next. If the control input is
true, then if an input token is available on the trueInput
port, then it is is read and sent to the output. Likewise with a
false input and the falseInput port. The token sent to the
output is determined by the control input, which must be a
boolean value. Because tokens are immutable, the same Token is sent
to the output, rather than a copy. The trueInput and
falseInput port may receive Tokens of any type.
The actor indicates a willingness to fire in its prefire() method
if there is an input available on the channel specified by the most
recently seen token on the control port. If no token has ever
been received on the control port, then falseInput is
assumed to be the one to read.
This actor is similar to the BooleanMultiplexor actor, except that
it never discards input tokens. Tokens on channels that are not
selected are not consumed.
Author(s): Steve Neuendorffer, Adam Cataldo
Version:$Id: BooleanSelect.java,v 1.29 2005/10/28 19:20:13 cxh Exp $
Pt.Proposed Rating:Green (neuendor)
Pt.Accepted Rating:Red (neuendor)
trueInput
Input for tokens on the true path. The type can be anything.
falseInput
Input for tokens on the false path. The type can be anything.
control
Input that selects one of the other input ports. The type is
BooleanToken.
output
The output port. The type is at least the type of
trueInput and falseInput