Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Aug 14, 2023
1 parent 2e3039b commit f23237e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions algorithm/Cso.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def replacement(self, population):
chromosome.updatePositions(self._current_position[i])
population[i] = chromosome

return super().replacement(population)
result = super().replacement(population)
result[0].extractPositions(self._current_position[0])
self._sBestScore = self._current_position[0, :]
return result


# Starts and executes algorithm
Expand Down Expand Up @@ -145,9 +148,6 @@ def run(self, maxRepeat=9999, minFitness=0.999):
pop[next] = self.replacement(pop[cur])
self._best = pop[next][0] if pop[next][0].dominates(pop[cur][0]) else pop[cur][0]

self._best.extractPositions(self._current_position[0])
self._sBestScore = self._current_position[0, :]

cur, next = next, cur
currentGeneration += 1

Expand Down

0 comments on commit f23237e

Please sign in to comment.