|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.ai.EvolutionGenePool
The EvolutionGenePool class keeps track of a collection of Brains. When an EvolutionBot is created, it requests a Brain from the gene pool. The Brain is either one of the brains in the collection, or a mutation of one of the brains. Only the top brains are collected, ranked by the amount of damage a brain's bot caused. There for, only the best brains reproduce.
Constructor Summary | |
EvolutionGenePool(BSPTree bspTree)
|
Method Summary | |
Brain |
getNewBrain()
Gets a new brain from the gene pool. |
Brain |
getRandomTopBrain()
Gets a random top-performing brain. |
void |
notifyDead(Brain brain,
long damageCaused)
Notify that a creature with the specified brain has been destroyed. |
void |
resetEvolution()
|
void |
setBSPTree(BSPTree bspTree)
The BSP tree used for certain patterns (like the shortest path alogirthm used for the chase pattern) |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public EvolutionGenePool(BSPTree bspTree)
Method Detail |
public void setBSPTree(BSPTree bspTree)
public void resetEvolution()
public Brain getNewBrain()
public Brain getRandomTopBrain()
public void notifyDead(Brain brain, long damageCaused)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |