diff --git a/algorithm/Hgasso.py b/algorithm/Hgasso.py index 6dff344..aa1807b 100644 --- a/algorithm/Hgasso.py +++ b/algorithm/Hgasso.py @@ -24,7 +24,7 @@ def __init__(self, configuration, numberOfCrossoverPoints=2, mutationSize=2, cro def replacement(self, population): populationSize = len(population) - climax = self._climax + climax, decline = self._climax, 1 - self._climax for i in range(populationSize): fitness = population[i].fitness @@ -44,6 +44,8 @@ def replacement(self, population): self._sgBest = self._current_position[i][:] self._motility[i] = not self._motility[i] + if self._repeatRatio > self._sBestScore[i]: + self._sBestScore[i] -= self._repeatRatio * decline if self._repeatRatio > climax and self._sgBestScore > climax: if i > (populationSize * self._sgBestScore): population[i].updatePositions(self._current_position[i])