Package Bio :: Package GA :: Package Selection :: Module Abstract :: Class AbstractSelection
[show private | hide private]
[frames | no frames]

Class AbstractSelection

Known Subclasses:
DiversitySelection, RouletteWheelSelection, TournamentSelection

Base class for Selector classes.

This classes provides useful functions for different selector classes and also defines the functions that all selector classes must implement.

This class should not be used directly, but rather should be subclassed.
Method Summary
  __init__(self, mutator, crossover, repairer)
Initialize a selector.
  mutate_and_crossover(self, org_1, org_2)
Perform mutation and crossover on the two organisms.
  select(self, population)

Method Details

__init__(self, mutator, crossover, repairer=None)
(Constructor)

Initialize a selector.

Arguments:

o mutator -- A Mutation object which will perform mutation on an individual.

o crossover -- A Crossover object which will take two individuals and produce two new individuals which may have had crossover occur.

o repairer -- A class which can do repair on rearranged genomes to eliminate infeasible individuals. If set at None, so repair will be done.

mutate_and_crossover(self, org_1, org_2)

Perform mutation and crossover on the two organisms.

This uses the classes mutator and crossover functions to perform the manipulations.

If a repair class is available, then the rearranged genomes will be repaired to make them feasible.

The newly created individuals are returned.

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