public class PatternGA extends GeneticAlgorithm<IntegerChromosome>
GeneticAlgorithm
and how to use
the flexible and configurable breeding structure in Jenes.
The problem consists in searching a pattern of integers with a given precision.
Solutions flow through two different crossovers in parallel. Some are processed by
a single point crossover, the other by a double point crossover.
After solutions are mutated.
This class implements the algorithm by extending GeneticAlgorithm
.Modifier and Type | Class and Description |
---|---|
class |
PatternGA.PatternFitness |
GeneticAlgorithm.ElitismStrategy, GeneticAlgorithm.ResizeStrategy, GeneticAlgorithm.Statistics
algorithmListeners, body, DEFAULT_GENERATION_LIMIT, DEFAULT_HISTORY_SIZE, elitism, elitismStrategy, fullEvaluationForced, generation, generationLimit, generationListeners, initialPopulation, MAX_HISTORY_SIZE, MIN_HISTORY_SIZE, random, randomization, resizeStrategy, statistics
Constructor and Description |
---|
PatternGA(Population<IntegerChromosome> pop,
int numGen) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
end()
Provides the algorithm termination condition.
|
addAlgorithmEventListener, addGenerationEventListener, addStage, applyElitism, evaluateIndividual, evaluatePopulation, evaluatePopulation, evolve, evolve, evolve, getBody, getCurrentPopulation, getElitism, getElitismStrategy, getFitness, getGeneration, getGenerationLimit, getHistoryAt, getHistorySize, getInitialPopulation, getLastPopulation, getNextPopulation, getPool, getRandomization, getResizeStrategy, getRunner, getStatistics, isBiggerBetter, isFitnessChanged, isFullEvaluationForced, onGeneration, onInit, onStart, onStop, randomizeIndividual, randomizePopulation, removeAlgorithmEventListener, removeGenerationEventListener, setBiggerIsBetter, setElitism, setElitismStrategy, setFitness, setFullEvaluationForced, setGenerationLimit, setHistorySize, setRandomization, setRandomization, setRandomSeed, setResizeStrategy, setRunner, start, stop, toString, updateStatistics
public PatternGA(Population<IntegerChromosome> pop, int numGen)
protected boolean end()
GeneticAlgorithm
end
in class GeneticAlgorithm<IntegerChromosome>