예제 #1
0
 def __init__(self, *args, **kwargs):
     MemeticSearch.__init__(self, *args, **kwargs)
     
     # lambada must be mu-ltiple of mu
     assert self.lambada % self.mu == 0
     
     # population is a list of (fitness, individual) tuples.
     self.population = [(self.bestEvaluation, self.bestEvaluable.copy())]
     for dummy in range(1, self.mu + self.lambada):
         x = self.bestEvaluable.copy()
         x.mutate()
         self.population.append((self.evaluator(x), x))
     
     self._sortPopulation()
     self.steps = self.mu + self.lambada
예제 #2
0
 def _learnStep(self):
     self.switchMutations()
     MemeticSearch._learnStep(self)
     self.switchMutations()
 def _learnStep(self):
     self.switchMutations()
     MemeticSearch._learnStep(self)
     self.switchMutations()