|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.solve.genetic.species.BasicSpecies
public class BasicSpecies
Provides basic functionality for a species.
| Constructor Summary | |
|---|---|
BasicSpecies()
Default constructor, used mainly for persistence. |
|
BasicSpecies(Population population,
Genome first,
long speciesID)
Construct a species. |
|
| Method Summary | |
|---|---|
void |
calculateSpawnAmount()
Calculate the amount to spawn. |
Genome |
chooseParent()
Choose a parent to mate. |
int |
getAge()
|
double |
getBestScore()
|
int |
getGensNoImprovement()
|
Genome |
getLeader()
|
List<Genome> |
getMembers()
|
double |
getNumToSpawn()
|
Population |
getPopulation()
|
double |
getSpawnsRequired()
|
long |
getSpeciesID()
|
void |
purge()
Purge all members, increase age by one and count the number of generations with no improvement. |
void |
setAge(int age)
Set the age of this species. |
void |
setBestScore(double bestScore)
Set the best score. |
void |
setGensNoImprovement(int gensNoImprovement)
Set the number of generations with no improvement. |
void |
setLeader(Genome leader)
Set the leader. |
void |
setSpawnsRequired(double spawnsRequired)
Set the number of spawns required. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicSpecies()
public BasicSpecies(Population population,
Genome first,
long speciesID)
population - The population the species belongs to.first - The first genome in the species.speciesID - The species id.| Method Detail |
|---|
public void calculateSpawnAmount()
calculateSpawnAmount in interface Speciespublic Genome chooseParent()
chooseParent in interface Speciespublic int getAge()
getAge in interface Speciespublic double getBestScore()
getBestScore in interface Speciespublic int getGensNoImprovement()
getGensNoImprovement in interface Speciespublic Genome getLeader()
getLeader in interface Speciespublic List<Genome> getMembers()
getMembers in interface Speciespublic double getNumToSpawn()
getNumToSpawn in interface Speciespublic Population getPopulation()
public double getSpawnsRequired()
getSpawnsRequired in interface Speciespublic long getSpeciesID()
getSpeciesID in interface Speciespublic void purge()
purge in interface Speciespublic void setAge(int age)
setAge in interface Speciesage - The age of this species.public void setBestScore(double bestScore)
setBestScore in interface SpeciesbestScore - The best score.public void setGensNoImprovement(int gensNoImprovement)
setGensNoImprovement in interface SpeciesgensNoImprovement - The number of generations.public void setLeader(Genome leader)
setLeader in interface Speciesleader - The new leader.public void setSpawnsRequired(double spawnsRequired)
setSpawnsRequired in interface SpeciesspawnsRequired - The number of spawns required.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||