|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.ml.ea.species.BasicSpecies
public class BasicSpecies
Provides basic functionality for a species.
Constructor Summary | |
---|---|
BasicSpecies()
Default constructor, used mainly for persistence. |
|
BasicSpecies(Population thePopulation,
Genome theFirst)
Construct a species. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicSpecies()
public BasicSpecies(Population thePopulation, Genome theFirst)
thePopulation
- The population the species belongs to.theFirst
- The first genome in the species.Method Detail |
---|
public void add(Genome genome)
add
in interface Species
genome
- The genome to add.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()
getAge
in interface Species
public double getBestScore()
getBestScore
in interface Species
public int getGensNoImprovement()
getGensNoImprovement
in interface Species
public Genome getLeader()
getLeader
in interface Species
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)
setAge
in interface Species
theAge
- The age.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)
setLeader
in interface Species
theLeader
- The leader.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.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |