Package org.moeaframework.core
Class Epsilons
java.lang.Object
org.moeaframework.core.Epsilons
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
double
get
(int objective) Returns the ε value for the specified objective.int
hashCode()
static Epsilons
of
(double e1, double... es) Creates anEpsilons
instance with the given epsilon values.int
size()
Returns the number of defined ε values.double[]
toArray()
Returns the array of ε values.toString()
-
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() -
equals
-
toString
-
of
Creates anEpsilons
instance with the given epsilon values. This method provides compile-time checking of the number of inputs.- Parameters:
e1
- the first epsilones
- the remaining epsilons, if any- Returns:
- the epsilons object
-