Skip to content

Bug in save best solutions #25

Description

@screetech

Description

If save_best_solutions = True, the best_solutions list is overwritten after each generation when a new population is being generated. A bug appears on line number 748. Solutions stored in best_solutions are probably just shallow copies, i.e., pointers to population.

What the bug looks like

best_solutions = []
best_solutions = [[9, 10, 5, 9, 9]] # after append on the line 728, it holds first best solution found
best_solutions = [[6, 9, 6, 9, 6]] # after the line 748, original value has been changed (changed after every single generation)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions