Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cgp/ea/mu_plus_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def step(
# concatenating the parent population to the offspring
# population instead of the other way around
combined = offsprings + pop.parents
assert all(ind.idx is not None for ind in combined)
assert len(set(ind.idx for ind in combined)) == len(combined)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe below could be easier to understand? (No preference though, both ways should be fine)

assert len(set(ind.idx for ind in combined)) == len([int.idx for ind in combined])


# we follow a two-step process for selection of new parents:
# we first determine the fitness for all individuals, then, if
Expand Down