Skip to content

Commit

Permalink
Merge pull request geatpy-dev#349 from jsbyysheng/master
Browse files Browse the repository at this point in the history
Compatible with the latest version of numpy.
  • Loading branch information
geatpy-dev authored Apr 10, 2024
2 parents 28835af + d0d8e0c commit b8b7c84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geatpy/benchmarks/mops/DTLZ5.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def calReferObjV(self): # 设定目标数参考值(本问题目标函数参
P = np.vstack([np.linspace(0, 1, N), np.linspace(1, 0, N)]).T
P = P / np.tile(np.sqrt(np.sum(P**2, 1, keepdims=True)),
(1, P.shape[1]))
P = np.hstack([P[:, np.zeros(self.M - 2, dtype=np.int)], P])
P = np.hstack([P[:, np.zeros(self.M - 2, dtype=np.int32)], P])
referenceObjV = P / np.sqrt(2)**np.tile(
np.hstack([self.M - 2, np.linspace(self.M - 2, 0, self.M - 1)]),
(P.shape[0], 1))
Expand Down
2 changes: 1 addition & 1 deletion geatpy/benchmarks/mops/DTLZ6.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def calReferObjV(self): # 设定目标数参考值(本问题目标函数参
P = np.vstack([np.linspace(0, 1, N), np.linspace(1, 0, N)]).T
P = P / np.tile(np.sqrt(np.sum(P**2, 1, keepdims=True)),
(1, P.shape[1]))
P = np.hstack([P[:, np.zeros(self.M - 2, dtype=np.int)], P])
P = np.hstack([P[:, np.zeros(self.M - 2, dtype=np.int32)], P])
referenceObjV = P / np.sqrt(2)**np.tile(
np.hstack([self.M - 2, np.linspace(self.M - 2, 0, self.M - 1)]),
(P.shape[0], 1))
Expand Down

0 comments on commit b8b7c84

Please sign in to comment.