-
-
Notifications
You must be signed in to change notification settings - Fork 482
best_solution()
unecessarily run cal_pop_fitness()
#204
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
Comments
@yasirroni, this is indeed a good question. To save time re-calculating the fitness values when calling the The reason why this is not set as default is because sometimes the user changes the population before calculating the Assume the we have The user decided to change the population after Because As a result, we cannot set the |
Okay. Thanks for clarification with use case. Maybe, we can add the code snippet below to the doc?
|
Yes please open a PR. |
PR on #216 |
The default behavior of
best_solution()
is to re-runcal_pop_fitness()
to get the best_solution. This is explained on the docs too in https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html?highlight=gene_type#best-solution. Workaround is to use:Why this is chosen as the default?
The text was updated successfully, but these errors were encountered: