public abstract class AbstractGeneticAlgorithm extends AbstractChangeable implements GeneticAlgorithm
| Modifier and Type | Field and Description |
|---|---|
protected Population |
population |
CROSS_OVER_FUNCTION, FITNESS_FUNCTION, FUNCTION, MUTATION_FUNCTION, POPULATION, SELECTION_FUNCTION| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGeneticAlgorithm() |
| Modifier and Type | Method and Description |
|---|---|
CrossOverFunction |
getCrossOverFunction() |
FitnessFunction |
getFitnessFunction()
Returns the fitness function, i.e. the class that computes the fitness of
each organism in a population.
|
MutationFunction |
getMutationFunction() |
Population |
getPopulation()
The registered
Population |
SelectionFunction |
getSelectionFunction() |
void |
initPopulation()
Assigns a fitness value to each organism within the population according to
the currently set fitness function.
|
void |
setCrossOverFunction(CrossOverFunction function)
Changes the
CrossOverFunction used to CrossOver Chromosomes |
void |
setFitnessFunction(FitnessFunction func)
The fitness function that will be used to compute the fitness of each
organism.
|
void |
setMutationFunction(MutationFunction function)
Sets the current
MutationFunction |
void |
setPopulation(Population pop)
Sets the
Population of Organisms to the
Algorithm. |
void |
setSelectionFunction(SelectionFunction function)
Changes the
SelectionFunction used to select candidates for
the next generation |
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGeneration, runaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerprotected Population population
protected AbstractGeneticAlgorithm()
public final CrossOverFunction getCrossOverFunction()
getCrossOverFunction in interface GeneticAlgorithmpublic FitnessFunction getFitnessFunction()
GeneticAlgorithmgetFitnessFunction in interface GeneticAlgorithmpublic final MutationFunction getMutationFunction()
getMutationFunction in interface GeneticAlgorithmMutationFunctionpublic final Population getPopulation()
GeneticAlgorithmPopulationgetPopulation in interface GeneticAlgorithmPopulation being operated on.public final SelectionFunction getSelectionFunction()
getSelectionFunction in interface GeneticAlgorithmSelectionFunctionpublic void initPopulation()
public final void setCrossOverFunction(CrossOverFunction function) throws ChangeVetoException
GeneticAlgorithmCrossOverFunction used to CrossOver ChromosomessetCrossOverFunction in interface GeneticAlgorithmfunction - a CrossOverFunctionChangeVetoException - if the CrossOverFunction is not allowed to be
changedpublic final void setFitnessFunction(FitnessFunction func) throws ChangeVetoException
GeneticAlgorithmsetFitnessFunction in interface GeneticAlgorithmfunc - the FitnessFunction to be usedChangeVetoException - if the change is vetoed.public final void setMutationFunction(MutationFunction function) throws ChangeVetoException
GeneticAlgorithmMutationFunctionsetMutationFunction in interface GeneticAlgorithmfunction - a MutationFunctionChangeVetoException - if the MutationFunction change is Vetoed by a
listener.public final void setPopulation(Population pop) throws ChangeVetoException
GeneticAlgorithmPopulation of Organisms to the
Algorithm.setPopulation in interface GeneticAlgorithmpop - the population to add.ChangeVetoException - if new populations are not allowed.public final void setSelectionFunction(SelectionFunction function) throws ChangeVetoException
GeneticAlgorithmSelectionFunction used to select candidates for
the next generationsetSelectionFunction in interface GeneticAlgorithmfunction - a SelectionFunctionChangeVetoException - if the SelectionFunction is not allowed to be
changedCopyright © 2020 BioJava. All rights reserved.