org.encog.ml.ea.species
Class ThresholdSpeciation

java.lang.Object
  extended by org.encog.ml.ea.species.ThresholdSpeciation
All Implemented Interfaces:
Serializable, Speciation
Direct Known Subclasses:
OriginalNEATSpeciation, PrgSpeciation

public abstract class ThresholdSpeciation
extends Object
implements Speciation, Serializable

Speciate based on threshold. Any genomes with a compatibility score below a level will be in the same species.

See Also:
Serialized Form

Constructor Summary
ThresholdSpeciation()
           
 
Method Summary
 void addSpeciesMember(Species species, Genome genome)
          Add a genome.
 Species findBestSpecies()
          Find the best species.
abstract  double getCompatibilityScore(Genome genome1, Genome genome2)
          Determine how compatible two genomes are.
 double getCompatibilityThreshold()
           
 int getMaxNumberOfSpecies()
           
 int getNumGensAllowedNoImprovement()
           
 EvolutionaryAlgorithm getOwner()
           
 SortGenomesForSpecies getSortGenomes()
           
 void init(EvolutionaryAlgorithm theOwner)
          Setup the speciation strategy.
 void performSpeciation(List<Genome> genomeList)
          Perform the speciation.
 void removeSpecies(Species species)
          Attempt to remove a removable species.
 void setCompatibilityThreshold(double compatibilityThreshold)
           
 void setMaxNumberOfSpecies(int maxNumberOfSpecies)
           
 void setNumGensAllowedNoImprovement(int numGensAllowedNoImprovement)
           
 void setSortGenomes(SortGenomesForSpecies sortGenomes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThresholdSpeciation

public ThresholdSpeciation()
Method Detail

addSpeciesMember

public void addSpeciesMember(Species species,
                             Genome genome)
Add a genome.

Parameters:
species - The species to add to.
genome - The genome to add.

findBestSpecies

public Species findBestSpecies()
Find the best species.

Returns:
The best species.

removeSpecies

public void removeSpecies(Species species)
Attempt to remove a removable species. If the species is the best species, then do not remove it. If the species is the last species, don't remove it.

Parameters:
species - The species to attempt to remove.

getCompatibilityThreshold

public double getCompatibilityThreshold()
Returns:
the compatibilityThreshold

getMaxNumberOfSpecies

public int getMaxNumberOfSpecies()
Returns:
the maxNumberOfSpecies

getNumGensAllowedNoImprovement

public int getNumGensAllowedNoImprovement()
Returns:
the numGensAllowedNoImprovement

getOwner

public EvolutionaryAlgorithm getOwner()
Returns:
the owner

getSortGenomes

public SortGenomesForSpecies getSortGenomes()
Returns:
the sortGenomes

init

public void init(EvolutionaryAlgorithm theOwner)
Setup the speciation strategy.

Specified by:
init in interface Speciation
Parameters:
theOwner - The owner.

performSpeciation

public void performSpeciation(List<Genome> genomeList)
Perform the speciation.

Specified by:
performSpeciation in interface Speciation
Parameters:
genomeList - The genomes to speciate.

setCompatibilityThreshold

public void setCompatibilityThreshold(double compatibilityThreshold)
Parameters:
compatibilityThreshold - the compatibilityThreshold to set

setMaxNumberOfSpecies

public void setMaxNumberOfSpecies(int maxNumberOfSpecies)
Parameters:
maxNumberOfSpecies - the maxNumberOfSpecies to set

setNumGensAllowedNoImprovement

public void setNumGensAllowedNoImprovement(int numGensAllowedNoImprovement)
Parameters:
numGensAllowedNoImprovement - the numGensAllowedNoImprovement to set

setSortGenomes

public void setSortGenomes(SortGenomesForSpecies sortGenomes)
Parameters:
sortGenomes - the sortGenomes to set

getCompatibilityScore

public abstract double getCompatibilityScore(Genome genome1,
                                             Genome genome2)
Determine how compatible two genomes are. More compatible genomes will be placed into the same species. The lower the number, the more compatible.

Parameters:
genome1 - The first genome.
genome2 - The second genome.
Returns:
The compatability level.


Copyright © 2014. All Rights Reserved.