|
||||||||||
| 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 GeneticAlgorithmpublic FitnessFunction getFitnessFunction()
GeneticAlgorithm
getFitnessFunction in interface GeneticAlgorithmpublic final MutationFunction getMutationFunction()
getMutationFunction in interface GeneticAlgorithmMutationFunctionpublic final Population getPopulation()
GeneticAlgorithmPopulation
getPopulation 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 Chromosomes
setCrossOverFunction in interface GeneticAlgorithmfunction - a CrossOverFunction
ChangeVetoException - if the CrossOverFunction is not allowed to be
changed
public final void setFitnessFunction(FitnessFunction func)
throws ChangeVetoException
GeneticAlgorithm
setFitnessFunction in interface GeneticAlgorithmfunc - the FitnessFunction to be used
ChangeVetoException - if the change is vetoed.
public final void setMutationFunction(MutationFunction function)
throws ChangeVetoException
GeneticAlgorithmMutationFunction
setMutationFunction in interface GeneticAlgorithmfunction - a MutationFunction
ChangeVetoException - 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 generation
setSelectionFunction in interface GeneticAlgorithmfunction - 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 | |||||||||