org.encog.ml.ea.species
Class ThresholdSpeciation
- java.lang.Object
-
- org.encog.ml.ea.species.ThresholdSpeciation
-
- All Implemented Interfaces:
- java.io.Serializable, Speciation
- Direct Known Subclasses:
- OriginalNEATSpeciation, PrgSpeciation
public abstract class ThresholdSpeciation extends java.lang.Object implements Speciation, java.io.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
Constructors Constructor and Description ThresholdSpeciation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddSpeciesMember(Species species, Genome genome)Add a genome.SpeciesfindBestSpecies()Find the best species.abstract doublegetCompatibilityScore(Genome genome1, Genome genome2)Determine how compatible two genomes are.doublegetCompatibilityThreshold()intgetMaxNumberOfSpecies()intgetNumGensAllowedNoImprovement()EvolutionaryAlgorithmgetOwner()SortGenomesForSpeciesgetSortGenomes()voidinit(EvolutionaryAlgorithm theOwner)Setup the speciation strategy.voidperformSpeciation(java.util.List<Genome> genomeList)Perform the speciation.voidremoveSpecies(Species species)Attempt to remove a removable species.voidsetCompatibilityThreshold(double compatibilityThreshold)voidsetMaxNumberOfSpecies(int maxNumberOfSpecies)voidsetNumGensAllowedNoImprovement(int numGensAllowedNoImprovement)voidsetSortGenomes(SortGenomesForSpecies sortGenomes)
-
-
-
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:
initin interfaceSpeciation- Parameters:
theOwner- The owner.
-
performSpeciation
public void performSpeciation(java.util.List<Genome> genomeList)
Perform the speciation.- Specified by:
performSpeciationin interfaceSpeciation- 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG