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