public class CrowdingComparator extends java.lang.Object implements DominanceComparator, java.util.Comparator<Solution>
Constructor and Description |
---|
CrowdingComparator()
Constructs a dominance comparator for comparing solutions using their
crowding distance.
|
Modifier and Type | Method and Description |
---|---|
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. |
public CrowdingComparator()
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-dominatedCopyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.