org.artoflife.gp.population
Class MinFitnessGenerationalPopulation
java.lang.Object
|
+--org.artoflife.gp.Population
|
+--org.artoflife.gp.population.GenerationalPopulation
|
+--org.artoflife.gp.population.MinFitnessGenerationalPopulation
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- DecayingMinFitnessGenerationalPopulation
- public class MinFitnessGenerationalPopulation
- extends GenerationalPopulation
A GenerationalPopulation
that culls
only those Individuals whose Fitness
falls below a fixed threshold.
This isn't a good general strategy but is useful when a user
needs to control the population by setting fitnesses interactively.
- Author:
- Steve Meyfroidt
- See Also:
- Serialized Form
Constructor Summary |
MinFitnessGenerationalPopulation(int populationSize,
java.lang.Class individualClass,
int maxCull,
float minFitness,
java.util.SortedMap reproducers)
|
Method Summary |
protected void |
cullOneWeakest()
|
protected void |
cullWeakest()
Cull the Individuals whose fitness is below minFitness
up to the maxCull for this population. |
protected void |
cullWeakest(int max)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxCull
protected int maxCull
minFitness
protected float minFitness
MinFitnessGenerationalPopulation
public MinFitnessGenerationalPopulation(int populationSize,
java.lang.Class individualClass,
int maxCull,
float minFitness,
java.util.SortedMap reproducers)
- Parameters:
populationSize
- how many Individuals in this fixed size population?
Must be > 2individualClass
- Class of individuals to create as initial population.
Must be non-nullmaxCull
- maximum number of Individuals to cull at start of each
new generation. Must be >= minCullminFitness
- threshold for weak Individuals that are culled at the
end of each generation
cullWeakest
protected void cullWeakest()
- Cull the Individuals whose fitness is below minFitness
up to the maxCull for this population.
- Specified by:
cullWeakest
in class Population
- See Also:
Population.cullWeakest()
cullWeakest
protected void cullWeakest(int max)
cullOneWeakest
protected void cullOneWeakest()
- Specified by:
cullOneWeakest
in class Population
Copyright © 2002 the Art Of Life team. All Rights Reserved.