Class BooleanMultiplexor

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class BooleanMultiplexor
    extends TypedAtomicActor
    A multiplexor with a boolean-valued select control signal. This actor conditionally routes input values from the trueInput and falseInput ports to the output port, depending on the value of the select input.

    Upon firing, this actor reads the value at the select 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 trueInput and the falseInput, 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.

    This actor is non strict. Specifically, if either trueInput or falseInput 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.

    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.

    In DE, the actor will only consume those inputs that are available. It does not even require a new select input on each firing. A value provided at the select 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.

    This actor is different from the BooleanSelect 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 Select 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.

    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Steve Neuendorffer, Stavros Tripakis, Edward A. Lee
    Pt.AcceptedRating:
    Yellow (neuendor)
    Pt.ProposedRating:
    Green (neuendor)