Class NormalBoundaryDivisions

java.lang.Object
org.moeaframework.util.weights.NormalBoundaryDivisions

public class NormalBoundaryDivisions extends Object
Stores the number of reference point divisions and calculations based on those values.
  • 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 divisions
      innerDivisions - the number of inner divisions
      Throws:
      IllegalArgumentException - if outerDivisions or innerDivisions 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. If 0, then only divisionsOuter is used. If non-zero, then the two-layer generation approach is taken.
      Returns:
      the number of inner divisions
    • getNumberOfReferencePoints

      public int getNumberOfReferencePoints(Problem problem)
      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()
      Returns true 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

      public TypedProperties toProperties()
      Returns the properties used to configure an identical number of divisions.
      Returns:
      the properties
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • fromProperties

      public static NormalBoundaryDivisions fromProperties(TypedProperties properties, Problem problem)
      Reads the divisions properties, if set, or provides default values for the problem.
      Parameters:
      properties - the properties
      problem - the problem
      Returns:
      the divisions
    • tryFromProperties

      public static NormalBoundaryDivisions tryFromProperties(TypedProperties properties)
      Reads the division properties, if set. Otherwise, returns null.
      Parameters:
      properties - the properties
      Returns:
      the divisions or null
    • forProblem

      public static NormalBoundaryDivisions forProblem(Problem problem)
      Returns the default number of divisions based on the number of objectives.
      Parameters:
      problem - the problem
      Returns:
      the reference point divisions