Package org.moeaframework.util.weights
Class NormalBoundaryDivisions
java.lang.Object
org.moeaframework.util.weights.NormalBoundaryDivisions
Stores the number of reference point divisions and calculations based on those values.
-
Constructor Summary
ConstructorsConstructorDescriptionNormalBoundaryDivisions(int divisions) Use a single layer approach with a single division argument.NormalBoundaryDivisions(int outerDivisions, int innerDivisions) Use the two-layer approach with inner and outer divisions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic NormalBoundaryDivisionsforProblem(Problem problem) Returns the default number of divisions based on the number of objectives.static NormalBoundaryDivisionsfromProperties(TypedProperties properties, Problem problem) Reads the divisions properties, if set, or provides default values for the problem.intReturns the number of inner divisions.intgetNumberOfReferencePoints(int numberOfObjectives) Determines the number of reference points that would be produced using the given number of objectives and divisions.intgetNumberOfReferencePoints(Problem problem) Determines the number of reference points that would be produced using the given number of objectives and divisions.intThe number of outer divisions.inthashCode()booleanReturnstrueif this represents the two-layer approach where inner and outer divisions are specified.Returns the properties used to configure an identical number of divisions.static NormalBoundaryDivisionstryFromProperties(TypedProperties properties) Reads the division properties, if set.
-
Constructor Details
-
NormalBoundaryDivisions
public NormalBoundaryDivisions(int divisions) Use a single layer approach with a single division argument.- Parameters:
divisions- the number of divisions
-
NormalBoundaryDivisions
public NormalBoundaryDivisions(int outerDivisions, int innerDivisions) Use the two-layer approach with inner and outer divisions.- Parameters:
outerDivisions- the number of outer divisionsinnerDivisions- the number of inner divisions- Throws:
IllegalArgumentException- ifouterDivisionsorinnerDivisionsare< 0
-
-
Method Details
-
getOuterDivisions
public int getOuterDivisions()The number of outer divisions.- Returns:
- the number of outer divisions
-
getInnerDivisions
public int getInnerDivisions()Returns the number of inner divisions. If0, then onlydivisionsOuteris used. If non-zero, then the two-layer generation approach is taken.- Returns:
- the number of inner divisions
-
getNumberOfReferencePoints
Determines the number of reference points that would be produced using the given number of objectives and divisions.- Parameters:
problem- the problem- Returns:
- the number of reference points
-
getNumberOfReferencePoints
public int getNumberOfReferencePoints(int numberOfObjectives) Determines the number of reference points that would be produced using the given number of objectives and divisions.- Parameters:
numberOfObjectives- the number of objectives- Returns:
- the number of reference points
-
isTwoLayer
public boolean isTwoLayer()Returnstrueif this represents the two-layer approach where inner and outer divisions are specified.- Returns:
trueif the two-layer approach is used;falseotherwise
-
toProperties
Returns the properties used to configure an identical number of divisions.- Returns:
- the properties
-
hashCode
public int hashCode() -
equals
-
fromProperties
Reads the divisions properties, if set, or provides default values for the problem.- Parameters:
properties- the propertiesproblem- the problem- Returns:
- the divisions
-
tryFromProperties
Reads the division properties, if set. Otherwise, returnsnull.- Parameters:
properties- the properties- Returns:
- the divisions or
null
-
forProblem
Returns the default number of divisions based on the number of objectives.- Parameters:
problem- the problem- Returns:
- the reference point divisions
-