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 Species
shouldMinimize
- True if we see to minimize the score.maxScore
- The best score.public int getAge()
public double getBestScore()
getBestScore
in interface Species
public int getGensNoImprovement()
getGensNoImprovement
in interface Species
public Genome getLeader()
public List<Genome> getMembers()
getMembers
in interface Species
public int getOffspringCount()
getOffspringCount
in interface Species
public double getOffspringShare()
getOffspringShare
in interface Species
public Population getPopulation()
getPopulation
in interface Species
public void purge()
public void setAge(int theAge)
public void setBestScore(double theBestScore)
setBestScore
in interface Species
theBestScore
- The best score.public void setGensNoImprovement(int theGensNoImprovement)
setGensNoImprovement
in interface Species
theGensNoImprovement
- The generation count with no improvement.public void setLeader(Genome theLeader)
public void setOffspringCount(int offspringCount)
setOffspringCount
in interface Species
offspringCount
- The offspring count.public void setPopulation(Population thePopulation)
setPopulation
in interface Species
thePopulation
- The population.Copyright © 2014. All Rights Reserved.