Skip to content

Commit 97b3f25

Browse files
committed
Replace deepcopy with copy
1 parent 6d973bf commit 97b3f25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

optimizer/mopso.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,9 @@ def update_pareto_front(self):
383383
dominanted = get_dominated(particle_fitnesses, pareto_lenght)
384384

385385
if self.incremental_pareto:
386-
self.pareto_front = [copy.deepcopy(particles[i]) for i in range(len(particles)) if not dominanted[i]]
386+
self.pareto_front = [copy.copy(particles[i]) for i in range(len(particles)) if not dominanted[i]]
387387
else:
388-
self.pareto_front = [copy.deepcopy(particles[i]) for i in range(pareto_lenght, len(particles)) if not dominanted[i]]
388+
self.pareto_front = [copy.copy(particles[i]) for i in range(pareto_lenght, len(particles)) if not dominanted[i]]
389389

390390
crowding_distances = self.calculate_crowding_distance(
391391
self.pareto_front)

0 commit comments

Comments
 (0)