Skip to content

Commit a48a6e7

Browse files
authored
Merge pull request #377 from daytime001/dev
Fix duplicate solutions in the final Pareto solution set and address issues with blank Pareto front plots in newer versions of matplotlib.
2 parents 86db7e7 + 89169cf commit a48a6e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

geatpy/Algorithm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ def finishing(self, pop, globalNDSet=None):
512512
NDSet = pop[np.where(levels == 1)[0]] # 只保留种群中的非支配个体,形成一个非支配种群
513513
if NDSet.CV is not None: # CV不为None说明有设置约束条件
514514
NDSet = NDSet[np.where(np.all(NDSet.CV <= 0, 1))[0]] # 最后要彻底排除非可行解
515+
# 排除重复解
516+
NDSet = NDSet[np.unique(NDSet.ObjV,return_index=True,axis=0)[1]]
515517
else:
516518
NDSet = globalNDSet
517519
if self.logTras != 0 and NDSet.sizes != 0 and (

0 commit comments

Comments
 (0)