1

I would like to ask what should I do if my Mat (the first gene of the chromosome) is only 0 and 2 (not 1)? Following is the code:

tools.mutUniformInt(low=[Mat_min, 0, Span_min, Span_min], up=[Mat_max, 7, Span_max, Span_max], indpb=0.05, individual=ind)

If I use Mat_min=0 and Mat_max=2, 1 will be counted. So I am really confused. Thank you in advance.

doctorlove
  • 18,872
  • 2
  • 46
  • 62
  • Are you wanting a different mutation scheme for the first gene only? – doctorlove Nov 24 '21 at 12:08
  • I wonder if you can write your own mutation algo or use https://deap.readthedocs.io/en/master/tutorials/basic/part2.html#tool-decoration – doctorlove Nov 24 '21 at 12:19
  • Yes, the first gene only. Actually, the first gene range is 0, 1, and 2. But I want to make the options for the users to choose either all of them (0,1,2) or partially from that range (0, 1 or 0,2 or 1,2) – user17497858 Nov 24 '21 at 15:34

0 Answers0