biopython v1.71.0 Bio.GA.Crossover.GeneralPoint.GeneralPointCrossover
Perform n-point crossover between genomes at some defined rates.
Ideas on how to use this class:
- Call it directly ( construct, do_crossover )
- Use one of the provided subclasses
Inherit from it:
- replace _generate_locs with a more domain specific technique
- replace _crossover with a more efficient technique for your point-count
Link to this section Summary
Initialize to do crossovers at the specified probability
Generalized Crossover Function
Generalized Location Generator
Potentially do a crossover between the two organisms
Link to this section Functions
Link to this function __init__()
Initialize to do crossovers at the specified probability.
Link to this function _crossover()
Generalized Crossover Function.
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])
Link to this function _generate_locs()
Generalized Location Generator.
- bound (int) - upper bound
Returns: +x_0…x_n+[bound] where n=self._npoints-1 and 0 < x_0 < x_1 … < bound
Link to this function do_crossover()
Potentially do a crossover between the two organisms.