java.lang.Object
io.jenetics.ext.moea.MOEA
Collectors for collecting final pareto-set for multi-objective
optimization.
final Problem<double[], DoubleGene, Vec<double[]>> problem = Problem.of(
v -> Vec.of(v[0]*cos(v[1]), v[0]*sin(v[1])),
Codecs.ofVector(
DoubleRange.of(0, 1),
DoubleRange.of(0, 2*PI)
)
);
final Engine<DoubleGene, Vec<double[]>> engine = Engine.builder(problem)
.alterers(
new Mutator<>(0.1),
new MeanAlterer<>())
.offspringSelector(new TournamentSelector<>(2))
.survivorsSelector(UFTournamentSelector.ofVec())
.build();
final ISeq<Phenotype<DoubleGene, Vec<double[]>>> result = engine.stream()
.limit(Limits.byFixedGeneration(50))
.collect(MOEA.toParetoSet());
- Since:
- 4.1
- Version:
- 5.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic <G extends Gene<?,G>, T, V extends Vec<T>>
Collector<EvolutionResult<G, V>, ?, ISeq<Phenotype<G, V>>> Collector ofPhenotypeobjects, who's (multi-objective) fitness value is part of the pareto front.static <G extends Gene<?,G>, T, V extends Vec<T>>
Collector<EvolutionResult<G, V>, ?, ISeq<Phenotype<G, V>>> toParetoSet(IntRange size) Collector ofPhenotypeobjects, who's (multi-objective) fitness value is part of the pareto front.static <G extends Gene<?,G>, C extends Comparable<? super C>>
Collector<EvolutionResult<G, C>, ?, ISeq<Phenotype<G, C>>> toParetoSet(IntRange size, Comparator<? super C> dominance, ElementComparator<? super C> comparator, ElementDistance<? super C> distance, ToIntFunction<? super C> dimension) Collector ofPhenotypeobjects, who's (multi-objective) fitness value is part of the pareto front.
-
Method Details
-
toParetoSet
public static <G extends Gene<?,G>, Collector<EvolutionResult<G,T, V extends Vec<T>> V>, toParetoSet()?, ISeq<Phenotype<G, V>>> Collector ofPhenotypeobjects, who's (multi-objective) fitness value is part of the pareto front.- Type Parameters:
G- the gene typeT- the array type, e.g.double[]V- the multi object result type vector- Returns:
- the pareto set collector
- Throws:
IllegalArgumentException- if the minimal pareto setsizeis smaller than one
-
toParetoSet
public static <G extends Gene<?,G>, Collector<EvolutionResult<G,T, V extends Vec<T>> V>, toParetoSet?, ISeq<Phenotype<G, V>>> (IntRange size) Collector ofPhenotypeobjects, who's (multi-objective) fitness value is part of the pareto front.- Type Parameters:
G- the gene typeT- the array type, e.g.double[]V- the multi object result type vector- Parameters:
size- the allowed size range of the returned pareto set. If the size of the pareto set is bigger thansize.getMax(), during the collection, it is reduced tosize.getMin(). Pareto set elements which are close to each other are removed first.- Returns:
- the pareto set collector
- Throws:
NullPointerException- if one thesizeisnullIllegalArgumentException- if the minimal pareto setsizeis smaller than one
-
toParetoSet
public static <G extends Gene<?,G>, Collector<EvolutionResult<G,C extends Comparable<? super C>> C>, toParetoSet?, ISeq<Phenotype<G, C>>> (IntRange size, Comparator<? super C> dominance, ElementComparator<? super C> comparator, ElementDistance<? super C> distance, ToIntFunction<? super C> dimension) Collector ofPhenotypeobjects, who's (multi-objective) fitness value is part of the pareto front.- Type Parameters:
G- the gene typeC- the multi object result vector. E.g.Vec<double[]>- Parameters:
size- the allowed size range of the returned pareto set. If the size of the pareto set is bigger thansize.getMax(), during the collection, it is reduced tosize.getMin(). Pareto set elements which are close to each other are removed first.dominance- the pareto dominance measure of the fitness result typeCcomparator- the comparator of the elements of the vector typeCdistance- the distance function of two elements of the vector typeCdimension- the dimensionality of the result vectorC. UsuallyVec::length.- Returns:
- the pareto set collector
- Throws:
NullPointerException- if one the arguments isnullIllegalArgumentException- if the minimal pareto setsizeis smaller than one- See Also:
-