Class IntegerValueAttributeComparator<S extends Solution<?>>
java.lang.Object
org.uma.jmetal.solution.util.attribute.util.attributecomparator.AttributeComparator<S>
org.uma.jmetal.solution.util.attribute.util.attributecomparator.impl.IntegerValueAttributeComparator<S>
- All Implemented Interfaces:
java.util.Comparator<S>
public class IntegerValueAttributeComparator<S extends Solution<?>> extends AttributeComparator<S>
Compares two population according to an attribute value, which must be a double number. The higher
the value the better.
- Author:
- Antonio J. Nebro
-
Nested Class Summary
Nested classes/interfaces inherited from class org.uma.jmetal.solution.util.attribute.util.attributecomparator.AttributeComparator
AttributeComparator.Ordering -
Field Summary
Fields inherited from class org.uma.jmetal.solution.util.attribute.util.attributecomparator.AttributeComparator
attributeName, ordering -
Constructor Summary
Constructors Constructor Description IntegerValueAttributeComparator(java.lang.String name)IntegerValueAttributeComparator(java.lang.String name, AttributeComparator.Ordering ordering) -
Method Summary
-
Constructor Details
-
IntegerValueAttributeComparator
public IntegerValueAttributeComparator(java.lang.String name, AttributeComparator.Ordering ordering) -
IntegerValueAttributeComparator
public IntegerValueAttributeComparator(java.lang.String name)
-
-
Method Details
-
compare
Compare two population.- Parameters:
solution1- Object representing the firstSolution.solution2- Object representing the secondSolution.- Returns:
- -1, or 0, or 1 if solution1 is has greater, equal, or less attribute value than solution2, respectively.
-