コード例 #1
0
ファイル: nsga2.py プロジェクト: RaVbaker/pybrain
 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
ファイル: nsga2.py プロジェクト: RaVbaker/pybrain
 def mutated(self, indiv):
     return tuple(GA.mutated(self,array(indiv)))
コード例 #4
0
ファイル: nsga2.py プロジェクト: RaVbaker/pybrain
 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