Package Bio :: Package GA :: Package Crossover :: Module GeneralPoint :: Class InterleaveCrossover
[show private | hide private]
[frames | no frames]

Class InterleaveCrossover

GeneralPointCrossover --+
                        |
                       InterleaveCrossover


Demonstration class for Interleaving crossover

Interleaving: AbCdEfG, aBcDeFg
Method Summary
  __init__(self, crossover_prob)
  _crossover(self, x, no, locs)
Generalized Crossover Function:...
  _generate_locs(self, bound)
Generalized Location Generator: arguments: bound (int) - upper bound returns: [0]+x_0...x_n+[bound] where n=self._npoints-1 and 0 < x_0 < x_1 ...
    Inherited from GeneralPointCrossover
  do_crossover(self, org_1, org_2)
Potentially do a crossover between the two organisms.

Method Details

_crossover(self, x, no, locs)

Generalized Crossover Function:
 
arguments: 
    x (int)        - genome number [0|1]
    no (organism,organism)
                   - new organisms
    locs (int list, int list)
                   - lists of locations, 
                     [0, +n points+, bound]
                     for each genome (sync'd with x)

 return type: sequence (to replace no[x])
Overrides:
Bio.GA.Crossover.GeneralPoint.GeneralPointCrossover._crossover (inherited documentation)

_generate_locs(self, bound)

Generalized Location Generator:
 
arguments:
    bound (int)   - upper bound 
 
returns: [0]+x_0...x_n+[bound]
  where n=self._npoints-1
    and 0 < x_0 < x_1 ... < bound
Overrides:
Bio.GA.Crossover.GeneralPoint.GeneralPointCrossover._generate_locs (inherited documentation)

Generated by Epydoc 2.1 on Sat Jul 16 15:49:03 2005 http://epydoc.sf.net