|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.genetic.population.BasicPopulation
public class BasicPopulation
Defines the basic functionality for a population of genomes.
| Field Summary | |
|---|---|
static double |
DEFAULT_OLD_AGE_PENALTY
Thed default old age penalty. |
static int |
DEFAULT_OLD_AGE_THRESHOLD
The default old age threshold. |
static double |
DEFAULT_SURVIVAL_RATE
The default survival rate. |
static double |
DEFAULT_YOUTH_BONUS
The default youth penalty. |
static int |
DEFAULT_YOUTH_THRESHOLD
The default youth threshold. |
| Fields inherited from interface org.encog.ml.genetic.population.Population |
|---|
PROPERTY_GENOMES, PROPERTY_INNOVATIONS, PROPERTY_NEXT_GENE_ID, PROPERTY_NEXT_GENOME_ID, PROPERTY_NEXT_INNOVATION_ID, PROPERTY_NEXT_SPECIES_ID, PROPERTY_OLD_AGE_PENALTY, PROPERTY_OLD_AGE_THRESHOLD, PROPERTY_POPULATION_SIZE, PROPERTY_SPECIES, PROPERTY_SURVIVAL_RATE, PROPERTY_YOUNG_AGE_BONUS, PROPERTY_YOUNG_AGE_THRESHOLD |
| Constructor Summary | |
|---|---|
BasicPopulation()
Construct an empty population. |
|
BasicPopulation(int thePopulationSize)
Construct a population. |
|
| Method Summary | |
|---|---|
void |
add(Genome genome)
Add a genome to the population. |
void |
addAll(List<? extends Genome> newPop)
Add all of the specified members to this population. |
long |
assignGeneID()
|
long |
assignGenomeID()
|
long |
assignInnovationID()
|
long |
assignSpeciesID()
|
void |
claim(GeneticAlgorithm ga)
Claim the population, before training. |
void |
clear()
Clear all genomes from this population. |
Genome |
get(int i)
Get a genome by index. |
Genome |
getBest()
|
GenerateID |
getGeneIDGenerate()
|
GenerateID |
getGenomeIDGenerate()
|
List<Genome> |
getGenomes()
|
GenerateID |
getInnovationIDGenerate()
|
InnovationList |
getInnovations()
|
String |
getName()
|
double |
getOldAgePenalty()
|
int |
getOldAgeThreshold()
|
int |
getPopulationSize()
|
List<Species> |
getSpecies()
|
GenerateID |
getSpeciesIDGenerate()
|
double |
getSurvivalRate()
|
int |
getYoungBonusAgeThreshold()
|
double |
getYoungScoreBonus()
|
void |
setInnovations(InnovationList theInnovations)
Set the innovations collection. |
void |
setName(String theName)
Set the name. |
void |
setOldAgePenalty(double theOldAgePenalty)
Set the old age penalty. |
void |
setOldAgeThreshold(int theOldAgeThreshold)
Set the age at which a genome is considered "old". |
void |
setPopulationSize(int thePopulationSize)
Set the max population size. |
void |
setSurvivalRate(double theSurvivalRate)
Set the survival rate. |
void |
setYoungBonusAgeThreshhold(int theYoungBonusAgeThreshold)
Set the age at which genoms are considered young. |
void |
setYoungBonusAgeThreshold(int theYoungBonusAgeThreshold)
|
void |
setYoungScoreBonus(double theYoungScoreBonus)
Set the youth score bonus. |
int |
size()
|
void |
sort()
Sort the population by best score. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_OLD_AGE_PENALTY
public static final int DEFAULT_OLD_AGE_THRESHOLD
public static final double DEFAULT_SURVIVAL_RATE
public static final double DEFAULT_YOUTH_BONUS
public static final int DEFAULT_YOUTH_THRESHOLD
| Constructor Detail |
|---|
public BasicPopulation()
public BasicPopulation(int thePopulationSize)
thePopulationSize - The population size.| Method Detail |
|---|
public final void add(Genome genome)
add in interface Populationgenome - The genome to add.public final void addAll(List<? extends Genome> newPop)
addAll in interface PopulationnewPop - A list of new genomes to add.public final long assignGeneID()
assignGeneID in interface Populationpublic final long assignGenomeID()
assignGenomeID in interface Populationpublic final long assignInnovationID()
assignInnovationID in interface Populationpublic final long assignSpeciesID()
assignSpeciesID in interface Populationpublic final void claim(GeneticAlgorithm ga)
claim in interface Populationga - The GA that is claiming.public final void clear()
clear in interface Populationpublic final Genome get(int i)
get in interface Populationi - The genome to get.
public final Genome getBest()
getBest in interface Populationpublic final GenerateID getGeneIDGenerate()
public final GenerateID getGenomeIDGenerate()
public final List<Genome> getGenomes()
getGenomes in interface Populationpublic final GenerateID getInnovationIDGenerate()
public final InnovationList getInnovations()
getInnovations in interface Populationpublic final String getName()
public final double getOldAgePenalty()
getOldAgePenalty in interface Populationpublic final int getOldAgeThreshold()
getOldAgeThreshold in interface Populationpublic final int getPopulationSize()
getPopulationSize in interface Populationpublic final List<Species> getSpecies()
getSpecies in interface Populationpublic final GenerateID getSpeciesIDGenerate()
public final double getSurvivalRate()
getSurvivalRate in interface Populationpublic final int getYoungBonusAgeThreshold()
getYoungBonusAgeThreshold in interface Populationpublic final double getYoungScoreBonus()
getYoungScoreBonus in interface Populationpublic final void setInnovations(InnovationList theInnovations)
setInnovations in interface PopulationtheInnovations - The innovations collection.public final void setName(String theName)
theName - The new name.public final void setOldAgePenalty(double theOldAgePenalty)
setOldAgePenalty in interface PopulationtheOldAgePenalty - The old age penalty.public final void setOldAgeThreshold(int theOldAgeThreshold)
setOldAgeThreshold in interface PopulationtheOldAgeThreshold - The old age threshold.public final void setPopulationSize(int thePopulationSize)
setPopulationSize in interface PopulationthePopulationSize - The max population size.public final void setSurvivalRate(double theSurvivalRate)
setSurvivalRate in interface PopulationtheSurvivalRate - The survival rate.public final void setYoungBonusAgeThreshhold(int theYoungBonusAgeThreshold)
setYoungBonusAgeThreshhold in interface PopulationtheYoungBonusAgeThreshold - The age.public final void setYoungBonusAgeThreshold(int theYoungBonusAgeThreshold)
theYoungBonusAgeThreshold - the youngBonusAgeThreshold to setpublic final void setYoungScoreBonus(double theYoungScoreBonus)
setYoungScoreBonus in interface PopulationtheYoungScoreBonus - The bonus.public final int size()
size in interface Populationpublic final void sort()
sort in interface Population
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||