geneticengine.algorithms.gp.operators.selection
Module Contents
Classes
TournamentSelection represents a tournament selection algorithm, where |
|
Implements Lexicase Selection |
- class geneticengine.algorithms.gp.operators.selection.TournamentSelection(tournament_size, with_replacement=False)
Bases:
geneticengine.algorithms.gp.structure.GeneticStep
TournamentSelection represents a tournament selection algorithm, where tournament_size individuals are selected at random, and only the best passes to the next generation.
- Parameters:
tournament_size (int) – number of individuals from the population that will be randomly selected
with_replacement (bool) – whether the selected individuals can appear again in another tournament (default: False)
- iterate(problem, evaluator, representation, random, population, target_size, generation)
- Parameters:
problem (geneticengine.problems.Problem)
evaluator (geneticengine.evaluation.Evaluator)
representation (geneticengine.representations.api.Representation)
population (Iterator[geneticengine.solutions.individual.Individual])
target_size (int)
generation (int)
- Return type:
- class geneticengine.algorithms.gp.operators.selection.LexicaseSelection(epsilon=False)
Bases:
geneticengine.algorithms.gp.structure.GeneticStep
Implements Lexicase Selection (http://williamlacava.com/research/lexicase/).
- Parameters:
epsilon (bool) – if True, espilon-lexicase is performed. We use the method given by equation 5 in https://dl.acm.org/doi/pdf/10.1145/2908812.2908898.
- iterate(problem, evaluator, representation, random, population, target_size, generation)
- Parameters:
problem (geneticengine.problems.Problem)
evaluator (geneticengine.evaluation.Evaluator)
representation (geneticengine.representations.api.Representation)
population (Iterator[geneticengine.solutions.individual.Individual])
target_size (int)
generation (int)
- Return type: