Class DoubleValueAttributeComparator<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.DoubleValueAttributeComparator<S>
All Implemented Interfaces:
java.util.Comparator<S>

public class DoubleValueAttributeComparator<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
    DoubleValueAttributeComparator​(java.lang.String name)  
    DoubleValueAttributeComparator​(java.lang.String name, AttributeComparator.Ordering ordering)  
  • Method Summary

    Modifier and Type Method Description
    int compare​(S solution1, S solution2)
    Compare two population.

    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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
  • Constructor Details

  • Method Details

    • compare

      public int compare​(S solution1, S solution2)
      Compare two population.
      Parameters:
      solution1 - Object representing the first Solution.
      solution2 - Object representing the second Solution.
      Returns:
      -1, or 0, or 1 if solution1 is has greater, equal, or less attribute value than solution2, respectively.