Skip to content

Commit

Permalink
Fix duplicate solutions in the final Pareto solution set and address …
Browse files Browse the repository at this point in the history
…issues with blank Pareto front plots in newer versions of matplotlib.
  • Loading branch information
daytime001 committed Aug 4, 2024
1 parent 44df916 commit 66efd5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions geatpy/Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ def finishing(self, pop, globalNDSet=None):
NDSet = pop[np.where(levels == 1)[0]] # 只保留种群中的非支配个体,形成一个非支配种群
if NDSet.CV is not None: # CV不为None说明有设置约束条件
NDSet = NDSet[np.where(np.all(NDSet.CV <= 0, 1))[0]] # 最后要彻底排除非可行解
# 排除重复解
NDSet = NDSet[np.unique(NDSet.ObjV,return_index=True,axis=0)[1]]
else:
NDSet = globalNDSet
if self.logTras != 0 and NDSet.sizes != 0 and (
Expand Down
3 changes: 2 additions & 1 deletion geatpy/visualization/PointScatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def draw(self):
elif self.Dimension == 3:
if self.fig is None and self.ax is None:
self.fig = plt.figure() # 生成一块画布
self.ax = Axes3D(self.fig) # 创建绘图区域
# self.ax = Axes3D(self.fig) # 创建绘图区域
self.ax = self.fig.add_subplot(111, projection='3d') # 创建绘图区域
self.ax.view_init(elev=30, azim=45) # 旋转
for idx, data in enumerate(self.data_set):
params = self.params_set[idx]
Expand Down

0 comments on commit 66efd5d

Please sign in to comment.