|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojavax.ga.impl.AbstractGeneticAlgorithm
public abstract class AbstractGeneticAlgorithm
Base class from which most implementations of GeneticAlgorithm will inherit.
Field Summary | |
---|---|
protected Population |
population
|
Fields inherited from interface org.biojavax.ga.GeneticAlgorithm |
---|
CROSS_OVER_FUNCTION, FITNESS_FUNCTION, FUNCTION, MUTATION_FUNCTION, POPULATION, SELECTION_FUNCTION |
Constructor Summary | |
---|---|
protected |
AbstractGeneticAlgorithm()
|
Method Summary | |
---|---|
CrossOverFunction |
getCrossOverFunction()
|
FitnessFunction |
getFitnessFunction()
Returns the fitness function, i.e. |
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 |
Methods inherited from class org.biojava.utils.AbstractChangeable |
---|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.biojavax.ga.GeneticAlgorithm |
---|
getGeneration, run |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Field Detail |
---|
protected Population population
Constructor Detail |
---|
protected AbstractGeneticAlgorithm()
Method Detail |
---|
public final CrossOverFunction getCrossOverFunction()
getCrossOverFunction
in interface GeneticAlgorithm
public FitnessFunction getFitnessFunction()
GeneticAlgorithm
getFitnessFunction
in interface GeneticAlgorithm
public final MutationFunction getMutationFunction()
getMutationFunction
in interface GeneticAlgorithm
MutationFunction
public final Population getPopulation()
GeneticAlgorithm
Population
getPopulation
in interface GeneticAlgorithm
Population
being operated on.public final SelectionFunction getSelectionFunction()
getSelectionFunction
in interface GeneticAlgorithm
SelectionFunction
public void initPopulation()
public final void setCrossOverFunction(CrossOverFunction function) throws ChangeVetoException
GeneticAlgorithm
CrossOverFunction
used to CrossOver Chromosomes
setCrossOverFunction
in interface GeneticAlgorithm
function
- a CrossOverFunction
ChangeVetoException
- if the CrossOverFunction
is not allowed to be
changedpublic final void setFitnessFunction(FitnessFunction func) throws ChangeVetoException
GeneticAlgorithm
setFitnessFunction
in interface GeneticAlgorithm
func
- the FitnessFunction
to be used
ChangeVetoException
- if the change is vetoed.public final void setMutationFunction(MutationFunction function) throws ChangeVetoException
GeneticAlgorithm
MutationFunction
setMutationFunction
in interface GeneticAlgorithm
function
- a MutationFunction
ChangeVetoException
- if the MutationFunction
change is Vetoed by a
listener.public final void setPopulation(Population pop) throws ChangeVetoException
GeneticAlgorithm
Population
of Organisms
to the
Algorithm.
setPopulation
in interface GeneticAlgorithm
pop
- the population to add.
ChangeVetoException
- if new populations are not allowed.public final void setSelectionFunction(SelectionFunction function) throws ChangeVetoException
GeneticAlgorithm
SelectionFunction
used to select candidates for
the next generation
setSelectionFunction
in interface GeneticAlgorithm
function
- a SelectionFunction
ChangeVetoException
- if the SelectionFunction
is not allowed to be
changed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |