original_docstring: Roulette Selection
  
      Normalises all scores to (0,1) giving us a probability to select
      based on.
  
      Args:
          population: creature objects.
          tf: total fitness scores combined.
          s: size of the elite population.
      Returns:
          Object: array of randomly chosen creatures based on the probabilities.
      
docstring: Roulette Selection
  Normalises all scores to (0,1) giving us a probability to select
  based on.
docstring_tokens: Roulette Selection Normalises all scores to ( 0 1 ) giving us a probability to select based on .
code: def selection(population, tf, s):
      """Roulette Selection
  
      Normalises all scores to (0,1) giving us a probability to select
      based on.
  
      Args:
          population: creature objects.
          tf: total fitness scores combined.
          s: size of the elite population.
      Returns:
          Object: array of randomly chosen creatures based on the probabilities.
      """
      scores = []
      for p in population:
          scores.append(p.score/tf)
      return np.random.choice(population, len(population) - s, scores)
code_tokens: def selection ( population , tf , s ) : scores = [ ] for p in population : scores . append ( p . score / tf ) return np . random . choice ( population , len ( population ) - s , scores )
short_docstring: Roulette Selection
  Normalises all scores to (0,1) giving us a probability to select
  based on.
short_docstring_tokens: Roulette Selection Normalises all scores to ( 0 1 ) giving us a probability to select based on .
comment: """Roulette Selection
  
      Normalises all scores to (0,1) giving us a probability to select
      based on.
  
      Args:
          population: creature objects.
          tf: total fitness scores combined.
          s: size of the elite population.
      Returns:
          Object: array of randomly chosen creatures based on the probabilities.
      """