Selaa lähdekoodia

Fix bug: when choose direction of most intensity pheromone: must be reverse the sort

Bastien Sevajol 9 vuotta sitten
vanhempi
commit
ef3bb40a17
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      intelligine/simulation/pheromone/DirectionPheromone.py

+ 1 - 1
intelligine/simulation/pheromone/DirectionPheromone.py Näytä tiedosto

@@ -98,7 +98,7 @@ class DirectionPheromone():
98 98
             raise NoPheromone()
99 99
 
100 100
         shuffle(arround_pheromones_points)
101
-        arround_pheromones_sorted = sorted(arround_pheromones_points, key=lambda x: x[1][1])
101
+        arround_pheromones_sorted = sorted(arround_pheromones_points, key=lambda x: x[1][1], reverse=True)
102 102
         go_to_point = arround_pheromones_sorted[0][0]
103 103
 
104 104
         direction_degrees = get_degree_from_north(reference_point, go_to_point)