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
FieldsModifier and TypeFieldDescriptionstatic final StringThe name / key used for this attribute.static final intConstant identifying the value of the best rank (aka. -
Method Summary
Modifier and TypeMethodDescriptionstatic final intgetAttribute(Solution solution) Returns the value of the attribute stored in the solution.static final booleanhasAttribute(Solution solution) Returnstrueif the solution defines this attribute;falseotherwise.isRank(int rank) Returns a predicate for identifying solutions belonging to a specific rank.static final voidsetAttribute(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
Returnstrueif the solution defines this attribute;falseotherwise.- Parameters:
solution- the solution- Returns:
trueif the solution defines this attribute;falseotherwise
-
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
-