A multiplexor with a boolean-valued select control signal.
This actor conditionally routes input values from the
<a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#trueInput">trueInput</a> and <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#falseInput">falseInput</a> ports to the
output port, depending on the value of the <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#select">select</a> input.
<p>
Upon firing, this actor reads the value at the <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#select">select</a> input,
if there is one, and records its value (true or false).
If it has a recorded select value (from this firing or a previous
one), then it reads at most one token from both the
<a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#trueInput">trueInput</a> and the <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#falseInput">falseInput</a>, chooses one
of those tokens depending on the recorded select value,
and produces that token on the output.
Because tokens are immutable, the same Token
is sent to the output, rather than a copy.
<p>
This actor is non strict. Specifically, if either
<a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#trueInput">trueInput</a> or <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#falseInput">falseInput</a> is unknown, it may
nonetheless be able to produce an output. Hence, this actor can
be used in domains with fixed-point semantics, such as SR and Continuous.
<p>
In dataflow domains (SDF, DDF, and PN), normally all inputs will be
known and present when the actor fires. It consumes all inputs
and produces one output token. Thus, the actor behaves like an SDF
actor, producing and consuming a single token on all ports.
<p>
In DE, the actor will only consume those inputs that are available.
It does not even require a new <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#select">select</a> input on each firing.
A value provided at the <a href="../../../ptolemy/actor/lib/BooleanMultiplexor.xml#select">select</a> input will persist
and will be used in subsequent firings until a new value is provided.
If no value has ever been provided, then this actor will produce no output.
<p>
This actor is different from the <a href="../../../ptolemy/actor/lib/BooleanSelect.xml">ptolemy.actor.lib.BooleanSelect</a> actor, which consumes
one token from the control input in one firing, and
then in the next firing consumes a token from either the
trueInput or the falseInput, depending on the value of the control input.
It is also different from the <a href="../../../ptolemy/actor/lib/Select.xml">ptolemy.actor.lib.Select</a> actor, which consumes
one input from the control input and, in the same firing, one token
from the input channel given by the value of the control input.
</p>
Steve Neuendorffer, Stavros Tripakis, Edward A. Lee
$Id: BooleanMultiplexor.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 2.0
Green (neuendor)
Yellow (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
boolean.
The output port. The type is at least the type of
<i>trueInput</i> and <i>falseInput</i>