8000 Prevent duplicates in the genes · HasukiHT/GeneticAlgorithmPython@5ed45bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ed45bd

Browse files
authored
Prevent duplicates in the genes
A new bool parameter called allow_duplicate_genes is supported. If True, then a solution/chromosome may have duplicate gene values. If False, then each gene will have a unique value in its solution. This behavior is not guaranteed when a gene is assigned a dict in the gene_space parameter. For example, the last gene here (gene_space=[[7, 8, 9], [9, 8, 7], {"low": 7, "high": 10}]) is assigned a dictionary. As a result, it may have duplicate values even if allow_duplicate_genes=False.
1 parent 992ba51 commit 5ed45bd

File tree

1 file changed

+268
-29
lines changed

1 file changed

+268
-29
lines changed

0 commit comments

Comments
 (0)
0