org.jgap
Interface NaturalSelector

All Known Implementing Classes:
WeightedRouletteSelector

public interface NaturalSelector

Natural selectors are responsible for actually selecting a specified number of Chromosome specimens from a population, using the fitness values as a guide. Usually fitness is treated as a statistic probability of survival, not as the sole determining factor. Therefore, Chromosomes with higher fitness values are more likely to survive than those with lesser fitness values, but it's not guaranteed.

Author:
Neil Rotstan (neil at bluesock.org)

Method Summary
 void add(org.jgap.Chromosome chromosome, int fitness)
          Add a Chromosome instance and corresponding fitness value to this selector's working pool of Chromosomes.
 void empty()
          Empty out the working pool of Chromosomes.
 org.jgap.Chromosome[] select(int howMany)
          Select a given number of Chromosomes from the pool that will continue to survive.
 

Method Detail

add

public void add(org.jgap.Chromosome chromosome,
                int fitness)
Add a Chromosome instance and corresponding fitness value to this selector's working pool of Chromosomes.


select

public org.jgap.Chromosome[] select(int howMany)
Select a given number of Chromosomes from the pool that will continue to survive. This selection should be guided by the fitness values, but fitness should be treated as a statistical probability of survival, not as the sole determining factor. In other words, Chromosomes with higher fitness values are more likely to be selected than those with lower fitness values, but it's not guaranteed.

Returns:
An array of the selected Chromosomes.

empty

public void empty()
Empty out the working pool of Chromosomes.