artoflife pre0.1.0-dev

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

Field Summary
protected  int maxCull
           
protected  float 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
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 org.artoflife.gp.population.GenerationalPopulation
breed, getIdealPopulationSize, makeSelector, newIndividual, setIdealPopulationSize, setSelectorClass
 
Methods inherited from class org.artoflife.gp.Population
addIndividual, addNewIndividuals, addPopulationListener, breedNewIndividual, firePopulationEvent, getIndividuals, getReproducers, newGeneration, removeIndividual, removePopulationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxCull

protected int maxCull

minFitness

protected float minFitness
Constructor Detail

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 > 2
individualClass - Class of individuals to create as initial population. Must be non-null
maxCull - maximum number of Individuals to cull at start of each new generation. Must be >= minCull
minFitness - threshold for weak Individuals that are culled at the end of each generation
Method Detail

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

artoflife pre0.1.0-dev

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