public static <G extends Gene<?, G>, C extends Comparable<? super C>>
	Collector<EvolutionResult<G, C>, ?, ISeq<Phenotype<G, C>>>
	toParetoSet(
		final IntRange size,
		final Comparator<? super C> dominance,
		final ElementComparator<? super C> comparator,
		final ElementDistance<? super C> distance,
		final ToIntFunction<? super C> dimension
	) {
		requireNonNull(size);
		requireNonNull(dominance);
		requireNonNull(distance);

		if (size.getMin() < 1) {
			throw new IllegalArgumentException(format(
				"Minimal pareto set size must be greater than zero: %d",
				size.getMin()
			));
		}

		return Collector.of(
			() -> new Front<G, C>(
				size, dominance, comparator, distance, dimension),
			Front::add,
			Front::merge,
			Front::toISeq
		);
	}
public static < G extends Gene < ? , G > , C extends Comparable < ? super C > > Collector < EvolutionResult < G , C > , ? , ISeq < Phenotype < G , C > > > toParetoSet ( final IntRange size , final Comparator < ? super C > dominance , final ElementComparator < ? super C > comparator , final ElementDistance < ? super C > distance , final ToIntFunction < ? super C > dimension ) { requireNonNull ( size ) ; requireNonNull ( dominance ) ; requireNonNull ( distance ) ; if ( size . getMin ( ) < 1 ) { throw new IllegalArgumentException ( format ( "Minimal pareto set size must be greater than zero: %d" , size . getMin ( ) ) ) ; } return Collector . of ( ( ) -> new Front < G , C > ( size , dominance , comparator , distance , dimension ) , Front :: add , Front :: merge , Front :: toISeq ) ; }
Collector of {@link Phenotype} objects, who's (multi-objective) fitness
value is part of the <a href="https://en.wikipedia.org/wiki/Pareto_efficiency">
pareto front</a>.

@see #toParetoSet(IntRange)

@param size the allowed size range of the returned pareto set. If the
size of the pareto set is bigger than {@code size.getMax()},
during the collection, it is reduced to {@code size.getMin()}.
Pareto set elements which are close to each other are removed firsts.
@param dominance the pareto dominance measure of the fitness result type
{@code C}
@param comparator the comparator of the elements of the vector type
{@code C}
@param distance the distance function of two elements of the vector
type {@code C}
@param dimension the dimensionality of the result vector {@code C}.
Usually {@code Vec::length}.
@param <G> the gene type
@param <C> the multi object result vector. E.g. {@code Vec<double[]>}
@return the pareto set collector
@throws NullPointerException if one the arguments is {@code null}
@throws IllegalArgumentException if the minimal pareto set {@code size}
is smaller than one