Package Bio :: Package GA :: Package Selection :: Module Diversity :: Class DiversitySelection
[show private | hide private]
[frames | no frames]

Class DiversitySelection

AbstractSelection --+
                    |
                   DiversitySelection


Implement diversity selection.

Diversity selection is performed by trying to select individuals from the population that aren't already in the new_population. A group of selected individuals is then subjected to selection using a passed selection routine.

If new individuals can not be selected, new individuals will be randomly generated and inserted into the population.
Method Summary
  __init__(self, internal_selector, genome_generator)
Initialize a diversity selector.
  select(self, population)
Perform selection on the current population, encouraging diversity.
    Inherited from AbstractSelection
  mutate_and_crossover(self, org_1, org_2)
Perform mutation and crossover on the two organisms.

Method Details

__init__(self, internal_selector, genome_generator)
(Constructor)

Initialize a diversity selector.

Arguments:

o internal_selector - A selection object that will be used to select individuals based on fitness, perform crossover, mutation and repair.

o genome_generator - A function that, when called, will return a genome to be used for a new organism. The genome returned must be a MutableSeq() object.
Overrides:
Bio.GA.Selection.Abstract.AbstractSelection.__init__

select(self, population)

Perform selection on the current population, encouraging diversity.
Overrides:
Bio.GA.Selection.Abstract.AbstractSelection.select

Generated by Epydoc 2.1 on Thu Aug 10 20:04:50 2006 http://epydoc.sf.net