(self)
Sort the population
Sort the population
Sort the population
def sort(self):
      """ Sort the population """
      if self.sorted:
         return
      rev = (self.minimax == Consts.minimaxType["maximize"])

      if self.sortType == Consts.sortType["raw"]:
         self.internalPop.sort(cmp=Util.cmp_individual_raw, reverse=rev)
      else:
         self.scale()
         self.internalPop.sort(cmp=Util.cmp_individual_scaled, reverse=rev)
         self.internalPopRaw = self.internalPop[:]
         self.internalPopRaw.sort(cmp=Util.cmp_individual_raw, reverse=rev)

      self.sorted = True
def sort ( self ) : if self . sorted : return rev = ( self . minimax == Consts . minimaxType [ "maximize" ] ) if self . sortType == Consts . sortType [ "raw" ] : self . internalPop . sort ( cmp = Util . cmp_individual_raw , reverse = rev ) else : self . scale ( ) self . internalPop . sort ( cmp = Util . cmp_individual_scaled , reverse = rev ) self . internalPopRaw = self . internalPop [ : ] self . internalPopRaw . sort ( cmp = Util . cmp_individual_raw , reverse = rev ) self . sorted = True