Skip to content

Commit b498650

Browse files
authored
Merge pull request ahmedfgad#111 from iamnotstone/master
Fixed an error in documentation
2 parents 2f2c825 + d88e9f3 commit b498650

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/README_pygad_ReadTheDocs.rst

+2-2
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)