(pop)
Sigma Truncation scaling scheme, allows negative scores
Sigma Truncation scaling scheme, allows negative scores
Sigma Truncation scaling scheme allows negative scores
def SigmaTruncScaling(pop):
   """ Sigma Truncation scaling scheme, allows negative scores """
   logging.debug("Running sigma truncation scaling.")
   pop.statistics()
   c = Consts.CDefScaleSigmaTruncMultiplier
   pop_rawAve = pop.stats["rawAve"]
   pop_rawDev = pop.stats["rawDev"]
   for i in xrange(len(pop)):
      f = pop[i].score - pop_rawAve
      f += c * pop_rawDev
      if f < 0:
         f = 0.0
      pop[i].fitness = f
def SigmaTruncScaling ( pop ) : logging . debug ( "Running sigma truncation scaling." ) pop . statistics ( ) c = Consts . CDefScaleSigmaTruncMultiplier pop_rawAve = pop . stats [ "rawAve" ] pop_rawDev = pop . stats [ "rawDev" ] for i in xrange ( len ( pop ) ) : f = pop [ i ] . score - pop_rawAve f += c * pop_rawDev if f < 0 : f = 0.0 pop [ i ] . fitness = f