org.biojavax.ga.impl
Class AbstractGeneticAlgorithm
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.ga.impl.AbstractGeneticAlgorithm
- All Implemented Interfaces:
- Changeable, GeneticAlgorithm
- Direct Known Subclasses:
- SimpleGeneticAlgorithm
public abstract class AbstractGeneticAlgorithm
- extends AbstractChangeable
- implements GeneticAlgorithm
Base class from which most implementations of GeneticAlgorithm will inherit.
- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
population
protected Population population
AbstractGeneticAlgorithm
protected AbstractGeneticAlgorithm()
setPopulation
public final void setPopulation(Population pop)
throws ChangeVetoException
- Description copied from interface:
GeneticAlgorithm
- Sets the
Population of Organisms to the Algorithm.
- Specified by:
setPopulation in interface GeneticAlgorithm
- Parameters:
pop - the population to add.
- Throws:
ChangeVetoException - if new populations are not allowed.
getPopulation
public final Population getPopulation()
- Description copied from interface:
GeneticAlgorithm
- The registered
Population
- Specified by:
getPopulation in interface GeneticAlgorithm
- Returns:
- the
Population being operated on.
setSelectionFunction
public final void setSelectionFunction(SelectionFunction function)
throws ChangeVetoException
- Description copied from interface:
GeneticAlgorithm
- Changes the
SelectionFunction used to select candidates for the next generation
- Specified by:
setSelectionFunction in interface GeneticAlgorithm
- Parameters:
function - a SelectionFunction
- Throws:
ChangeVetoException - if the SelectionFunction is not allowed to be changed
getSelectionFunction
public final SelectionFunction getSelectionFunction()
- Specified by:
getSelectionFunction in interface GeneticAlgorithm
- Returns:
- the current
SelectionFunction
setCrossOverFunction
public final void setCrossOverFunction(CrossOverFunction function)
throws ChangeVetoException
- Description copied from interface:
GeneticAlgorithm
- Changes the
CrossOverFunction used to CrossOver Chromosomes
- Specified by:
setCrossOverFunction in interface GeneticAlgorithm
- Parameters:
function - a CrossOverFunction
- Throws:
ChangeVetoException - if the CrossOverFunction is not allowed to be changed
getCrossOverFunction
public final CrossOverFunction getCrossOverFunction()
- Specified by:
getCrossOverFunction in interface GeneticAlgorithm
- Returns:
- the current CrossOverFunction
setMutationFunction
public final void setMutationFunction(MutationFunction function)
throws ChangeVetoException
- Description copied from interface:
GeneticAlgorithm
- Sets the current
MutationFunction
- Specified by:
setMutationFunction in interface GeneticAlgorithm
- Parameters:
function - a MutationFunction
- Throws:
ChangeVetoException - if the MutationFunction change is Vetoed by a listener.
getMutationFunction
public final MutationFunction getMutationFunction()
- Specified by:
getMutationFunction in interface GeneticAlgorithm
- Returns:
- the current
MutationFunction