Conditionally merge the streams at two input ports
depending on the value of the boolean control input.
In the first firing, this actor consumes a token from the
<i>control</i> input port.
The token at the <i>control</i> input specifies the
input port that should be read from in the next firing.
If the <i>control</i>
token is false, then the <i>falseInput</i> port is used,
otherwise the <i>trueInput</i> port is used. In the next
firing, tokens are consumed from the specified
port and sent to the <i>output</i> port.
<p>
The actor is able to fire if either it needs a new control
token and there is a token on the <i>control</i> port, or
it has read a control token and there is a token on every
channel of the specified input port.
<p>
If the input port that is read has width greater than an output port, then
some input tokens will be discarded (those on input channels for which
there is no corresponding output channel).
<p>
Because tokens are immutable, the same Token is sent
to the output, rather than a copy. The <i>trueInput</i> and
<i>falseInput</i> port may receive Tokens of any type.
<p>
This actor is designed to be used with the DDF or PN director.
It should not be used with
SDF because the number of tokens it consumes is not fixed.
It probably also does not make sense to use it
with SR or DE, because it takes two firings to transfer
a token to the output. In those domains,
<a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml">ptolemy.actor.lib.BooleanMultiplexor</a> makes more sense.
Unlike BooleanMultiplexor actor, this actor
does not discard input tokens on the port that it does not read.
Steve Neuendorffer, Adam Cataldo, Edward A. Lee, Gang Zhou
$Id: BooleanSelect.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 2.0
Green (neuendor)
Red (neuendor)
Input for tokens on the true path. The type can be anything.
Input for tokens on the false path. The type can be anything.
Input that selects one of the other input ports. The type is
BooleanToken.
The output port. The type is at least the type of
<i>trueInput</i> and <i>falseInput</i>
This parameter provides token consumption rate for <i>trueInput</i>.
The type is int.
This parameter provides token consumption rate for <i>falseInput</i>.
The type is int.
This parameter provides token consumption rate for <i>control</i>.
The type is int.