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.26k
stars
330
forks
source link
Multiple occurances of same chromosome instance in generation #92
Because RankSelection, RouletteWheelSelection and TournamentSelection can produce a generation where multiple instances of same chromosome occures it might result in mutation will affect all occurances of that chromosome.
Possible solutions:
use Clone method of IChromosome inside these selections
before saving chromosmes into new generation create new collection that comtains their copies, using Clone method
make mutations produce new chromosome instead of modifying current one (might better for perfromance compare to 1 and 2)
p.s. I'v not tested if it actually happens, only read the code (I'm working on a project that has similar stuff). I searched for all places where Clone method is called and did not found any usages that can solve this potential issue.
Because
RankSelection
,RouletteWheelSelection
andTournamentSelection
can produce a generation where multiple instances of same chromosome occures it might result in mutation will affect all occurances of that chromosome.Possible solutions:
Clone
method ofIChromosome
inside these selectionsClone
methodp.s. I'v not tested if it actually happens, only read the code (I'm working on a project that has similar stuff). I searched for all places where
Clone
method is called and did not found any usages that can solve this potential issue.