sywang-20 / opt-greedy

Code and Dataset for 'Evolutionary Greedy Algorithm for Optimal Sensor Placement Problem in Urban Sewage Surveillance'
http://urban-computing.com/urbcomp2024/accept/paper_2.pdf
0 stars 0 forks source link

simplify #12

Open ylzhouchris opened 4 months ago

ylzhouchris commented 4 months ago

https://github.com/sywang-20/opt-greedy/blob/3c11ad7c118ba8df0b165df659d71d70a9e03efd/CODE/greedy-original/evolution.py#L144-L161

1) evaluate all individuals to generate front_num and crowding distance 2) sort all individuals by front_num (primary) and crowding distance (second) 3) self.population = neighbors[0: self.max_num_individuals]

sywang-20 commented 4 months ago

coding issue, the simplified version is wrong, but the former one works. while loop may be more efficient, since it doesn't need to calculate the crowding distance for all individuals, only for the individuals in the one front @ylzhouchris