|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.genetic.GeneticAlgorithm
public abstract class GeneticAlgorithm
Implements a genetic algorithm. This is an abstract class. Other classes are provided by Encog use this base class to train neural networks or provide an answer to the traveling salesman problem. The genetic algorithm is also capable of using a thread pool to speed execution.
| Constructor Summary | |
|---|---|
GeneticAlgorithm()
|
|
| Method Summary | |
|---|---|
void |
addSpeciesMember(Species species,
Genome genome)
Add a genome. |
void |
calculateScore(Genome g)
Calculate the score for this genome. |
CalculateGenomeScore |
getCalculateScore()
|
GenomeComparator |
getComparator()
|
Crossover |
getCrossover()
|
double |
getMatingPopulation()
Get the mating population. |
Mutate |
getMutate()
|
double |
getMutationPercent()
Get the mutation percent. |
double |
getPercentToMate()
Get the percent to mate. |
Population |
getPopulation()
|
int |
getThreadCount()
|
abstract void |
iteration()
Perform one training iteration. |
void |
setCalculateScore(CalculateGenomeScore theCalculateScore)
Set the score calculation object. |
void |
setComparator(GenomeComparator theComparator)
Set the comparator. |
void |
setCrossover(Crossover theCrossover)
Set the crossover object. |
void |
setMatingPopulation(double theMatingPopulation)
Set the mating population percent. |
void |
setMutate(Mutate theMutate)
Set the mutate object. |
void |
setMutationPercent(double theMutationPercent)
Set the mutation percent. |
void |
setPercentToMate(double thePercentToMate)
Set the percent to mate. |
void |
setPopulation(Population thePopulation)
Set the population. |
void |
setThreadCount(int numThreads)
Set the number of threads to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeneticAlgorithm()
| Method Detail |
|---|
public final void addSpeciesMember(Species species,
Genome genome)
species - The species to add.genome - The genome to add.public final void calculateScore(Genome g)
g - The genome to calculate for.public final CalculateGenomeScore getCalculateScore()
public final GenomeComparator getComparator()
public final Crossover getCrossover()
public final double getMatingPopulation()
public final Mutate getMutate()
public final double getMutationPercent()
public final double getPercentToMate()
public final Population getPopulation()
public final void setCalculateScore(CalculateGenomeScore theCalculateScore)
theCalculateScore - The score calculation object.public final void setComparator(GenomeComparator theComparator)
theComparator - The comparator.public final void setCrossover(Crossover theCrossover)
theCrossover - The crossover object.public final void setMatingPopulation(double theMatingPopulation)
theMatingPopulation - The mating population percent.public final void setMutate(Mutate theMutate)
theMutate - The mutate object.public final void setMutationPercent(double theMutationPercent)
theMutationPercent - The percent to mutate.public final void setPercentToMate(double thePercentToMate)
thePercentToMate - The percent to mate.public final void setPopulation(Population thePopulation)
thePopulation - The population.public abstract void iteration()
public int getThreadCount()
getThreadCount in interface MultiThreadablepublic void setThreadCount(int numThreads)
setThreadCount in interface MultiThreadablenumThreads - The number of threads to use, or zero to
automatically determine based on core count.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||