8000 Fix the word resulted in the text message for the warning message abo… · ahmedfgad/GeneticAlgorithmPython@3103fc1 · 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 3103fc1

Browse files
Fix the word resulted in the text message for the warning message about muta
tion probability with None value.
1 parent 76bb230 commit 3103fc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pygad.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def __init__(self,
466466
# Based on the mutation percentage of genes, if the number of selected genes for mutation is less than the least possible value which is 1, then the number will be set to 1.
467467
if mutation_num_genes == 0:
468468
if self.mutation_probability is None:
469-
if not self.suppress_warnings: warnings.warn("The percentage of genes to mutate (mutation_percent_genes={mutation_percent}) resutled in selecting ({mutation_num}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.".format(mutation_percent=mutation_percent_genes, mutation_num=mutation_num_genes))
469+
if not self.suppress_warnings: warnings.warn("The percentage of genes to mutate (mutation_percent_genes={mutation_percent}) resulted in selecting ({mutation_num}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.".format(mutation_percent=mutation_percent_genes, mutation_num=mutation_num_genes))
470470
mutation_num_genes = 1
471471

472472
elif type(mutation_percent_genes) in GA.supported_int_float_types:
@@ -3488,4 +3488,4 @@ def load(filename):
34883488
raise FileNotFoundError("Error reading the file {filename}. Please check your inputs.".format(filename=filename))
34893489
except:
34903490
raise BaseException("Error loading the file. If the file already exists, please reload all the functions previously used (e.g. fitness function).")
3491-
return ga_in
3491+
return ga_in

0 commit comments

Comments
 (0)
0