org.encog.ml.genetic.genome
Interface Genome

All Superinterfaces:
Comparable<Genome>
All Known Implementing Classes:
BasicGenome, NEATGenome, NeuralGenome

public interface Genome
extends Comparable<Genome>

A genome is the basic blueprint for creating an organism in Encog. A genome is made up of one or more chromosomes, which are in turn made up of genes.


Method Summary
 int calculateGeneCount()
           
 void decode()
          Use the genes to update the organism.
 void encode()
          Use the organism to update the genes.
 double getAdjustedScore()
          Get the adjusted score, this considers old-age penalties and youth bonuses.
 double getAmountToSpawn()
           
 List<Chromosome> getChromosomes()
           
 GeneticAlgorithm getGeneticAlgorithm()
           
 long getGenomeID()
           
 Object getOrganism()
           
 Population getPopulation()
           
 double getScore()
           
 void mate(Genome father, Genome child1, Genome child2)
          Mate with another genome and produce two children.
 void setAdjustedScore(double adjustedScore)
          Set the adjusted score.
 void setAmountToSpawn(double amountToSpawn)
          Set the amount to spawn.
 void setGeneticAlgorithm(GeneticAlgorithm ga)
          Set the GA used by this genome.
 void setGenomeID(long genomeID)
          Set the genome ID.
 void setPopulation(Population population)
          Set the population that this genome belongs to.
 void setScore(double score)
          Set the score.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

calculateGeneCount

int calculateGeneCount()
Returns:
The number of genes in this genome.

decode

void decode()
Use the genes to update the organism.


encode

void encode()
Use the organism to update the genes.


getAdjustedScore

double getAdjustedScore()
Get the adjusted score, this considers old-age penalties and youth bonuses. If there are no such bonuses or penalties, this is the same as the score.

Returns:
The adjusted score.

getAmountToSpawn

double getAmountToSpawn()
Returns:
The amount of offspring this genome will have.

getChromosomes

List<Chromosome> getChromosomes()
Returns:
The chromosomes that make up this genome.

getGeneticAlgorithm

GeneticAlgorithm getGeneticAlgorithm()
Returns:
Get the GA used by this genome. This is normally a transient field and only used during training.

getGenomeID

long getGenomeID()
Returns:
The genome ID.

getOrganism

Object getOrganism()
Returns:
The organism produced by this genome.

getPopulation

Population getPopulation()
Returns:
The population that this genome belongs to.

getScore

double getScore()
Returns:
The score for this genome.

mate

void mate(Genome father,
          Genome child1,
          Genome child2)
Mate with another genome and produce two children.

Parameters:
father - The father genome.
child1 - The first child.
child2 - The second child.

setAdjustedScore

void setAdjustedScore(double adjustedScore)
Set the adjusted score.

Parameters:
adjustedScore - The adjusted score.

setAmountToSpawn

void setAmountToSpawn(double amountToSpawn)
Set the amount to spawn.

Parameters:
amountToSpawn - The amount to spawn.

setGeneticAlgorithm

void setGeneticAlgorithm(GeneticAlgorithm ga)
Set the GA used by this genome. This is normally a transient field and only used during training.

Parameters:
ga - The GA.

setGenomeID

void setGenomeID(long genomeID)
Set the genome ID.

Parameters:
genomeID - The genome id.

setPopulation

void setPopulation(Population population)
Set the population that this genome belongs to.

Parameters:
population - The population that this genome belongs to.

setScore

void setScore(double score)
Set the score.

Parameters:
score - The new score.


Copyright © 2012. All Rights Reserved.