|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.genetic.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,
long theSpeciesID)
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()
|
long |
getTempLeaderID()
|
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. |
void |
setGensNoImprovement(int theGensNoImprovement)
Set the number of generations with no improvement. |
void |
setLeader(Genome theLeader)
Set the leader. |
void |
setPopulation(Population thePopulation)
|
void |
setSpawnsRequired(double theSpawnsRequired)
Set the number of spawns required. |
void |
setSpeciesID(int i)
Set the species id. |
void |
setTempLeaderID(long theLeaderID)
Set the leader id. |
| 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 thePopulation,
Genome theFirst,
long theSpeciesID)
thePopulation - The population the species belongs to.theFirst - The first genome in the species.theSpeciesID - The species id.| Method Detail |
|---|
public final void calculateSpawnAmount()
calculateSpawnAmount in interface Speciespublic final Genome chooseParent()
chooseParent in interface Speciespublic final int getAge()
getAge in interface Speciespublic final double getBestScore()
getBestScore in interface Speciespublic final int getGensNoImprovement()
getGensNoImprovement in interface Speciespublic final Genome getLeader()
getLeader in interface Speciespublic final List<Genome> getMembers()
getMembers in interface Speciespublic final double getNumToSpawn()
getNumToSpawn in interface Speciespublic final Population getPopulation()
public final double getSpawnsRequired()
getSpawnsRequired in interface Speciespublic final long getSpeciesID()
getSpeciesID in interface Speciespublic final long getTempLeaderID()
public final void purge()
purge in interface Speciespublic final void setAge(int theAge)
setAge in interface SpeciestheAge - The age of this species.public final void setBestScore(double theBestScore)
setBestScore in interface SpeciestheBestScore - The best score.public final void setGensNoImprovement(int theGensNoImprovement)
setGensNoImprovement in interface SpeciestheGensNoImprovement - The number of generations.public final void setLeader(Genome theLeader)
setLeader in interface SpeciestheLeader - The new leader.public final void setPopulation(Population thePopulation)
thePopulation - the population to setpublic final void setSpawnsRequired(double theSpawnsRequired)
setSpawnsRequired in interface SpeciestheSpawnsRequired - The number of spawns required.public final void setSpeciesID(int i)
i - The new species id.public final void setTempLeaderID(long theLeaderID)
theLeaderID - the leaderID to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||