original_docstring: 
          Function to calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II.
  
          Parameters:
  
              front (list) - list of solutions in the front.
              
  
          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 calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II.
  Parameters.
  
  front (list) - list of solutions in the front.
  
  
  
  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 calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II . Parameters . front ( list ) - list of solutions in the front . fronts ( list ) - list of lists each list representing a front . Non domintated solutions are always in the first front ( index 0 ) .
code: def crowding_distance_assignment(self,front,maxFst,minFst,maxFsup,minFsup):
          """
          Function to calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II.
  
          Parameters:
  
              front (list) - list of solutions in the front.
              
  
          Returns:
  
              fronts (list) - list of lists, each list representing a front. Non domintated solutions are always in the first front (index 0).
          """
  
          lenFront = len(front)
  
          if lenFront == 0:
              return
  
          for sol in front:
              sol.crowdingDistance = 0
  
  
          sortedFst = sorted(front, key=lambda x: x.getFst())
          sortedFsup = sorted(front,key=lambda x: x.getFsup())
          
          sortedFst[0].crowdingDistance = float("inf")
          sortedFst[-1].crowdingDistance = float("inf")
          sortedFsup[0].crowdingDistance = float("inf")
          sortedFsup[-1].crowdingDistance = float("inf")
  
  
          for index in range(1,lenFront-1):
              sortedFst[index].crowdingDistance += (sortedFst[index+1].getFst() - sortedFst[index-1].getFst())/(maxFst - minFst)
              
              
          for index in range(1,lenFront-1):
              sortedFsup[index].crowdingDistance += (sortedFsup[index+1].getFsup() - sortedFsup[index-1].getFsup())/(maxFsup - minFsup)
code_tokens: def crowding_distance_assignment ( self , front , maxFst , minFst , maxFsup , minFsup ) : lenFront = len ( front ) if lenFront == 0 : return for sol in front : sol . crowdingDistance = 0 sortedFst = sorted ( front , key = lambda x : x . getFst ( ) ) sortedFsup = sorted ( front , key = lambda x : x . getFsup ( ) ) sortedFst [ 0 ] . crowdingDistance = float ( "inf" ) sortedFst [ - 1 ] . crowdingDistance = float ( "inf" ) sortedFsup [ 0 ] . crowdingDistance = float ( "inf" ) sortedFsup [ - 1 ] . crowdingDistance = float ( "inf" ) for index in range ( 1 , lenFront - 1 ) : sortedFst [ index ] . crowdingDistance += ( sortedFst [ index + 1 ] . getFst ( ) - sortedFst [ index - 1 ] . getFst ( ) ) / ( maxFst - minFst ) for index in range ( 1 , lenFront - 1 ) : sortedFsup [ index ] . crowdingDistance += ( sortedFsup [ index + 1 ] . getFsup ( ) - sortedFsup [ index - 1 ] . getFsup ( ) ) / ( maxFsup - minFsup )
short_docstring: Function to calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II.
short_docstring_tokens: Function to calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II .
comment: """
          Function to calculate the crowding distance values of solutions in a given front into using the crowding distance assignment of NSGA II.
  
          Parameters:
  
              front (list) - list of solutions in the front.
              
  
          Returns:
  
              fronts (list) - list of lists, each list representing a front. Non domintated solutions are always in the first front (index 0).
          """