Class AbstractEAConfiguration<T extends Comparable<T>>
- Type Parameters:
T
- Type of the fitness measurement
- Direct Known Subclasses:
EAConfiguration
,EAConfigurationBulkAsync
,GPUEAConfiguration
This describe the set of strategies to use. They describe the genotype, the different policies for selection, combination as well as mutation, and other relevant parameters
Fitness computation is delegated to subclasses to better match the various ways in which they can be computed
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Default offspring ratiostatic final Optimization
Default optimization strategy -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
check()
Validates the configurationabstract List
<ChromosomeSpec> Genotype of the populationabstract CombinationPolicy
Defines the policy to generate new offsprings from two parentsReturn a comparator based on the optimization method and natural orderDefines how to combine the offspring chromosomes generatedDefines how to generate individualsgetChromosomeSpec
(int index) Returns a specific chromosome spec from the genotype definitionabstract List
<MutationPolicy> Defines what mutations to be performed on the offspringsint
Returns the currently number of chromosomes defined in the genotypedouble
Defines how many children will be generated at each iteration.Defines the optimization goal, whether we want to maximize the fitness or minimize itabstract SelectionPolicy
Defines the policy to select the parents.abstract Optional
<Function<Population<T>, Population<T>>> Post-processing of a population after it got evaluatedDefines the replacement strategySeed the initial population with specific individualsabstract Termination
<T> Defines termination condition
-
Field Details
-
DEFAULT_OFFSPRING_RATIO
public static final double DEFAULT_OFFSPRING_RATIODefault offspring ratio- See Also:
-
DEFAULT_OPTIMIZATION
Default optimization strategy
-
-
Constructor Details
-
AbstractEAConfiguration
public AbstractEAConfiguration()
-
-
Method Details
-
chromosomeSpecs
Genotype of the population- Returns:
-
parentSelectionPolicy
Defines the policy to select the parents. The selected parents will be used for generating the new offsprings- Returns:
-
combinationPolicy
Defines the policy to generate new offsprings from two parents- Returns:
-
mutationPolicies
Defines what mutations to be performed on the offsprings- Returns:
-
replacementStrategy
Defines the replacement strategyThe replacement strategy is what will determine the next population based on the generated and mutated offsprings along with the current population
If not specified, the default replacement strategy will be to use Elitism with tournament selection of 3 individuals for both offsprings and survivors. The default offspring ratio is
Elitism.DEFAULT_OFFSPRING_RATIO
- Returns:
-
postEvaluationProcessor
Post-processing of a population after it got evaluatedThis gives the opportunity to filter out, repair or rescore individuals
- Returns:
- Population to be used by the remaining evolution process
-
termination
Defines termination condition- Returns:
-
genotypeGenerator
Defines how to generate individualsIf not specified, the system will rely on the chromosome factories
- Returns:
-
seedPopulation
Seed the initial population with specific individuals- Returns:
-
genotypeCombinator
Defines how to combine the offspring chromosomes generatedCombination of individuals is done on a per chromosome basis. This means some parents may generate a different number of children for each chromosome. This method will therefore define how to take all these generated chromosomes and combine them into offspring individuals
The current default implementation is to generate as many individual as there are combinations of generated chromosomes
- Returns:
-
offspringGeneratedRatio
@Default public double offspringGeneratedRatio()Defines how many children will be generated at each iteration. Value must be between 0 and 1 (inclusive) and represents a fraction of the population size- Returns:
-
optimization
Defines the optimization goal, whether we want to maximize the fitness or minimize it- Returns:
-
check
@Check protected void check()Validates the configuration -
getChromosomeSpec
Returns a specific chromosome spec from the genotype definition- Parameters:
index
-- Returns:
-
numChromosomes
public int numChromosomes()Returns the currently number of chromosomes defined in the genotype- Returns:
-
fitnessComparator
Return a comparator based on the optimization method and natural order- Returns:
-