Interface AggregateObjectiveComparator
- All Superinterfaces:
Comparator<Solution>
,DominanceComparator
- All Known Implementing Classes:
AbstractAggregateObjectiveComparator
,LinearDominanceComparator
,LinearObjectiveComparator
,MinMaxDominanceComparator
,MinMaxObjectiveComparator
,VectorAngleDistanceScalingComparator
Compares solutions based on a computed aggregate value from the objective values. This comparator and its
implementations are intended for use with single-objective algorithms.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Calculates the aggregate value of the solution using this aggregate function.static AggregateObjectiveComparator
fromConfiguration
(TypedProperties properties) Creates an aggregate objective comparator from the given configuration.double[]
Returns the weights used by this aggregate function.static TypedProperties
toConfiguration
(AggregateObjectiveComparator comparator) Returns the configuration for the given aggregate objective comparator.Methods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.moeaframework.core.comparator.DominanceComparator
compare
-
Method Details
-
getWeights
double[] getWeights()Returns the weights used by this aggregate function.- Returns:
- the weights
-
calculate
Calculates the aggregate value of the solution using this aggregate function.- Parameters:
solution
- the solution- Returns:
- the aggregate value (smaller is better)
-
fromConfiguration
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
Returns the configuration for the given aggregate objective comparator.- Parameters:
comparator
- the comparator- Returns:
- the configuration
-