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
ConstructorDescriptionNormalBoundaryDivisions
(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 TypeMethodDescriptionboolean
static NormalBoundaryDivisions
forProblem
(Problem problem) Returns the default number of divisions based on the number of objectives.static NormalBoundaryDivisions
fromProperties
(TypedProperties properties, Problem problem) Reads the divisions properties, if set, or provides default values for the problem.int
Returns the number of inner divisions.int
getNumberOfReferencePoints
(int numberOfObjectives) Determines the number of reference points that would be produced using the given number of objectives and divisions.int
getNumberOfReferencePoints
(Problem problem) Determines the number of reference points that would be produced using the given number of objectives and divisions.int
The number of outer divisions.int
hashCode()
boolean
Returnstrue
if 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 NormalBoundaryDivisions
tryFromProperties
(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
- ifouterDivisions
orinnerDivisions
are< 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 onlydivisionsOuter
is 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()Returnstrue
if this represents the two-layer approach where inner and outer divisions are specified.- Returns:
true
if the two-layer approach is used;false
otherwise
-
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
-