remove unused variables and rename a parameter

This commit is contained in:
Sven Czarnian
2021-12-20 14:24:27 +01:00
parent f4fa9eeb18
commit 83acbdc3b5
2 changed files with 3 additions and 4 deletions

View File

@@ -112,8 +112,8 @@ class Ant:
self.Sequence.append(index)
# update the local pheromone
update = (1.0 - self.Configuration.propagationRatio) * self.PheromoneMatrix[self.Sequence[-2], self.Sequence[-1]]
update += self.Configuration.propagationRatio * self.Configuration.ThetaZero
update = (1.0 - self.Configuration.PropagationRatio) * self.PheromoneMatrix[self.Sequence[-2], self.Sequence[-1]]
update += self.Configuration.PropagationRatio * self.Configuration.ThetaZero
self.PheromoneMatrix[self.Sequence[-2], self.Sequence[-1]] = max(self.Configuration.ThetaZero, update)
# validate that nothing went wrong