Explorar o código

abort if we found the optimal solution

Sven Czarnian %!s(int64=3) %!d(string=hai) anos
pai
achega
ae96e5be6b
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      aman/sys/aco/Colony.py

+ 4 - 0
aman/sys/aco/Colony.py

@@ -121,6 +121,10 @@ class Colony:
                 if None == bestSequence or bestCandidate[0] < bestSequence[0]:
                     bestSequence = bestCandidate
 
+                # found the optimal solution
+                if 1 >= bestSequence[0].total_seconds():
+                    break
+
         # create the final sequence
         self.Result = []
         rwyManager = RunwayManager(self.Configuration)