A DE actor to compare the time stamps of events at its two input ports, and
output the difference. Every time an event can be processed either at input
port <code>input1</code> or at <code>input2</code>, the event is consumed. The
value that the event carries is insignificant, but the time stamp of the event
is recorded in a local list. Time stamps received at the two input ports are
stored in two different lists. Every time when both lists have data, the
difference between the top elements of the lists is obtained, and is sent to
the output port. This done by subtracting the time stamp of every top event in
the list for <code>input2</code> with the time stamp of every top event in the
list for <code>input1</code>.
<p>
This actor could potentially consume an infinite amount of memory if the
arrival rates of events at the two input ports are different, because one of
the lists keeps growing.
Thomas Huining Feng
$Id: TimeCompare.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 8.0
Red (tfeng)
Red (tfeng)
The first input port.
The second input port.
The output port to which difference values are sent.
A boolean parameter to decide whether inputs at input2 should be ignored
if they lead to negative outputs.