pg.evolution.recombinators.Uniform#
Accessible via pg.evolution.recombinators.Uniform
.
- class Uniform(where=All(), seed=None)[source]#
Bases:
pg.evolution.recombinators.PointWise
Uniform crossover (UX) with equal probability.
The uniform recombinator makes decision at each position on whether the two parents’ DNA should be swapped or not. It produces 2 children.
Reference:
G. Syswerda. 1989. Uniform crossover in genetic algorithms. In Proceedings of the 3rd International Conference on Genetic Algorithms. Morgan Kaufman, 2–9.
https://ci.nii.ac.jp/naid/10000012509/
Methods:
merge
(decision_point, parent_decisions)Implementation of point-wise decision making.
- merge(decision_point, parent_decisions)[source]#
Implementation of point-wise decision making.
- Return type:
- Parameters:
decision_point – Decision point for recombination.
parent_decisions – A list of parent’s decisions. Each item should be an int as an active single-choice decision, a list of int as active multi- choice decisions, a float as an active float decision, or None for inactive decision point (whose parent space is not chosen).
global_state – An optional keyword argument as the global state. Subclass can omit.
step – An optional keyword argument as the current step. Subclass can omit.
- Returns:
An int, list of int or float as the decision made for the decision point.