Open ylzhouchris opened 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
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]