Interface AggregateObjectiveComparator

All Superinterfaces:
Comparator<Solution>, DominanceComparator
All Known Implementing Classes:
AbstractAggregateObjectiveComparator, LinearDominanceComparator, LinearObjectiveComparator, MinMaxDominanceComparator, MinMaxObjectiveComparator, VectorAngleDistanceScalingComparator

public interface AggregateObjectiveComparator extends DominanceComparator, Comparator<Solution>
Compares solutions based on a computed aggregate fitness from the objective values. Examples could include weighted linear, weighted min-max, or vector angle distance scaling (VADS).

Implementation Note: This interface extends both the DominanceComparator and Comparator<Solution> interfaces. Since both of these interfaces provide identical int compare(Solution, Solution) methods, you may encounter a compilation error indicating the use of the compare method is ambiguous. This is the result of an important distinction between DominanceComparator and Comparator<Solution>. DominanceComparator induces a partial ordering while Comparator<Solution> provides a total ordering. In general, the two can not be interchanged except in cases where the DominanceComparator produces a total ordering, which is the case here. However, you will need to cast to one of these two interfaces in order to invoke the compare method and avoid the compilation error.

  • Method Details

    • getWeights

      double[] getWeights()
      Returns the weights used by this aggregate function.
      Returns:
      the weights
    • calculateFitness

      double calculateFitness(Solution solution)
      Calculates the aggregate (fitness) value of the solution using this aggregate function.
      Parameters:
      solution - the solution
      Returns:
      the aggregate value (smaller is better)
    • fromConfiguration

      static AggregateObjectiveComparator fromConfiguration(TypedProperties properties)
      Creates an aggregate objective comparator from the given configuration.
      Parameters:
      properties - the configuration
      Returns:
      the comparator, or null if one is not explicitly configured
    • toConfiguration

      static TypedProperties toConfiguration(AggregateObjectiveComparator comparator)
      Returns the configuration for the given aggregate objective comparator.
      Parameters:
      comparator - the comparator
      Returns:
      the configuration