Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan committed Oct 2, 2022
1 parent 0842b2b commit c5bce07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion algorithm/Hgasso.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])
Expand Down

0 comments on commit c5bce07

Please sign in to comment.