(pop)
Power Law scaling scheme

   .. warning :: Power Law Scaling is only for positive raw scores
Power Law scaling scheme
Power Law scaling scheme
def PowerLawScaling(pop):
   """ Power Law scaling scheme

   .. warning :: Power Law Scaling is only for positive raw scores

   """
   logging.debug("Running power law scaling.")
   k = Consts.CDefScalePowerLawFactor
   for i in xrange(len(pop)):
      f = pop[i].score
      if f < 0.0:
         Util.raiseException("Score %r is negative, power law scaling not supported !" % (f,), ValueError)
      f = math.pow(f, k)
      pop[i].fitness = f
def PowerLawScaling ( pop ) : logging . debug ( "Running power law scaling." ) k = Consts . CDefScalePowerLawFactor for i in xrange ( len ( pop ) ) : f = pop [ i ] . score if f < 0.0 : Util . raiseException ( "Score %r is negative, power law scaling not supported !" % ( f , ) , ValueError ) f = math . pow ( f , k ) pop [ i ] . fitness = f