public final class SimpleGeneticAlgorithm extends AbstractGeneticAlgorithm
GeneticAlgorithm interface it
is not intended that this class be overidden, hence it is final. It is much
better to overide AbstractGeneticAlgorithm.populationCROSS_OVER_FUNCTION, FITNESS_FUNCTION, FUNCTION, MUTATION_FUNCTION, POPULATION, SELECTION_FUNCTION| Constructor and Description |
|---|
SimpleGeneticAlgorithm() |
SimpleGeneticAlgorithm(Population pop,
MutationFunction mutFunc,
CrossOverFunction xFunc,
SelectionFunction selFunc) |
| Modifier and Type | Method and Description |
|---|---|
List |
getCrossResults()
Get a List containing details of all the cross over events during the run.
|
int |
getGeneration()
The current generation
|
void |
run(GAStoppingCriteria stoppingCriteria)
Iterates the Algorithm until the stopping criteria are met.
|
getCrossOverFunction, getFitnessFunction, getMutationFunction, getPopulation, getSelectionFunction, initPopulation, setCrossOverFunction, setFitnessFunction, setMutationFunction, setPopulation, setSelectionFunctionaddChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SimpleGeneticAlgorithm()
public SimpleGeneticAlgorithm(Population pop, MutationFunction mutFunc, CrossOverFunction xFunc, SelectionFunction selFunc)
public int getGeneration()
public List getCrossResults()
run(GAStoppingCriteria stoppingCriteria) has not yet been called
the list will be empty.
This implementation only stores a buffer of the last 100 crosses for memory
reasons.List of GACrossResult objects.public void run(GAStoppingCriteria stoppingCriteria) throws ChangeVetoException, IllegalAlphabetException, IllegalSymbolException
GeneticAlgorithmstoppingCriteria - determines when to stop.ChangeVetoException - if the Population being modified is lockedIllegalAlphabetException - if the MutationFunction chosen attempts to modify a Symbol from
one of the Chromosomes to a Symbol outside of its Alphabet.IllegalSymbolException - if the MutationFunction chosen is using the wrong Alphabet.Copyright © 2014 BioJava. All rights reserved.