Package org.uma.jmetal.algorithm.impl
Class AbstractGeneticAlgorithm<S,Result>
java.lang.Object
org.uma.jmetal.algorithm.impl.AbstractEvolutionaryAlgorithm<S,Result>
org.uma.jmetal.algorithm.impl.AbstractGeneticAlgorithm<S,Result>
- All Implemented Interfaces:
Serializable,Runnable,Algorithm<Result>
public abstract class AbstractGeneticAlgorithm<S,Result>
extends AbstractEvolutionaryAlgorithm<S,Result>
Abstract class representing a genetic algorithm
- Author:
- Antonio J. Nebro
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CrossoverOperator<S> protected intprotected MutationOperator<S> protected SelectionOperator<List<S>, S> Fields inherited from class org.uma.jmetal.algorithm.impl.AbstractEvolutionaryAlgorithm
population, problem -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckNumberOfParents(List<S> population, int numberOfParentsForCrossover) A crossover operator is applied to a number of parents, and it assumed that the population contains a valid number of solutions.This method implements a default scheme create the initial population of genetic algorithmintreproduction(List<S> population) This method iteratively applies aCrossoverOperatoraMutationOperatorto the population to create the offspring population.This method iteratively applies aSelectionOperatorto the population to fill the mating pool population.voidsetMaxPopulationSize(int maxPopulationSize) Methods inherited from class org.uma.jmetal.algorithm.impl.AbstractEvolutionaryAlgorithm
evaluatePopulation, getPopulation, getProblem, initProgress, isStoppingConditionReached, replacement, run, setPopulation, setProblem, updateProgressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.uma.jmetal.algorithm.Algorithm
description, name, result
-
Field Details
-
maxPopulationSize
protected int maxPopulationSize -
selectionOperator
-
crossoverOperator
-
mutationOperator
-
-
Constructor Details
-
AbstractGeneticAlgorithm
-
-
Method Details
-
setMaxPopulationSize
public void setMaxPopulationSize(int maxPopulationSize) -
getMaxPopulationSize
public int getMaxPopulationSize() -
getSelectionOperator
-
getCrossoverOperator
-
getMutationOperator
-
createInitialPopulation
This method implements a default scheme create the initial population of genetic algorithm- Specified by:
createInitialPopulationin classAbstractEvolutionaryAlgorithm<S,Result> - Returns:
-
selection
This method iteratively applies aSelectionOperatorto the population to fill the mating pool population.- Specified by:
selectionin classAbstractEvolutionaryAlgorithm<S,Result> - Parameters:
population-- Returns:
- The mating pool population
-
reproduction
This method iteratively applies aCrossoverOperatoraMutationOperatorto the population to create the offspring population. The population size must be divisible by the number of parents required by theCrossoverOperator; this way, the needed parents are taken sequentially from the population. No limits are imposed to the number of solutions returned by theCrossoverOperator.- Specified by:
reproductionin classAbstractEvolutionaryAlgorithm<S,Result> - Parameters:
population-- Returns:
- The new created offspring population
-
checkNumberOfParents
-