diff --git a/src/genetic_algorithm.py b/src/genetic_algorithm.py index ca3b16b..c163779 100644 --- a/src/genetic_algorithm.py +++ b/src/genetic_algorithm.py @@ -104,8 +104,9 @@ def uniform_crossover(parents, m): def position_crossover(parents, m): matching_genes = get_matching_genes(parents) shuffled_genes = select_random_genes(matching_genes, parents, m) - offspring = populate_offspring(values=[matching_genes, shuffled_genes]) - return offspring + first_offspring = populate_offspring(values=[matching_genes, shuffled_genes]) + second_offspring = populate_offspring(values=[matching_genes, shuffled_genes]) + return [first_offspring, second_offspring] def crossover(mode, parents, m):