Module io.jenetics.base
Package io.jenetics.engine
Class EvolutionParams.Builder<G extends Gene<?,G>,C extends Comparable<? super C>>  
java.lang.Object
io.jenetics.engine.EvolutionParams.Builder<G,C> 
- Type Parameters:
- G- the gene type
- C- the fitness function result type
- Enclosing class:
- EvolutionParams<G extends Gene<?,G>, C extends Comparable<? super C>> 
public static final class EvolutionParams.Builder<G extends Gene<?,G>,C extends Comparable<? super C>>  
extends Object
Builder class for the evolution parameter.
- 
Method SummaryModifier and TypeMethodDescriptionalterer()Return the usedAltererof the GA.final EvolutionParams.Builder<G,C> The alterers used for alter the offspring population.build()Builds a newEvolutionParamsinstance from the set properties.evolutionParams(EvolutionParams<G, C> params) longReturn the maximal allowed phenotype age.maximalPhenotypeAge(long age) The maximal allowed age of a phenotype.doubleReturn the offspring fraction.offspringFraction(double fraction) The offspring fraction.Return the used offspringSelectorof the GA.offspringSelector(Selector<G, C> selector) The selector used for selecting the offspring population.intReturn the number of offspring.intReturn the number of individuals of a population.populationSize(int size) The number of individuals which form the population.The selector used for selecting the survivors and offspring population.Return the used survivorSelectorof the GA.survivorsSelector(Selector<G, C> selector) The selector used for selecting the survivor population.intReturn the number of survivors.
- 
Method Details- 
evolutionParams
- 
offspringSelectorThe selector used for selecting the offspring population. Default values is set toTournamentSelector<>(3).- Parameters:
- selector- used for selecting the offspring population
- Returns:
- thisbuilder, for command chaining
 
- 
survivorsSelectorThe selector used for selecting the survivor population. Default values is set toTournamentSelector<>(3).- Parameters:
- selector- used for selecting survivor population
- Returns:
- thisbuilder, for command chaining
 
- 
selectorThe selector used for selecting the survivors and offspring population. Default values is set toTournamentSelector<>(3).- Parameters:
- selector- used for selecting survivors and offspring population
- Returns:
- thisbuilder, for command chaining
 
- 
alterers@SafeVarargs public final EvolutionParams.Builder<G,C> alterers(Alterer<G, C> first, Alterer<G, C>... rest) The alterers used for alter the offspring population. Default values is set tonew SinglePointCrossover<>(0.2)followed bynew 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:
- thisbuilder, for command chaining
- Throws:
- NullPointerException- if one of the alterers is- null.
 
- 
populationSizeThe number of individuals which form the population. Default values is set to50.- Parameters:
- size- the number of individuals of a population
- Returns:
- thisbuilder, for command chaining
- Throws:
- IllegalArgumentException- if- size < 1
 
- 
offspringFractionThe offspring fraction.- Parameters:
- fraction- the offspring fraction
- Returns:
- thisbuilder, for command chaining
- Throws:
- IllegalArgumentException- if the fraction is not within the range [0, 1].
 
- 
maximalPhenotypeAgeThe maximal allowed age of a phenotype. Default values is set to70.- Parameters:
- age- the maximal phenotype age
- Returns:
- thisbuilder, for command chaining
- Throws:
- IllegalArgumentException- if- age < 1
 
- 
buildBuilds a newEvolutionParamsinstance from the set properties.- Returns:
- a new EvolutionParamsinstance from the set properties
 
- 
altererReturn the usedAltererof the GA.- Returns:
- the used Altererof the GA.
 
- 
maximalPhenotypeAgeReturn the maximal allowed phenotype age.- Returns:
- the maximal allowed phenotype age
 
- 
offspringSelectorReturn the used offspringSelectorof the GA.- Returns:
- the used offspring Selectorof the GA.
 
- 
survivorsSelectorReturn the used survivorSelectorof the GA.- Returns:
- the used survivor Selectorof the GA.
 
- 
populationSizeReturn the number of individuals of a population.- Returns:
- the number of individuals of a population
 
- 
offspringFractionReturn the offspring fraction.- Returns:
- the offspring fraction.
 
- 
offspringSizeReturn the number of offspring. This is a derived property.- Returns:
- the offspring count.
 
- 
survivorsSizeReturn the number of survivors. This is a derived property.- Returns:
- the number of survivors
 
 
-