File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1961,7 +1961,7 @@ second parent.
19611961 parent1 = parents[idx % parents.shape[0 ], :].copy()
19621962 parent2 = parents[(idx + 1 ) % parents.shape[0 ], :].copy()
19631963
1964- random_split_point = numpy.random.choice(range (offspring_size[0 ]))
1964+ random_split_point = numpy.random.choice(range (offspring_size[1 ]))
19651965
19661966 parent1[random_split_point:] = parent2[random_split_point:]
19671967
@@ -2018,7 +2018,7 @@ gene's value.
20182018 def mutation_func (offspring , ga_instance ):
20192019
20202020 for chromosome_idx in range (offspring.shape[0 ]):
2021- random_gene_idx = numpy.random.choice(range (offspring.shape[0 ]))
2021+ random_gene_idx = numpy.random.choice(range (offspring.shape[1 ]))
20222022
20232023 offspring[chromosome_idx, random_gene_idx] += numpy.random.random()
20242024
You can’t perform that action at this time.
0 commit comments