You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
num_parents_mating =4# Number of solutions to be selected as parents in the mating pool.
1672
+
num_generations =100# Number of generations.
1673
+
num_parents_mating =10# Number of solutions to be selected as parents in the mating pool.
1678
1674
1679
-
# To prepare the initial population, there are 2 ways:
1680
-
# 1) Prepare it yourself and pass it to the initial_population parameter. This way is useful when the user wants to start the genetic algorithm with a custom initial population.
1681
-
# 2) Assign valid integer values to the sol_per_pop and num_genes parameters. If the initial_population parameter exists, then the sol_per_pop and num_genes parameters are useless.
1682
-
sol_per_pop =8# Number of solutions in the population.
1675
+
sol_per_pop =20# Number of solutions in the population.
1683
1676
num_genes =len(function_inputs)
1684
1677
1685
-
init_range_low =-2
1686
-
init_range_high =5
1687
-
1688
-
parent_selection_type ="sss"# Type of parent selection.
1689
-
keep_parents =1# Number of parents to keep in the next population. -1 means keep all parents and 0 means keep nothing.
1690
-
1691
-
crossover_type ="single_point"# Type of the crossover operator.
1692
-
1693
-
# Parameters of the mutation operation.
1694
-
mutation_type ="random"# Type of the mutation operator.
1695
-
mutation_percent_genes =10# Percentage of genes to mutate. This parameter has no action if the parameter mutation_num_genes exists.
0 commit comments