(population, **args)
return population[random.randint(0, count)]
The Rank Selector - This selector will pick the best individual of
   the population every time.
The Rank Selector - This selector will pick the best individual of
   the population every time.
The Rank Selector - This selector will pick the best individual of the population every time .
def GRankSelector(population, **args):
   """ The Rank Selector - This selector will pick the best individual of
   the population every time.
   """
   count = 0

   if args["popID"] != GRankSelector.cachePopID:
      if population.sortType == Consts.sortType["scaled"]:
         best_fitness = population.bestFitness().fitness
         for index in xrange(1, len(population.internalPop)):
            if population[index].fitness == best_fitness:
               count += 1
      else:
         best_raw = population.bestRaw().score
         for index in xrange(1, len(population.internalPop)):
            if population[index].score == best_raw:
               count += 1

      GRankSelector.cachePopID = args["popID"]
      GRankSelector.cacheCount = count

   else:
      count = GRankSelector.cacheCount

   return population[random.randint(0, count)]
def GRankSelector ( population , * * args ) : count = 0 if args [ "popID" ] != GRankSelector . cachePopID : if population . sortType == Consts . sortType [ "scaled" ] : best_fitness = population . bestFitness ( ) . fitness for index in xrange ( 1 , len ( population . internalPop ) ) : if population [ index ] . fitness == best_fitness : count += 1 else : best_raw = population . bestRaw ( ) . score for index in xrange ( 1 , len ( population . internalPop ) ) : if population [ index ] . score == best_raw : count += 1 GRankSelector . cachePopID = args [ "popID" ] GRankSelector . cacheCount = count else : count = GRankSelector . cacheCount return population [ random . randint ( 0 , count ) ]