Return 2 offsprings in the position crossover
This commit is contained in:
parent
49d8383133
commit
7c434fb9cd
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue