Class NSGA2Selector<G extends Gene<?,​G>,​C extends Comparable<? super C>>

    • Constructor Detail

      • NSGA2Selector

        public NSGA2Selector​(Comparator<? super C> dominance,
                             ElementComparator<? super C> comparator,
                             ElementDistance<? super C> distance,
                             ToIntFunction<? super C> dimension)
        Creates a new NSGA2Selector with the functions needed for handling the multi-objective result type C. For the Vec classes, a selector is created like in the following example:
        new NSGA2Selector<>( Vec<T>::dominance, Vec<T>::compare, Vec<T>::distance, Vec<T>::length );
        Parameters:
        dominance - the pareto dominance comparator
        comparator - the vector element comparator
        distance - the vector element distance
        dimension - the dimensionality of vector type C
        See Also:
        ofVec()
    • Method Detail

      • ofVec

        public static <G extends Gene<?,​G>,​T,​V extends Vec<T>> NSGA2Selector<G,​V> ofVec()
        Return a new selector for the given result type V. This method is a shortcut for
        new NSGA2Selector<>( Vec<T>::dominance, Vec<T>::compare, Vec<T>::distance, Vec<T>::length );
        Type Parameters:
        G - the gene type
        T - the array type, e.g. double[]
        V - the multi object result type vector
        Returns:
        a new selector for the given result type V