luca-scr / GA

An R package for optimization using genetic algorithms
http://luca-scr.github.io/GA/
91 stars 29 forks source link

keepBest problem #22

Closed andyjslee closed 5 years ago

andyjslee commented 5 years ago

Thank you for developing such a useful package. Your package is helping me a lot with my current project.

There seems to be an issue with the keepBest option.

After iteration 1, the bestSol list is all NULL. After the last iteration k, the bestSol list is populated by k-1 elements.

I think that many will agree the expected behavior is that after iteration 1, the bestSol list contains 1 element and after iteration k, the bestSol list contains k elements.

It would be great if this could be updated accordingly. Thank you!

luca-scr commented 5 years ago

Can you provide a minimal reproducible example (data+code) so I can trace the issue. See https://en.wikipedia.org/wiki/Minimal_Working_Example