Skip to content

best_solution() unecessarily run cal_pop_fitness() #204

Closed
@yasirroni

Description

@yasirroni

The default behavior of best_solution() is to re-run cal_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:

ga_instance.best_solution(pop_fitness=ga_instance.last_generation_fitness)

Why this is chosen as the default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions