pg.evolution.recombinators.Average¶
Accessible via pg.evolution.recombinators.Average
.
- class Average(where=All())[source]¶
Bases:
pg.evolution.recombinators.Numeric
Average crossover.
Average crossover performs point-wise average of the parents’ decisions on float decision points. We include this recombinator to help float decisions converge.
References: https://link.springer.com/content/pdf/10.1007/s00500-006-0049-7.pdf
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.