public class LinearObjectiveComparator extends java.lang.Object implements AggregateObjectiveComparator
Constructor and Description |
---|
LinearObjectiveComparator()
Constructs a new comparator using a weighted linear aggregate function.
|
LinearObjectiveComparator(double... weights)
Constructs a new comparator using a weighted linear aggregate function.
|
Modifier and Type | Method and Description |
---|---|
double |
calculateFitness(Solution solution)
Calculates the aggregate (fitness) value of the solution using this aggregate function.
|
static double |
calculateFitness(Solution solution,
double[] weights)
Computes the weighted linear aggregate fitness of the solution.
|
int |
compare(Solution solution1,
Solution solution2)
Compares the two solutions using a dominance relation, returning
-1 if solution1 dominates solution2 , 1 if
solution2 dominates solution1 , and 0 if the
solutions are non-dominated. |
double[] |
getWeights()
Returns the weights used by this aggregate function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromConfiguration, toConfiguration
public LinearObjectiveComparator()
public LinearObjectiveComparator(double... weights)
weights
- the weight vectorpublic double[] getWeights()
AggregateObjectiveComparator
getWeights
in interface AggregateObjectiveComparator
public int compare(Solution solution1, Solution solution2)
DominanceComparator
-1
if solution1
dominates solution2
, 1
if
solution2
dominates solution1
, and 0
if the
solutions are non-dominated.compare
in interface java.util.Comparator<Solution>
compare
in interface DominanceComparator
solution1
- the first solutionsolution2
- the second solution-1
if solution1
dominates solution2
,
1
if solution2
dominates solution1
, and
0
if the solutions are non-dominatedpublic double calculateFitness(Solution solution)
AggregateObjectiveComparator
calculateFitness
in interface AggregateObjectiveComparator
solution
- the solutionpublic static double calculateFitness(Solution solution, double[] weights)
solution
- the solutionweights
- the weight vectorCopyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.