artoflife pre0.1.0-dev

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

Field Summary
 
Fields inherited from class org.artoflife.gp.population.MinFitnessGenerationalPopulation
maxCull, minFitness
 
Fields inherited from class org.artoflife.gp.population.GenerationalPopulation
FITNESS_COMPARATOR, individualClass, populationSize, selectorClass
 
Fields inherited from class org.artoflife.gp.Population
individuals
 
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 org.artoflife.gp.population.MinFitnessGenerationalPopulation
cullOneWeakest, cullWeakest, cullWeakest
 
Methods inherited from class org.artoflife.gp.population.GenerationalPopulation
breed, getIdealPopulationSize, makeSelector, newIndividual, setIdealPopulationSize, setSelectorClass
 
Methods inherited from class org.artoflife.gp.Population
addIndividual, addNewIndividuals, addPopulationListener, firePopulationEvent, getIndividuals, getReproducers, removeIndividual, removePopulationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 decay
decayScale - a fitness is reduced by (maxFitness-fitness)*decayScale
Method Detail

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

artoflife pre0.1.0-dev

Copyright © 2002 the Art Of Life team. All Rights Reserved.