org.encog.ml.genetic.population
Interface Population

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

public interface Population
extends Serializable

Defines a population of genomes.


Field Summary
static String PROPERTY_GENOMES
          Property tag for the genomes collection.
static String PROPERTY_INNOVATIONS
          Property tag for the innovations collection.
static String PROPERTY_NEXT_GENE_ID
          Property tag for the next gene id.
static String PROPERTY_NEXT_GENOME_ID
          Property tag for the next genome id.
static String PROPERTY_NEXT_INNOVATION_ID
          Property tag for the next innovation id.
static String PROPERTY_NEXT_SPECIES_ID
          Property tag for the next species id.
static String PROPERTY_OLD_AGE_PENALTY
          Property tag for the old age penalty.
static String PROPERTY_OLD_AGE_THRESHOLD
          Property tag for the old age threshold.
static String PROPERTY_POPULATION_SIZE
          Property tag for the population size.
static String PROPERTY_SPECIES
          Property tag for the species collection.
static String PROPERTY_SURVIVAL_RATE
          Property tag for the survival rate.
static String PROPERTY_YOUNG_AGE_BONUS
          Property tag for the young age bonus.
static String PROPERTY_YOUNG_AGE_THRESHOLD
          Property tag for the young age threshold.
 
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()
           
 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.
 

Field Detail

PROPERTY_NEXT_GENE_ID

static final String PROPERTY_NEXT_GENE_ID
Property tag for the next gene id.

See Also:
Constant Field Values

PROPERTY_NEXT_GENOME_ID

static final String PROPERTY_NEXT_GENOME_ID
Property tag for the next genome id.

See Also:
Constant Field Values

PROPERTY_NEXT_INNOVATION_ID

static final String PROPERTY_NEXT_INNOVATION_ID
Property tag for the next innovation id.

See Also:
Constant Field Values

PROPERTY_NEXT_SPECIES_ID

static final String PROPERTY_NEXT_SPECIES_ID
Property tag for the next species id.

See Also:
Constant Field Values

PROPERTY_OLD_AGE_PENALTY

static final String PROPERTY_OLD_AGE_PENALTY
Property tag for the old age penalty.

See Also:
Constant Field Values

PROPERTY_OLD_AGE_THRESHOLD

static final String PROPERTY_OLD_AGE_THRESHOLD
Property tag for the old age threshold.

See Also:
Constant Field Values

PROPERTY_POPULATION_SIZE

static final String PROPERTY_POPULATION_SIZE
Property tag for the population size.

See Also:
Constant Field Values

PROPERTY_SURVIVAL_RATE

static final String PROPERTY_SURVIVAL_RATE
Property tag for the survival rate.

See Also:
Constant Field Values

PROPERTY_YOUNG_AGE_BONUS

static final String PROPERTY_YOUNG_AGE_BONUS
Property tag for the young age bonus.

See Also:
Constant Field Values

PROPERTY_YOUNG_AGE_THRESHOLD

static final String PROPERTY_YOUNG_AGE_THRESHOLD
Property tag for the young age threshold.

See Also:
Constant Field Values

PROPERTY_GENOMES

static final String PROPERTY_GENOMES
Property tag for the genomes collection.

See Also:
Constant Field Values

PROPERTY_INNOVATIONS

static final String PROPERTY_INNOVATIONS
Property tag for the innovations collection.

See Also:
Constant Field Values

PROPERTY_SPECIES

static final String PROPERTY_SPECIES
Property tag for the species collection.

See Also:
Constant Field Values
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.


claim

void claim(GeneticAlgorithm ga)
Claim the population, before training.

Parameters:
ga - The GA that is claiming.


Copyright © 2011. All Rights Reserved.