|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.javaGenes.core.Breeder
Used to breed a population.
Field Summary | |
protected ChildMakerProvider |
childMakerProvider
|
static boolean |
debug
|
protected double |
tournamentProbability
|
Constructor Summary | |
Breeder(Parameters p)
The argument contains many parameters including those necessary for breeding |
Method Summary | |
int |
antiTournamentGetIndex(Population p)
returns index of tournament loser |
Population |
breed(Population parents)
execute the breeding. |
abstract Population |
breed(Population parents,
int kidsPerGeneration)
|
protected Individual |
chooseBest(Individual first,
Individual second)
|
protected Individual |
chooseWorst(Individual first,
Individual second)
|
void |
generationIsComplete()
|
boolean |
generationJustStarting()
|
boolean |
generationNotComplete(int kidsPerGeneration)
|
FitnessFunction |
getFitnessFunction()
|
int |
getGenerationIndex()
|
int |
getTotalNumberOfKidsProduced()
|
protected boolean |
isProtected(Individual i)
can protect certain individuals from losing an antiTournament and being replaced |
void |
newChild(Individual child)
|
void |
newChildrenCreated(int number)
|
Individual |
pickOne(Population p)
|
void |
reportOnGeneration(int generation,
java.lang.String filename)
|
void |
setFitnessFunction(FitnessFunction f)
|
void |
setGenerationIndex(int value)
|
void |
setTotalNumberOfKidsProduced(int value)
|
void |
stateRestore(TokenizeInput tokenizer)
restore from a checkpoint |
void |
stateSave(TokenizeOutput tokenizer)
checkpoint |
Individual |
tournament(Population p,
Individual alreadyChosen)
implements a two-way tournament. |
boolean |
useTournament()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean debug
protected ChildMakerProvider childMakerProvider
protected double tournamentProbability
Constructor Detail |
public Breeder(Parameters p)
Method Detail |
public boolean useTournament()
public void setFitnessFunction(FitnessFunction f)
public FitnessFunction getFitnessFunction()
public void stateRestore(TokenizeInput tokenizer)
public void stateSave(TokenizeOutput tokenizer)
public Population breed(Population parents)
public abstract Population breed(Population parents, int kidsPerGeneration)
public void newChild(Individual child)
public void newChildrenCreated(int number)
public boolean generationNotComplete(int kidsPerGeneration)
public void generationIsComplete()
public boolean generationJustStarting()
public void setGenerationIndex(int value)
public int getGenerationIndex()
public int getTotalNumberOfKidsProduced()
public void setTotalNumberOfKidsProduced(int value)
public Individual tournament(Population p, Individual alreadyChosen)
p
- population to take tournament contenders fromalreadyChosen
- don't ever pick this individual. May be null.public Individual pickOne(Population p)
protected Individual chooseBest(Individual first, Individual second)
public int antiTournamentGetIndex(Population p)
p
- population to take tournament contenders fromprotected Individual chooseWorst(Individual first, Individual second)
public void reportOnGeneration(int generation, java.lang.String filename)
protected boolean isProtected(Individual i)
|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |