Example #1
0
 def reinsertion(self, population, offspring, refPoint):
     
     """
     描述:
         重插入个体产生新一代种群(采用父子合并选择的策略)。
     """
     
     # 父子两代合并
     population = population + offspring
     # 选择个体保留到下一代
     chooseFlag, self.Gamma = ea.refgselect(population.ObjV, refPoint, self.problem.M * ((self.currentGen) / self.MAXGEN)**self.a, population.CV, self.Gamma)
     return population[chooseFlag]
Example #2
0
 def reinsertion(self, population, offspring, refPoint):
     
     """
     描述:
         重插入个体产生新一代种群(采用父子合并选择的策略)。
     """
     
     # 父子两代合并
     population = population + offspring
     # 得到非支配个体
     [levels, criLevel] = self.ndSort(self.problem.maxormins * population.ObjV, None, 1, population.CV) # 非支配排序,1表示只排序到第一层即非支配个体所在的层级
     population = population[np.where(levels == 1)[0]]
     # 选择个体保留到下一代
     [chooseFlag, ans] = ea.refgselect(population.ObjV, refPoint, self.problem.M * ((self.currentGen + 1) / self.MAXGEN)**self.a, population.CV) # ans表示不使用该返回结果
     return population[chooseFlag]