Skip to content

Commit 63ad773

Browse files
authored
Add files via upload
1 parent fcf2019 commit 63ad773

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

algorithm/Cso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def optimum(self, localVal, chromosome):
5656

5757

5858
def updatePosition1(self, population):
59-
current_position = self._current_position[:]
59+
current_position = np.copy(self._current_position)
6060
populationSize = self._populationSize
6161
u, v = np.random.randn(populationSize) * self._σu, np.random.randn(populationSize) * self._σv
6262
S = u / (np.abs(v) ** (1 / self._beta))

algorithm/GaQpso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def gaussian(x, sigma):
6464

6565
def updatePosition(self, population):
6666
mBest = np.zeros(self._chromlen, dtype=float)
67-
current_position = self._current_position[:]
67+
current_position = np.copy(self._current_position)
6868
populationSize = self._populationSize
6969

7070
for i in range(populationSize):

0 commit comments

Comments
 (0)