Class EvolutionParams.Builder<G extends Gene<?,​G>,​C extends Comparable<? super C>>

    • Method Detail

      • offspringSelector

        public EvolutionParams.Builder<G,​CoffspringSelector​(Selector<G,​C> selector)
        The selector used for selecting the offspring population. Default values is set to TournamentSelector<>(3).
        Parameters:
        selector - used for selecting the offspring population
        Returns:
        this builder, for command chaining
      • survivorsSelector

        public EvolutionParams.Builder<G,​CsurvivorsSelector​(Selector<G,​C> selector)
        The selector used for selecting the survivors population. Default values is set to TournamentSelector<>(3).
        Parameters:
        selector - used for selecting survivors population
        Returns:
        this builder, for command chaining
      • selector

        public EvolutionParams.Builder<G,​Cselector​(Selector<G,​C> selector)
        The selector used for selecting the survivors and offspring population. Default values is set to TournamentSelector<>(3).
        Parameters:
        selector - used for selecting survivors and offspring population
        Returns:
        this builder, for command chaining
      • alterers

        @SafeVarargs
        public final EvolutionParams.Builder<G,​Calterers​(Alterer<G,​C> first,
                                                                 Alterer<G,​C>... rest)
        The alterers used for alter the offspring population. Default values is set to new SinglePointCrossover<>(0.2) followed by new Mutator<>(0.15).
        Parameters:
        first - the first alterer used for alter the offspring population
        rest - the rest of the alterers used for alter the offspring population
        Returns:
        this builder, for command chaining
        Throws:
        NullPointerException - if one of the alterers is null.
      • populationSize

        public EvolutionParams.Builder<G,​CpopulationSize​(int size)
        The number of individuals which form the population. Default values is set to 50.
        Parameters:
        size - the number of individuals of a population
        Returns:
        this builder, for command chaining
        Throws:
        IllegalArgumentException - if size < 1
      • build

        public EvolutionParams<G,​Cbuild()
        Builds an new EvolutionParams instance from the set properties.
        Returns:
        an new EvolutionParams instance from the set properties
      • maximalPhenotypeAge

        public long maximalPhenotypeAge()
        Return the maximal allowed phenotype age.
        Returns:
        the maximal allowed phenotype age
      • populationSize

        public int populationSize()
        Return the number of individuals of a population.
        Returns:
        the number of individuals of a population
      • offspringFraction

        public double offspringFraction()
        Return the offspring fraction.
        Returns:
        the offspring fraction.
      • offspringSize

        public int offspringSize()
        Return the number of offspring. This is a derived property.
        Returns:
        the offspring count.
      • survivorsSize

        public int survivorsSize()
        Return the number of survivors. This is a derived property.
        Returns:
        the number of survivors