Comparator

The comparator of the PSO is specified using the ComparisonType enumerator class.

One of the following can be specified:

Type

Description

Disable

This comparator always yields false.

Equal

This comparator yields true when the source moves past one of the data points. This occurs if the source is greater than or equal to a data point this cycle and less than that data point in the previous cycle, or if the source is less than or equal to a data point this cycle and greater than that data point in the previous cycle. The comparator yields true for exactly one cycle as the source passes through a data point, regardless of the velocity of the source. The source must be moving (the value of the source this cycle must be different from the value of the source last cycle) for this comparator to yield true. If the source moves to and stops at exactly the value of a data point, the comparator still yields true for one cycle.

PositiveDirection

This comparator yields true when the source moves past one of the data points while moving in the positive direction. This occurs if the source is greater than or equal to a data point this cycle and less than that data point in the previous cycle. The other specifications are the same as the Equal comparator.

NegativeDirection

This comparator yields true when the source moves past one of the data points while moving in the negative direction. This occurs if the source is less than or equal to a data point this cycle and greater than that data point in the previous cycle. The other specifications are the same as the Equal comparator.

MoreThan

This comparator yields true when the source is greater than or equal to one of the data points. The comparator effectively yields true when the source is greater than or equal to the smallest data point.

LessThan

This comparator yields true when the source is less than or equal to one of the data points. The comparator effectively yields true when the source is less than or equal to the largest data point.