Skip to content

Commit 1a8afc3

Browse files
authored
Fixes when allow_duplicate_genes=False
There might be 2 duplicate genes where changing either of the 2 duplicating genes will not solve the problem. This problem can be solved by randomly changing one of the non-duplicating genes that may make a room for a unique value in one the 2 duplicating genes. For example, if gene_space=[[3, 0, 1], [4, 1, 2], [0, 2], [3, 2, 0]] and the solution is [3 2 0 0], then the values of the last 2 genes duplicate. There are no possible changes in the last 2 genes to solve the problem. But it could be solved by changing the second gene from 2 to 4. As a result, any of the last 2 genes can take the value 2 and solve the duplicates.
1 parent 5ed45bd commit 1a8afc3

File tree

1 file changed

+451
-180
lines changed

1 file changed

+451
-180
lines changed

0 commit comments

Comments
 (0)