Skip to content

filter solutions by constraints before non-dominated sorting #3

@ylzhouchris

Description

@ylzhouchris

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.

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