original_docstring: 
          Function to divide the population into fronts using the fast non dominated sort approach of NSGA II.
  
          Parameters:
  
              population (list) - list of solutions to be sorted into fronts.
  
          Returns:
  
              fronts (list) - list of lists, each list representing a front. Non domintated solutions are always in the first front (index 0).
          
docstring: Function to divide the population into fronts using the fast non dominated sort approach of NSGA II.
  Parameters.
  
  population (list) - list of solutions to be sorted into fronts.
  
  
  
  fronts (list) - list of lists, each list representing a front. Non domintated solutions are always in the first front (index 0).
docstring_tokens: Function to divide the population into fronts using the fast non dominated sort approach of NSGA II . Parameters . population ( list ) - list of solutions to be sorted into fronts . fronts ( list ) - list of lists each list representing a front . Non domintated solutions are always in the first front ( index 0 ) .
code: def fast_non_dominated_sort(self,population):
          """
          Function to divide the population into fronts using the fast non dominated sort approach of NSGA II.
  
          Parameters:
  
              population (list) - list of solutions to be sorted into fronts.
  
          Returns:
  
              fronts (list) - list of lists, each list representing a front. Non domintated solutions are always in the first front (index 0).
          """
          
          fronts = [[]]
          
          for solution1 in population:
  
              solution1.dominatedSolutions = [] 
              solution1.dominationCount = 0
              
              for solution2 in population:
                  if solution1.dominates(solution2):
                      solution1.dominatedSolutions.append(solution2)
                  elif solution2.dominates(solution1):
                      solution1.dominationCount +=1
           
              if solution1.dominationCount == 0:
  
                  solution1.rank = 0 #In the first front
                  fronts[0].append(solution1)
  
          i = 0
  
          while len(fronts[i]) != 0:
  
              nextFront = []
  
              for solution1 in fronts[i]:
  
                  for solution2 in solution1.dominatedSolutions:
  
                      solution2.dominationCount -= 1
  
                      if solution2.dominationCount == 0:
  
                          solution2.rank = i + 1
                          nextFront.append(solution2)
  
              i+=1
              fronts.append(nextFront)
          
          return fronts
code_tokens: def fast_non_dominated_sort ( self , population ) : fronts = [ [ ] ] for solution1 in population : solution1 . dominatedSolutions = [ ] solution1 . dominationCount = 0 for solution2 in population : if solution1 . dominates ( solution2 ) : solution1 . dominatedSolutions . append ( solution2 ) elif solution2 . dominates ( solution1 ) : solution1 . dominationCount += 1 if solution1 . dominationCount == 0 : solution1 . rank = 0 fronts [ 0 ] . append ( solution1 ) i = 0 while len ( fronts [ i ] ) != 0 : nextFront = [ ] for solution1 in fronts [ i ] : for solution2 in solution1 . dominatedSolutions : solution2 . dominationCount -= 1 if solution2 . dominationCount == 0 : solution2 . rank = i + 1 nextFront . append ( solution2 ) i += 1 fronts . append ( nextFront ) return fronts
short_docstring: Function to divide the population into fronts using the fast non dominated sort approach of NSGA II.
short_docstring_tokens: Function to divide the population into fronts using the fast non dominated sort approach of NSGA II .
comment: """
          Function to divide the population into fronts using the fast non dominated sort approach of NSGA II.
  
          Parameters:
  
              population (list) - list of solutions to be sorted into fronts.
  
          Returns:
  
              fronts (list) - list of lists, each list representing a front. Non domintated solutions are always in the first front (index 0).
          """$SEP$#In the first front