Package org.moeaframework.core.attribute
Class Rank
java.lang.Object
org.moeaframework.core.attribute.Rank
- All Implemented Interfaces:
Attribute
The rank of the solution. The rank is typically computed by non-dominated sorting, where a value of
0
indicates the solution belongs to the Pareto non-dominated front, and values > 0
indicate each successive
Pareto front.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name / key used for this attribute.static final int
Constant identifying the value of the best rank (aka. -
Method Summary
Modifier and TypeMethodDescriptionstatic final int
getAttribute
(Solution solution) Returns the value of the attribute stored in the solution.static final boolean
hasAttribute
(Solution solution) Returnstrue
if the solution defines this attribute;false
otherwise.isRank
(int rank) Returns a predicate for identifying solutions belonging to a specific rank.static final void
setAttribute
(Solution solution, int value) Sets the value of the attribute on the solution.
-
Field Details
-
ATTRIBUTE_NAME
The name / key used for this attribute.- See Also:
-
BEST_RANK
public static final int BEST_RANKConstant identifying the value of the best rank (aka. the Pareto front).- See Also:
-
-
Method Details
-
hasAttribute
Returnstrue
if the solution defines this attribute;false
otherwise.- Parameters:
solution
- the solution- Returns:
true
if the solution defines this attribute;false
otherwise
-
setAttribute
Sets the value of the attribute on the solution.- Parameters:
solution
- the solutionvalue
- the value to set
-
getAttribute
Returns the value of the attribute stored in the solution.- Parameters:
solution
- the solution- Returns:
- the stored value
-
isRank
Returns a predicate for identifying solutions belonging to a specific rank.- Parameters:
rank
- the rank- Returns:
- the predicate function
-