openGA
openGA copied to clipboard
Optimization Issue in Example_SO1: Convergence Failure and Lack of Retained Optimal Samples in Iterative Process
Hi, thanks for this great tool and contribution.
Why hasn't this instance converged? After multiple runs, the optimal samples were not retained. Even when the optimal samples appeared during the iteration, they were not preserved. The program being run is example_so1.cpp, and the last_generation.chromosomes did not update according to the results of the iteration. Is this correct?
Hi,
I got the same problem.
I believe that it is related to the fact that new_generation_fronts.empty() is always true in case of single objective optimization, thus I fixed it by adding || (is_single_objective()) to the test:
if ((!new_generation.fronts.empty()) || (is_single_objective()))
last_generation = new_generation; ```