Class Epsilons

java.lang.Object
org.moeaframework.core.Epsilons

public class Epsilons extends Object
Stores the ε values for an ε-dominance archive. In particular, if the given ε value or array of values does not match the number of objectives, the last ε value is repeated for each remaining objective.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Epsilons(double epsilon)
    Defines a single ε value repeated for each objective.
    Epsilons(double[] epsilons)
    Defines an array of ε values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    double
    get(int objective)
    Returns the ε value for the specified objective.
    int
     
    static Epsilons
    of(double e1, double... es)
    Creates an Epsilons instance with the given epsilon values.
    int
    Returns the number of defined ε values.
    double[]
    Returns the array of ε values.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Epsilons

      public Epsilons(double epsilon)
      Defines a single ε value repeated for each objective.
      Parameters:
      epsilon - the ε value
    • Epsilons

      public Epsilons(double[] epsilons)
      Defines an array of ε values.
      Parameters:
      epsilons - the array of epsilon values
      Throws:
      IllegalArgumentException - if the array is empty or any value is <= 0.0
  • Method Details

    • toArray

      public double[] toArray()
      Returns the array of ε values.
      Returns:
      the array of ε values
    • get

      public double get(int objective)
      Returns the ε value for the specified objective.
      Parameters:
      objective - the index of the objective
      Returns:
      the ε value
    • size

      public int size()
      Returns the number of defined ε values.
      Returns:
      the number of defined ε values
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object
    • of

      public static Epsilons of(double e1, double... es)
      Creates an Epsilons instance with the given epsilon values. This method provides compile-time checking of the number of inputs.
      Parameters:
      e1 - the first epsilon
      es - the remaining epsilons, if any
      Returns:
      the epsilons object