瀏覽代碼

abort if we found the optimal solution

Sven Czarnian 3 年之前
父節點
當前提交
ae96e5be6b
共有 1 個文件被更改,包括 4 次插入0 次删除
  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)