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

View File

@@ -16,8 +16,7 @@ class Configuration:
self.ExplorationRuns = kwargs.get('generations', 20)
self.PheromoneEvaporationRate = 0.9
self.PseudoRandomSelectionRate = 0.9
self.propagationRatio = 0.9
self.PropagationRatio = 0.9
self.Epsilon = 0.1
self.RunwayOccupasionRatio = 0.7
self.Beta = 2.0
self.ThetaZero = None