Пример #1
0
 def __init__(self, *args, **kwargs):
     """ x0 is assumed to be an array, but then converted to a tuple. 
     The algorithm returns all individuals in the Pareto-front (and their fitnesses). """
     GA.__init__(self, *args, **kwargs)
     self.bestEvaluation = []
     self.bestEvaluable = [tuple(self.x0)]
     self.fitnesses = {}    
Пример #2
0
 def __init__(self, *args, **kwargs):
     """ x0 is assumed to be an array, but then converted to a tuple. 
     The algorithm returns all individuals in the Pareto-front (and their fitnesses). """
     GA.__init__(self, *args, **kwargs)
     self.bestEvaluation = []
     self.bestEvaluable = [tuple(self.x0)]
     self.fitnesses = {}
Пример #3
0
 def mutated(self, indiv):
     return tuple(GA.mutated(self,array(indiv)))
Пример #4
0
 def initPopulation(self):
     if self.startPop == None:
         GA.initPopulation(self)
         self.currentpop = map(tuple, self.currentpop)
     else:
         self.currentpop = self.startPop
Пример #5
0
 def mutated(self, indiv):
     return tuple(GA.mutated(self, array(indiv)))
Пример #6
0
 def initPopulation(self):
     if self.startPop == None:
         GA.initPopulation(self)
         self.currentpop = map(tuple, self.currentpop)
     else:
         self.currentpop = self.startPop