Skip to content

Commit 5f9a62d

Browse files
authored
replace deprecated parameters
1 parent 073a3f8 commit 5f9a62d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def fitness_function(solution, solution_idx):
4141
mutation_percent_genes = 10 # Percentage of genes to mutate. This parameter has no action if the parameter mutation_num_genes exists or when mutation_type is None.
4242

4343
last_fitness = 0
44-
def callback_generation(ga_instance):
44+
def on_generation(ga_instance):
4545
global last_fitness
4646
print("Generation = {generation}".format(generation=ga_instance.generations_completed))
4747
print("Fitness = {fitness}".format(fitness=ga_instance.best_solution()[1]))
@@ -61,7 +61,7 @@ def callback_generation(ga_instance):
6161
crossover_type=crossover_type,
6262
mutation_type=mutation_type,
6363
mutation_percent_genes=mutation_percent_genes,
64-
callback_generation=callback_generation)
64+
on_generation=callback_generation)
6565

6666
# Running the GA to optimize the parameters of the function.
6767
ga_instance.run()

0 commit comments

Comments
 (0)