org.encog.solve.genetic.population
Interface Population

All Superinterfaces:
EncogPersistedObject, Serializable
All Known Implementing Classes:
BasicPopulation

public interface Population
extends EncogPersistedObject

Defines a population of genomes.


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 clear()
          Clear all genomes from this population.
 Genome get(int i)
          Get a genome by index.
 Genome getBest()
           
 List<Genome> getGenomes()
           
 InnovationList getInnovations()
           
 double getOldAgePenalty()
           
 int getOldAgeThreshold()
           
 int getPopulationSize()
           
 List<Species> getSpecies()
           
 double getSurvivalRate()
           
 int getYoungBonusAgeThreshold()
           
 double getYoungScoreBonus()
           
 void setInnovations(InnovationList innovations)
          Set the innovations collection.
 void setOldAgePenalty(double oldAgePenalty)
          Set the old age penalty.
 void setOldAgeThreshold(int oldAgeThreshold)
          Set the age at which a genome is considered "old".
 void setPopulationSize(int populationSize)
          Set the max population size.
 void setSurvivalRate(double survivalRate)
          Set the survival rate.
 void setYoungBonusAgeThreshhold(int youngBonusAgeThreshhold)
          Set the age at which genoms are considered young.
 void setYoungScoreBonus(double youngScoreBonus)
          Set the youth score bonus.
 int size()
           
 void sort()
          Sort the population by best score.
 
Methods inherited from interface org.encog.persist.EncogPersistedObject
createPersistor, getCollection, getDescription, getName, setCollection, setDescription, setName
 

Method Detail

add

void add(Genome genome)
Add a genome to the population.

Parameters:
genome - The genome to add.

addAll

void addAll(List<? extends Genome> newPop)
Add all of the specified members to this population.

Parameters:
newPop - A list of new genomes to add.

assignGeneID

long assignGeneID()
Returns:
Assign a gene id.

assignGenomeID

long assignGenomeID()
Returns:
Assign a genome id.

assignInnovationID

long assignInnovationID()
Returns:
Assign an innovation id.

assignSpeciesID

long assignSpeciesID()
Returns:
Assign a species id.

clear

void clear()
Clear all genomes from this population.


get

Genome get(int i)
Get a genome by index. Index 0 is the best genome.

Parameters:
i - The genome to get.
Returns:
The genome at the specified index.

getBest

Genome getBest()
Returns:
The best genome in the population.

getGenomes

List<Genome> getGenomes()
Returns:
The genomes in the population.

getInnovations

InnovationList getInnovations()
Returns:
A list of innovations in this population.

getOldAgePenalty

double getOldAgePenalty()
Returns:
The percent to decrease "old" genom's score by.

getOldAgeThreshold

int getOldAgeThreshold()
Returns:
The age at which to consider a genome "old".

getPopulationSize

int getPopulationSize()
Returns:
The max population size.

getSpecies

List<Species> getSpecies()
Returns:
A list of species.

getSurvivalRate

double getSurvivalRate()
Returns:
The survival rate.

getYoungBonusAgeThreshold

int getYoungBonusAgeThreshold()
Returns:
The age, below which, a genome is considered "young".

getYoungScoreBonus

double getYoungScoreBonus()
Returns:
The bonus given to "young" genomes.

setInnovations

void setInnovations(InnovationList innovations)
Set the innovations collection.

Parameters:
innovations - The innovations collection.

setOldAgePenalty

void setOldAgePenalty(double oldAgePenalty)
Set the old age penalty.

Parameters:
oldAgePenalty - The old age penalty.

setOldAgeThreshold

void setOldAgeThreshold(int oldAgeThreshold)
Set the age at which a genome is considered "old".

Parameters:
oldAgeThreshold - The old age threshold.

setPopulationSize

void setPopulationSize(int populationSize)
Set the max population size.

Parameters:
populationSize - The max population size.

setSurvivalRate

void setSurvivalRate(double survivalRate)
Set the survival rate.

Parameters:
survivalRate - The survival rate.

setYoungBonusAgeThreshhold

void setYoungBonusAgeThreshhold(int youngBonusAgeThreshhold)
Set the age at which genoms are considered young.

Parameters:
youngBonusAgeThreshhold - The age.

setYoungScoreBonus

void setYoungScoreBonus(double youngScoreBonus)
Set the youth score bonus.

Parameters:
youngScoreBonus - The bonus.

size

int size()
Returns:
The size of the population.

sort

void sort()
Sort the population by best score.



Copyright © 2011. All Rights Reserved.