giacomelli / GeneticSharp

GeneticSharp is a fast, extensible, multi-platform and multithreading C# Genetic Algorithm library that simplifies the development of applications using Genetic Algorithms (GAs).
MIT License
1.28k stars 335 forks source link

Children created in OrderedCrossover are identical #19

Closed Ares513 closed 6 years ago

Ares513 commented 7 years ago

The children created in OrderedCrossover are identical because the randomization occurs only once, but there are two children created from it.

See PR: https://github.com/giacomelli/GeneticSharp/pull/20

giacomelli commented 7 years ago

We have an unit test (OrderedCrossoverTest.Cross_ParentsWith10Genes_Cross) that validate the children generated by OrderedCrossover, in that test we have the chromosomes below:

Parent one: 8 4 7 3 6 2 5 1 9 0 Parent two: 0 1 2 3 4 5 6 7 8 9

Child one: 0 4 7 3 6 2 5 1 8 9 Child two: 8 2 1 3 4 5 6 7 9 0

As you can see, there is no identical children.

Please, can you provide us the use case where you found the identical children?

giacomelli commented 6 years ago

Closing to cleanup, if you answer the question of previous comment we can open it again.