Skip to content

Commit

Permalink
Fixing f_gap issue in SingleObjectiveOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Nov 26, 2023
1 parent 9107776 commit 26e7e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/algorithms/moo/nsga2/nsga2_pcx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
algorithm,
('n_gen', 200),
seed=1,
verbose=False)
verbose=True)

plot = Scatter()
plot.add(problem.pareto_front(), plot_type="line", color="black", alpha=0.7)
Expand Down
3 changes: 1 addition & 2 deletions pymoo/util/display/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ def update(self, algorithm):

if opt.feas:
self.f_min.set(opt.f)
if self.best:
if self.best is not None:
self.f_gap.set(opt.f - self.best)

else:
self.f_min.set(None)
self.f_gap.set(None)

0 comments on commit 26e7e5c

Please sign in to comment.