artoflife pre0.1.0-dev

org.artoflife.gp.population
Class SelectorGenerationalPopulation

java.lang.Object
  |
  +--org.artoflife.gp.Population
        |
        +--org.artoflife.gp.population.GenerationalPopulation
              |
              +--org.artoflife.gp.population.SelectorGenerationalPopulation
All Implemented Interfaces:
java.io.Serializable

public class SelectorGenerationalPopulation
extends GenerationalPopulation

A GenerationalPopulation which culls a configurable random number of Individuals every generation from the least fit of the population.

Author:
Steve Meyfroidt
See Also:
Serialized Form

Field Summary
protected  int maxCull
           
protected  int minCull
           
 
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
SelectorGenerationalPopulation(int populationSize, java.lang.Class individualClass, int minCull, int maxCull, java.util.SortedMap reproducers)
           
 
Method Summary
protected  void cullOneWeakest()
           
protected  void cullWeakest()
          Cull a random number of Individuals between minCull and maxCull from the least fit Individuals.
 
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

minCull

protected int minCull

maxCull

protected int maxCull
Constructor Detail

SelectorGenerationalPopulation

public SelectorGenerationalPopulation(int populationSize,
                                      java.lang.Class individualClass,
                                      int minCull,
                                      int maxCull,
                                      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
minCull - minimum number of Individuals to cull at end of each generation. Must be > -1
maxCull - maximum number of Individuals to cull at start of each new generation. Must be >= minCull
Method Detail

cullWeakest

protected void cullWeakest()
Cull a random number of Individuals between minCull and maxCull from the least fit Individuals.

Specified by:
cullWeakest in class Population
See Also:
Population.cullOneWeakest()

cullOneWeakest

protected void cullOneWeakest()
Specified by:
cullOneWeakest in class Population
See Also:
Population.cullOneWeakest()

artoflife pre0.1.0-dev

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