def gen_individual(icls, min, max):
return icls([random.random() for _ in range(random.randint(min, max, 2))])
toolbox.register("individual", gen_individual, creator.Individual, min=20, max=200)
Things seemed to work fine until I have noticed that the individuals sizes can go below the defined range 20-200, and can create individuals of size 10 and less and these sizes causes problems in my model. Any ideas for: why is this happening having that the range is defined, any suggestions for how to set the range between 20 and 200 restrictively ?