8000 Merge pull request #111 from iamnotstone/master · ahmedfgad/GeneticAlgorithmPython@b498650 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b498650

Browse files
authored
Merge pull request #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

Lines changed: 2 additions & 2 deletions
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)
0