Преглед на файлове

update the way of adding real solutions into surrogate pool

Jérôme BUISINE преди 4 години
родител
ревизия
e6f083820c
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      optimization/ILSSurrogate.py

+ 3 - 1
optimization/ILSSurrogate.py

@@ -190,7 +190,9 @@ class ILSSurrogate(Algorithm):
             newSolution = ls.run(_ls_evaluations)
 
             # if better solution than currently, replace it (solution saved in training pool, only if surrogate process is in a second process step)
-            if self.isBetter(newSolution) and self.start_train_surrogate < self.getGlobalEvaluation():
+            # Update : always add new solution into surrogate pool, not only if solution is better
+            #if self.isBetter(newSolution) and self.start_train_surrogate < self.getGlobalEvaluation():
+            if self.start_train_surrogate < self.getGlobalEvaluation():
 
                 # if better solution found from local search, retrained the found solution and test again
                 # without use of surrogate