From d0d8e0cfd0b1a7f1ae0dffab81469730a8506436 Mon Sep 17 00:00:00 2001 From: jsbyysheng Date: Mon, 25 Dec 2023 00:21:40 +0800 Subject: [PATCH] Compatible with the latest version of numpy. --- geatpy/benchmarks/mops/DTLZ5.py | 2 +- geatpy/benchmarks/mops/DTLZ6.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geatpy/benchmarks/mops/DTLZ5.py b/geatpy/benchmarks/mops/DTLZ5.py index e2f85f44..e1bf1c8f 100644 --- a/geatpy/benchmarks/mops/DTLZ5.py +++ b/geatpy/benchmarks/mops/DTLZ5.py @@ -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)) diff --git a/geatpy/benchmarks/mops/DTLZ6.py b/geatpy/benchmarks/mops/DTLZ6.py index 0933cc01..0517126d 100644 --- a/geatpy/benchmarks/mops/DTLZ6.py +++ b/geatpy/benchmarks/mops/DTLZ6.py @@ -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))