gaft.operators.crossover¶
Uniform Crossover operator implementation.
-
class
gaft.operators.crossover.uniform_crossover.
UniformCrossover
(pc, pe=0.5)¶ Bases:
gaft.plugin_interfaces.operators.crossover.Crossover
Crossover operator with uniform crossover algorithm, see https://en.wikipedia.org/wiki/Crossover_(genetic_algorithm)
Parameters: - pc (float in (0.0, 1.0]) – The probability of crossover (usaully between 0.25 ~ 1.0)
- pe (float in range (0.0, 1.0]) – Gene exchange probability.
-
cross
(father, mother)¶ Cross chromsomes of parent using uniform crossover method.
Parameters: population ( gaft.components.Population
) – Population where the selection operation occurs.Returns: Selected parents (a father and a mother) Return type: list of gaft.components.IndividualBase
-
gaft.operators.crossover.uniform_crossover.
random
() → x in the interval [0, 1).¶