|
@@ -36,8 +36,9 @@ class LocalSearchSurrogate(Algorithm):
|
|
# by default use of mother method to initialize variables
|
|
# by default use of mother method to initialize variables
|
|
super().run(_evaluations)
|
|
super().run(_evaluations)
|
|
|
|
|
|
- if self.parent:
|
|
|
|
- self.bestSolution = self.parent.bestSolution
|
|
|
|
|
|
+ # do not use here the best solution known (default use of initRun and current solution)
|
|
|
|
+ # if self.parent:
|
|
|
|
+ # self.bestSolution = self.parent.bestSolution
|
|
|
|
|
|
# initialize current solution
|
|
# initialize current solution
|
|
self.initRun()
|
|
self.initRun()
|
|
@@ -72,6 +73,9 @@ class LocalSearchSurrogate(Algorithm):
|
|
if self.stop():
|
|
if self.stop():
|
|
break
|
|
break
|
|
|
|
|
|
|
|
+ # after applying local search on currentSolution, we switch into new local area using known current bestSolution
|
|
|
|
+ self.currentSolution = self.bestSolution
|
|
|
|
+
|
|
logging.info("End of %s, best solution found %s" %
|
|
logging.info("End of %s, best solution found %s" %
|
|
(type(self).__name__, self.bestSolution))
|
|
(type(self).__name__, self.bestSolution))
|
|
|
|
|