Comparator
ptolemy.actor.lib.logic.Comparator

Compare two double-valued inputs, and output the boolean result of the comparison. The exact comparison performed is given by the comparison attribute, which can take any of the following values: The default is ">". The input ports are named left and right to indicate which side of the comparison operator their value appears on.

The tolerance parameter, which defaults to zero, defines an error tolerance. That is, the actor may produce true even if the specified test is not exactly satisfied, but rather is almost satisfied, within the specified tolerance.

Note that this actor will work with any data type that can be losslessly converted to doubles, such as integers.

Author(s): Edward A. Lee
Version:$Id: Comparator.java,v 1.23 2005/10/28 20:16:13 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Green (neuendor)


left
The left input port, which has type double.

right
The right input port, which has type double.

output
The output port, which has type boolean.



tolerance
The tolerance for the comparison. This has type double, and defaults to 0.0.