Skip to content

Commit 45dc134

Browse files
author
Julian Blank
committed
0.5.0.rc8
1 parent 1a3db08 commit 45dc134

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

pymoo/core/problem.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Implementation
1111
# ---------------------------------------------------------------------------------------------------------
1212

13+
1314
class Problem:
1415
def __init__(self,
1516
n_var=-1,
@@ -92,11 +93,9 @@ def __init__(self,
9293
self.exclude_from_serialization = exclude_from_serialization if exclude_from_serialization is not None else []
9394

9495
# the loader for the pareto set (ps)
95-
def calc_ps(*args, **kwargs): return at_least_2d_array(self._calc_pareto_set(*args, **kwargs))
9696
self._pareto_set = Cache(calc_ps, raise_exception=False)
9797

9898
# the loader for the pareto front (pf)
99-
def calc_pf(*args, **kwargs): return at_least_2d_array(self._calc_pareto_front(*args, **kwargs))
10099
self._pareto_front = Cache(calc_pf, raise_exception=False)
101100

102101
self._ideal_point, self._nadir_point = None, None
@@ -192,10 +191,10 @@ def ideal_point(self):
192191
return self._ideal_point
193192

194193
def pareto_front(self, *args, **kwargs):
195-
return self._pareto_front.exec(*args, **kwargs)
194+
return self._pareto_front.exec(self, *args, **kwargs)
196195

197196
def pareto_set(self, *args, **kwargs):
198-
return self._pareto_set.exec(*args, **kwargs)
197+
return self._pareto_set.exec(self, *args, **kwargs)
199198

200199
@abstractmethod
201200
def _evaluate(self, x, out, *args, **kwargs):
@@ -241,6 +240,14 @@ def __getstate__(self):
241240
return self.__dict__
242241

243242

243+
def calc_ps(problem, *args, **kwargs):
244+
return at_least_2d_array(problem._calc_pareto_set(*args, **kwargs))
245+
246+
247+
def calc_pf(problem, *args, **kwargs):
248+
return at_least_2d_array(problem._calc_pareto_front(*args, **kwargs))
249+
250+
244251
# ---------------------------------------------------------------------------------------------------------
245252
# Elementwise Problem
246253
# ---------------------------------------------------------------------------------------------------------

pymoo/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.5.0.rc7"
1+
__version__ = "0.5.0.rc8"

0 commit comments

Comments
 (0)