This actor merges two monotonically nondecreasing streams of tokens into
one monotonically nondecreasing stream. On each firing, it reads data from
one of the inputs. On the first firing, it simply records that token.
On the second firing, it reads data from the other input and outputs
the smaller of the recorded token and the one it just read. If they
are equal, then it outputs the recorded token. It then
records the larger token. On each subsequent firing, it reads a token
from the input port that did not provide the recorded token, and produces
at the output the smaller of the recorded token and the one just read.
Each time it produces an output token, it also produces
<i>true</i> on the <i>selectedA</i> output
if the output token came from <i>inputA</i>, and <i>false</i>
if it came from <i>inputB</i>.
<p>
If both input sequences are nondecreasing, then the output sequence
will be nondecreasing.
Note that if the inputs are not nondecreasing, then the output is
rather complex. The key is that in each firing, it produces the smaller
of the recorded token and the token it is currently reading.
Edward A. Lee
$Id: OrderedMerge.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 2.0.1
Red (eal)
Red (eal)
The first input port, which accepts any scalar token.
The second input port, which accepts any scalar token with
the same type as the first input port.
The output port, which has the same type as the input ports.
Output port indicating whether the output token came from
<i>inputA</i>.
If true, eliminate duplicate tokens in the output stream.
This is a boolean that defaults to false.
The token consumption rate for <i>inputA</i>.
The token consumption rate for <i>inputB</i>.