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=7# Number of solutions to be selected as parents in the mating pool.
25
+
num_parents_mating=10# Number of solutions to be selected as parents in the mating pool.
25
26
26
27
# To prepare the initial population, there are 2 ways:
27
28
# 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.
28
29
# 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.
29
-
sol_per_pop=50# Number of solutions in the population.
30
+
sol_per_pop=20# Number of solutions in the population.
30
31
num_genes=len(function_inputs)
31
32
32
33
init_range_low=-2
33
34
init_range_high=5
34
35
35
36
parent_selection_type="sss"# Type of parent selection.
36
-
keep_parents=7# Number of parents to keep in the next population. -1 means keep all parents and 0 means keep nothing.
37
+
keep_parents=-1# Number of parents to keep in the next population. -1 means keep all parents and 0 means keep nothing.
37
38
38
39
crossover_type="single_point"# Type of the crossover operator.
0 commit comments