Package io.jenetics

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

  • All Implemented Interfaces:
    Selector<G,​C>

    public final class MonteCarloSelector<G extends Gene<?,​G>,​C extends Comparable<? super C>>
    extends Object
    implements Selector<G,​C>
    The Monte Carlo selector selects the individuals from a given population randomly. This selector can be used to measure the performance of a other selectors. In general, the performance of a selector should be better than the selection performance of the Monte Carlo selector.
    Since:
    1.0
    Version:
    5.0
    • Method Detail

      • select

        public ISeq<Phenotype<G,​C>> select​(Seq<Phenotype<G,​C>> population,
                                                 int count,
                                                 Optimize opt)
        Description copied from interface: Selector
        Select phenotypes from the Population.
        Specified by:
        select in interface Selector<G extends Gene<?,​G>,​C extends Comparable<? super C>>
        Parameters:
        population - The population to select from.
        count - The number of phenotypes to select.
        opt - Determines whether the individuals with higher fitness values or lower fitness values must be selected. This parameter determines whether the GA maximizes or minimizes the fitness function.
        Returns:
        The selected phenotypes (a new Population).