Class Pareto
- java.lang.Object
-
- io.jenetics.ext.moea.Pareto
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> double[]
crowdingDistance(BaseSeq<? extends Vec<T>> set)
The crowding distance value of a solution provides an estimate of the density of solutions surrounding that solution.static <T> double[]
crowdingDistance(BaseSeq<? extends T> set, ElementComparator<? super T> comparator, ElementDistance<? super T> distance, ToIntFunction<? super T> dimension)
The crowding distance value of a solution provides an estimate of the density of solutions surrounding that solution.static int
dominance(double[] u, double[] v)
Calculates the Pareto Dominance of the two vectors u and v.static int
dominance(int[] u, int[] v)
Calculates the Pareto Dominance of the two vectors u and v.static int
dominance(long[] u, long[] v)
Calculates the Pareto Dominance of the two vectors u and v.static <C extends Comparable<? super C>>
intdominance(C[] u, C[] v)
Calculates the Pareto Dominance of the two vectors u and v.static <T> int
dominance(T[] u, T[] v, Comparator<? super T> comparator)
Calculates the Pareto Dominance of the two vectors u and v.static <V> int
dominance(V u, V v, int dimensions, ElementComparator<? super V> comparator)
Calculates the Pareto Dominance of the two vectors u and v.static <T> ISeq<Vec<T>>
front(BaseSeq<? extends Vec<T>> set)
Return the elements, from the given inputset
, which are part of the pareto front.static <T> ISeq<T>
front(BaseSeq<? extends T> set, Comparator<? super T> dominance)
Return the elements, from the given inputset
, which are part of the pareto front.static <T> int[]
rank(BaseSeq<? extends Vec<T>> set)
Calculates the non-domination rank of the given inputset
, using the natural order of the elements as dominance measure.static <T> int[]
rank(BaseSeq<? extends T> set, Comparator<? super T> dominance)
Calculates the non-domination rank of the given inputset
, using the givendominance
comparator.
-
-
-
Method Detail
-
crowdingDistance
public static <T> double[] crowdingDistance(BaseSeq<? extends Vec<T>> set)
The crowding distance value of a solution provides an estimate of the density of solutions surrounding that solution. The crowding distance value of a particular solution is the average distance of its two neighboring solutions.- Type Parameters:
T
- the vector type- Parameters:
set
- the point set used for calculating the crowding distance- Returns:
- the crowded distances of the
set
points - Throws:
NullPointerException
- if the inputset
isnull
IllegalArgumentException
- ifset.get(0).length() < 2
- See Also:
crowdingDistance(BaseSeq, ElementComparator, ElementDistance, ToIntFunction)
- API Note:
- Calculating the crowding distance has a time complexity of
O(d*n*log(n))
, whered
is the number of dimensions andn
theset
size.
-
crowdingDistance
public static <T> double[] crowdingDistance(BaseSeq<? extends T> set, ElementComparator<? super T> comparator, ElementDistance<? super T> distance, ToIntFunction<? super T> dimension)
The crowding distance value of a solution provides an estimate of the density of solutions surrounding that solution. The crowding distance value of a particular solution is the average distance of its two neighboring solutions.- Type Parameters:
T
- the vector type- Parameters:
set
- the point set used for calculating the crowding distancecomparator
- the comparator which defines the (total) order of the vector elements ofT
distance
- the distance of two vector elementsdimension
- the dimension of vector typeT
- Returns:
- the crowded distances of the
set
points - Throws:
NullPointerException
- if one of the arguments isnull
- See Also:
crowdingDistance(BaseSeq)
- API Note:
- Calculating the crowding distance has a time complexity of
O(d*n*log(n))
, whered
is the number of dimensions andn
theset
size.
-
rank
public static <T> int[] rank(BaseSeq<? extends Vec<T>> set)
Calculates the non-domination rank of the given inputset
, using the natural order of the elements as dominance measure.- Type Parameters:
T
- the element type- Parameters:
set
- the input set- Returns:
- the non-domination rank of the given input
set
- API Note:
- Calculating the rank has a time complexity of
O(n^2
, wheren
theset
size.Reference: Kalyanmoy Deb, Associate Member, IEEE, Amrit Pratap, Sameer Agarwal, and T. Meyarivan. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II, IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. 6, NO. 2, APRIL 2002.
-
rank
public static <T> int[] rank(BaseSeq<? extends T> set, Comparator<? super T> dominance)
Calculates the non-domination rank of the given inputset
, using the givendominance
comparator.- Type Parameters:
T
- the element type- Parameters:
set
- the input setdominance
- the dominance comparator used- Returns:
- the non-domination rank of the given input
set
- API Note:
- Calculating the rank has a time and space complexity of
O(n^2
, wheren
theset
size.Reference: Kalyanmoy Deb, Associate Member, IEEE, Amrit Pratap, Sameer Agarwal, and T. Meyarivan. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II, IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. 6, NO. 2, APRIL 2002.
-
front
public static <T> ISeq<Vec<T>> front(BaseSeq<? extends Vec<T>> set)
Return the elements, from the given inputset
, which are part of the pareto front. TheComparable
interface defines the dominance measure of the elements, used for calculating the pareto front.Reference: E. Zitzler and L. Thiele. Multiobjective Evolutionary Algorithms: A Comparative Case Study and the Strength Pareto Approach, IEEE Transactions on Evolutionary Computation, vol. 3, no. 4, pp. 257-271, 1999.
- Type Parameters:
T
- the element type- Parameters:
set
- the input set- Returns:
- the elements which are part of the pareto set
- Throws:
NullPointerException
- if one of the arguments isnull
-
front
public static <T> ISeq<T> front(BaseSeq<? extends T> set, Comparator<? super T> dominance)
Return the elements, from the given inputset
, which are part of the pareto front.Reference: E. Zitzler and L. Thiele. Multiobjective Evolutionary Algorithms: A Comparative Case Study and the Strength Pareto Approach, IEEE Transactions on Evolutionary Computation, vol. 3, no. 4, pp. 257-271, 1999.
- Type Parameters:
T
- the element type- Parameters:
set
- the input setdominance
- the dominance comparator used- Returns:
- the elements which are part of the pareto set
- Throws:
NullPointerException
- if one of the arguments isnull
-
dominance
public static <C extends Comparable<? super C>> int dominance(C[] u, C[] v)
Calculates the Pareto Dominance of the two vectors u and v.- Type Parameters:
C
- the element type of vector u and v- Parameters:
u
- the first vectorv
- the second vector- Returns:
1
if u ≻ v,-1
if v ≻ u and0
otherwise- Throws:
NullPointerException
- if one of the arguments isnull
IllegalArgumentException
- ifu.length != v.length
- See Also:
Vec.dominance(Comparable[], Comparable[])
-
dominance
public static <T> int dominance(T[] u, T[] v, Comparator<? super T> comparator)
Calculates the Pareto Dominance of the two vectors u and v.- Type Parameters:
T
- the element type of vector u and v- Parameters:
u
- the first vectorv
- the second vectorcomparator
- the element comparator which is used for calculating the dominance- Returns:
1
if u ≻ v,-1
if v ≻ u and0
otherwise- Throws:
NullPointerException
- if one of the arguments isnull
IllegalArgumentException
- ifu.length != v.length
- See Also:
Vec.dominance(Object[], Object[], Comparator)
-
dominance
public static int dominance(int[] u, int[] v)
Calculates the Pareto Dominance of the two vectors u and v.- Parameters:
u
- the first vectorv
- the second vector- Returns:
1
if u ≻ v,-1
if v ≻ u and0
otherwise- Throws:
NullPointerException
- if one of the arguments isnull
IllegalArgumentException
- ifu.length != v.length
- See Also:
Vec.dominance(int[], int[])
-
dominance
public static int dominance(long[] u, long[] v)
Calculates the Pareto Dominance of the two vectors u and v.- Parameters:
u
- the first vectorv
- the second vector- Returns:
1
if u ≻ v,-1
if v ≻ u and0
otherwise- Throws:
NullPointerException
- if one of the arguments isnull
IllegalArgumentException
- ifu.length != v.length
- See Also:
Vec.dominance(long[], long[])
-
dominance
public static int dominance(double[] u, double[] v)
Calculates the Pareto Dominance of the two vectors u and v.- Parameters:
u
- the first vectorv
- the second vector- Returns:
1
if u ≻ v,-1
if v ≻ u and0
otherwise- Throws:
NullPointerException
- if one of the arguments isnull
IllegalArgumentException
- ifu.length != v.length
- See Also:
Vec.dominance(double[], double[])
-
dominance
public static <V> int dominance(V u, V v, int dimensions, ElementComparator<? super V> comparator)
Calculates the Pareto Dominance of the two vectors u and v.- Type Parameters:
V
- the vector type- Parameters:
u
- the first vectorv
- the second vectordimensions
- the number of vector elementscomparator
- the comparator used for comparing the vector elements- Returns:
1
if u ≻ v,-1
if v ≻ u and0
otherwise- Throws:
NullPointerException
- if one of the arguments isnull
- Since:
- 5.2
-
-