From 3103fc1c4ef906b276dc2bc84016369dc6ae4a39 Mon Sep 17 00:00:00 2001 From: augustodamasceno Date: Sat, 12 Mar 2022 15:19:31 -0300 Subject: [PATCH] Fix the word resulted in the text message for the warning message about muta tion probability with None value. --- pygad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygad.py b/pygad.py index 7d05815..1ba9d25 100644 --- a/pygad.py +++ b/pygad.py @@ -466,7 +466,7 @@ def __init__(self, # 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. if mutation_num_genes == 0: if self.mutation_probability is None: - 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)) + 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)) mutation_num_genes = 1 elif type(mutation_percent_genes) in GA.supported_int_float_types: @@ -3488,4 +3488,4 @@ def load(filename): raise FileNotFoundError("Error reading the file {filename}. Please check your inputs.".format(filename=filename)) except: raise BaseException("Error loading the file. If the file already exists, please reload all the functions previously used (e.g. fitness function).") - return ga_in \ No newline at end of file + return ga_in