Pārlūkot izejas kodu

update the way of adding real solutions into surrogate pool

Jérôme BUISINE 4 gadi atpakaļ
vecāks
revīzija
e6f083820c
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  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