Skip to content
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

filter solutions by constraints before non-dominated sorting #3

Open
ylzhouchris opened this issue May 1, 2024 · 0 comments
Open

Comments

@ylzhouchris
Copy link
Collaborator

self.utils.fast_nondominated_sort(neighbors)
cnt = 0
for front in neighbors.fronts:
self.utils.calculate_crowding_distance(front)
cnt += 1
#------分析front 0中的解,满足constraint的保留到final solution,并去掉。--------
to_remove = Population()
to_remove.extend(ind for ind in neighbors if ind.constraint[0] == self.max_sensor)
population_final.extend(ind for ind in neighbors.fronts[0] if ind.constraint[0] == self.max_sensor)
# print('population_final:',len(population_final))
for ind in to_remove:
neighbors.remove(ind)

Filter solutions through constraints before non-dominated sorting is more efficient.

sywang-20 added a commit that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant