Skip to content

Commit

Permalink
Merge pull request #147 from cgarcia-UCO/patch-1
Browse files Browse the repository at this point in the history
Last front was being inserted the other way around
  • Loading branch information
jmmcd committed Aug 3, 2022
2 parents 37963c4 + 03e9239 commit b3377c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/operators/replacement.py
Expand Up @@ -138,7 +138,8 @@ def nsga2_replacement(new_pop, old_pop):
# Sort the current pareto front with respect to crowding distance.
pareto.fronts[i] = sorted(pareto.fronts[i],
key=lambda item:
pareto.crowding_distance[item])
pareto.crowding_distance[item],
reverse=True)

# Get number of individuals to add in temp to achieve the pop_size
diff_size = pop_size - len(temp_pop)
Expand Down

0 comments on commit b3377c0

Please sign in to comment.