org.artoflife.gp.population
Class DecayingMinFitnessGenerationalPopulation
java.lang.Object
|
+--org.artoflife.gp.Population
|
+--org.artoflife.gp.population.GenerationalPopulation
|
+--org.artoflife.gp.population.MinFitnessGenerationalPopulation
|
+--org.artoflife.gp.population.DecayingMinFitnessGenerationalPopulation
- All Implemented Interfaces:
- java.io.Serializable
- public class DecayingMinFitnessGenerationalPopulation
- extends MinFitnessGenerationalPopulation
A MinFitnessGenerationalPopulation
that
decreases the fitness of all individuals after a step. Fitter
individuals decay less quickly than less fit ones.
- Author:
- Steve Meyfroidt
- See Also:
- Serialized Form
Constructor Summary |
DecayingMinFitnessGenerationalPopulation(int populationSize,
java.lang.Class individualClass,
int maxCull,
float minFitness,
java.util.SortedMap reproducers,
float maxFitness,
float decayScale)
|
Method Summary |
Individual |
breedNewIndividual(Selector selector)
Override to allow plug-point for manipulating fitness of newly created
individuals, useful for the Generator GUI where new individuals are all
assigned a fixed fitness just below the threshold for "protected" parents
whose fitness does not decay. |
float |
getNewFitness()
|
void |
newGeneration()
Override to reduce fitness of all individuals after
the step. |
void |
setNewFitness(float newFitness)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DecayingMinFitnessGenerationalPopulation
public DecayingMinFitnessGenerationalPopulation(int populationSize,
java.lang.Class individualClass,
int maxCull,
float minFitness,
java.util.SortedMap reproducers,
float maxFitness,
float decayScale)
- Parameters:
maxFitness
- the max fitness at which individuals don't decaydecayScale
- a fitness is reduced by (maxFitness-fitness)*decayScale
newGeneration
public void newGeneration()
- Override to reduce fitness of all individuals after
the step.
- Overrides:
newGeneration
in class Population
breedNewIndividual
public Individual breedNewIndividual(Selector selector)
throws IncompatibleGenotypeException
- Override to allow plug-point for manipulating fitness of newly created
individuals, useful for the Generator GUI where new individuals are all
assigned a fixed fitness just below the threshold for "protected" parents
whose fitness does not decay.
- Overrides:
breedNewIndividual
in class Population
- Parameters:
selector
- to use for selection of parents of the breeding
- Returns:
- a new Individual, never null
- Throws:
IncompatibleGenotypeException
- when breeding between
individuals with incompatible genotypes- See Also:
Population.breedNewIndividual(org.artoflife.gp.Selector)
getNewFitness
public float getNewFitness()
- Returns:
- float
setNewFitness
public void setNewFitness(float newFitness)
- Parameters:
newFitness
- The newFitness to set
Copyright © 2002 the Art Of Life team. All Rights Reserved.