Package Bio :: Package GA :: Package Selection :: Module Tournament :: Class TournamentSelection
[hide private]
[frames] | no frames]

Class TournamentSelection

source code

                object --+    
                         |    
Abstract.AbstractSelection --+
                             |
                            TournamentSelection

Implement tournament style selection.
    

Instance Methods [hide private]
 
__init__(self, mutator, crossover, repairer, num_competitors=2)
Initialize the tournament selector.
source code
 
select(self, population)
Perform selection on the population using the Tournament model.
source code

Inherited from Abstract.AbstractSelection: mutate_and_crossover

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mutator, crossover, repairer, num_competitors=2)
(Constructor)

source code 
Initialize the tournament selector.

Arguments:

o num_competitors-- The number of individiuals that should be
involved in a selection round. By default we just have two
individuals (head to head!).

See AbstractSelection for a description of the arguments to
the initializer.

Overrides: object.__init__

select(self, population)

source code 
Perform selection on the population using the Tournament model.

Arguments:

o population -- A population of organisms on which we will perform
selection. The individuals are assumed to have fitness values which
are due to their current genome (ie. the fitness is up to date).

Overrides: Abstract.AbstractSelection.select