org.encog.ml.ea.species
public class BasicSpecies extends Object implements Serializable, Species
| Constructor and Description |
|---|
BasicSpecies()
Default constructor, used mainly for persistence.
|
BasicSpecies(Population thePopulation,
Genome theFirst)
Construct a species.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Genome genome)
Add a genome to this species.
|
double |
calculateShare(boolean shouldMinimize,
double maxScore)
Calculate this genome's share of the next population.
|
int |
getAge() |
double |
getBestScore() |
int |
getGensNoImprovement() |
Genome |
getLeader() |
List<Genome> |
getMembers() |
int |
getOffspringCount() |
double |
getOffspringShare() |
Population |
getPopulation() |
void |
purge()
Purge all members, increase age by one and count the number of
generations with no improvement.
|
void |
setAge(int theAge)
Set the age of this species.
|
void |
setBestScore(double theBestScore)
Set the best score for this species.
|
void |
setGensNoImprovement(int theGensNoImprovement)
Set the number of generations with no improvement.
|
void |
setLeader(Genome theLeader)
Set the leader of this species.
|
void |
setOffspringCount(int offspringCount)
Set the offspring count.
|
void |
setPopulation(Population thePopulation)
Set the population.
|
String |
toString() |
public BasicSpecies()
public BasicSpecies(Population thePopulation, Genome theFirst)
thePopulation - The population the species belongs to.theFirst - The first genome in the species.public void add(Genome genome)
public double calculateShare(boolean shouldMinimize,
double maxScore)
calculateShare in interface SpeciesshouldMinimize - True if we see to minimize the score.maxScore - The best score.public int getAge()
public double getBestScore()
getBestScore in interface Speciespublic int getGensNoImprovement()
getGensNoImprovement in interface Speciespublic Genome getLeader()
public List<Genome> getMembers()
getMembers in interface Speciespublic int getOffspringCount()
getOffspringCount in interface Speciespublic double getOffspringShare()
getOffspringShare in interface Speciespublic Population getPopulation()
getPopulation in interface Speciespublic void purge()
public void setAge(int theAge)
public void setBestScore(double theBestScore)
setBestScore in interface SpeciestheBestScore - The best score.public void setGensNoImprovement(int theGensNoImprovement)
setGensNoImprovement in interface SpeciestheGensNoImprovement - The generation count with no improvement.public void setLeader(Genome theLeader)
public void setOffspringCount(int offspringCount)
setOffspringCount in interface SpeciesoffspringCount - The offspring count.public void setPopulation(Population thePopulation)
setPopulation in interface SpeciesthePopulation - The population.Copyright © 2014. All Rights Reserved.