|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.util.Printable | +--anthill.genie.impl.GeneticFrameworkImpl
Basic implementation of the GeneticFramework interface.
Field Summary | |
protected GeneticCode |
bestCode
Fittest genetic code |
protected double |
bestFitness
|
protected double |
cullRate
Percentage deemed unfit for reproduction |
protected double |
eliteRate
Percentage of population carried forward unchanged from each generation |
protected Factory |
factory
Factory used to instantiate objects |
protected int |
generations
Number of generations to be computed |
protected double |
mutRate
Mutation rate |
protected int |
numcodes
Number of genetic codes constituting the population |
protected int |
numgenes
Number of genes (bit sequences) constituting a genetic code |
protected gajit.Population |
people
Population of evolved genetic codes |
protected int |
sizegenes
Size of a single gene |
Constructor Summary | |
GeneticFrameworkImpl(Factory factory,
int numcodes,
int numgenes,
int sizegenes,
double mutRate,
double eliteRate,
double cullRate,
int generations)
Instantiates a new genetic framework |
Method Summary | |
void |
evolve()
Tries to evolve a population of genetic codes, using the configuration parameters contained in this instance. |
GeneticCode |
getFittest()
Return the genetic code with the best fitness. |
gajit.Population |
getPopulation()
Return the population of evolved genetic codes. |
Methods inherited from class anthill.util.Printable |
toString, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Factory factory
protected int numcodes
protected int numgenes
protected int sizegenes
protected double mutRate
protected double eliteRate
protected double cullRate
protected int generations
protected gajit.Population people
protected GeneticCode bestCode
protected double bestFitness
Constructor Detail |
public GeneticFrameworkImpl(Factory factory, int numcodes, int numgenes, int sizegenes, double mutRate, double eliteRate, double cullRate, int generations)
Method Detail |
public void evolve()
evolve
in interface GeneticFramework
out
- print stream used to log information about the
evolution; if print stream is null, no log file is generated.public gajit.Population getPopulation()
getPopulation
in interface GeneticFramework
public GeneticCode getFittest()
getFittest
in interface GeneticFramework
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |