jmetal.util.comparators
Class BinaryTournamentComparator

java.lang.Object
  extended by jmetal.util.comparators.BinaryTournamentComparator
All Implemented Interfaces:
java.util.Comparator

public class BinaryTournamentComparator
extends java.lang.Object
implements java.util.Comparator

This class implements a Comparator for Solution


Constructor Summary
BinaryTournamentComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two solutions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

BinaryTournamentComparator

public BinaryTournamentComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two solutions. A Solution a is less than b for this Comparator. if the crowding distance of a if greater than the crowding distance of b.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - Object representing a Solution.
o2 - Object representing a Solution.
Returns:
-1, or 0, or 1 if o1 is less than, equals, or greater than o2, respectively.