Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple occurances of same chromosome instance in generation #92

Closed
NesCafe62 opened this issue May 6, 2021 · 0 comments
Closed

Multiple occurances of same chromosome instance in generation #92

NesCafe62 opened this issue May 6, 2021 · 0 comments
Assignees
Labels

Comments

@NesCafe62
Copy link

NesCafe62 commented May 6, 2021

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:

  1. use Clone method of IChromosome inside these selections
  2. before saving chromosmes into new generation create new collection that comtains their copies, using Clone method
  3. 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.

@giacomelli giacomelli self-assigned this Sep 8, 2022
@giacomelli giacomelli added the bug label Sep 8, 2022
giacomelli added a commit that referenced this issue Sep 10, 2022
Features
* #62 - Suggestion: Add an ability to set PRNG's initial seed

Bug fixes
* #72 - GeneticAlgorithm.BestChromosome.Fitness decrease over time when using EliteSelection
* #92 - Multiple occurances of same chromosome instance in generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants