Base_crossovers

K_point_crossover

class gaggle.operators.crossover.base_crossovers.k_point_crossover.KPointCrossover(ga_args: GAArgs = None)[source]

Bases: Crossover

Generalization of single point crossover to k points See the following tutorial for a more in depth description https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_crossover.htm Generates two children from two parents

children_per_crossover = 2
crossover_individual(individuals: list[gaggle.population.individual.Individual]) list[gaggle.population.individual.Individual][source]

Speficies how to create children from parents :param individuals: a list of parents to crossover (typically 2)

Returns:

A list of children created from the parents (typically 2)

deprecated_crossover_individual(individuals: list[gaggle.population.individual.Individual]) list[gaggle.population.individual.Individual][source]
mates_per_crossover = 2

Uniform_crossover

class gaggle.operators.crossover.base_crossovers.uniform_crossover.UniformCrossover(ga_args: GAArgs = None)[source]

Bases: Crossover

Crossover where each gene has equal probability of coming from either parent See the following tutorial for a more in depth description https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_crossover.htm Generates two children from two parents

children_per_crossover = 2
crossover_individual(individuals: list[gaggle.population.individual.Individual]) list[gaggle.population.individual.Individual][source]

Speficies how to create children from parents :param individuals: a list of parents to crossover (typically 2)

Returns:

A list of children created from the parents (typically 2)

mates_per_crossover = 2