original_docstring: Crossover operation to generate new population
  
          Args:
              population (np.ndarray): the population to cross over, is 2D array
              agg (bool): if True, then aggregate multiple crossovers, otherwise is sequential.          
              **kwargs: Keyword arguments for plugins (other than default)
  
          Returns:
              np.ndarray: the crossed-over population
  
          
docstring: Crossover operation to generate new population
docstring_tokens: Crossover operation to generate new population
code: def crossover(self,
                    *,
                    population: np.ndarray = None,
                    agg: bool = None,
                    **kwargs) -> np.ndarray:
          """Crossover operation to generate new population
  
          Args:
              population (np.ndarray): the population to cross over, is 2D array
              agg (bool): if True, then aggregate multiple crossovers, otherwise is sequential.          
              **kwargs: Keyword arguments for plugins (other than default)
  
          Returns:
              np.ndarray: the crossed-over population
  
          """
          logging.debug('{} {}'.format(population, agg))
  
  
          # combine keyword arguments with **kwargs
          params = locals().copy()
          params.pop('self', None)
          kwargs = params.pop('kwargs')
  
          # if there is a driver, then use it and run once
          if mgr := self.driver_managers.get('crossover'):
              return mgr.driver.crossover(**params, **kwargs)
  
          # if agg=True, then aggregate crossed over populations
          if kwargs.get('agg'):
              pops = []
              for ext in self.extension_managers['crossover'].extensions:
                  try:
                      pops.append(ext.obj.mutate(**params, **kwargs))
                  except:
                      continue
              return np.aggregate(pops)
  
          # otherwise, run crossover for each plugin
          # after first time, crosses over prior crossed-over population
          population = params['population']
          for ext in self.extension_managers['crossover'].extensions:
              try:
                  params['population'] = population
                  population = ext.obj.crossover(**kwargs)
              except:
                  continue
          return population
code_tokens: def crossover ( self , * , population : np . ndarray = None , agg : bool = None , ** kwargs ) -> np . ndarray : logging . debug ( '{} {}' . format ( population , agg ) ) params = locals ( ) . copy ( ) params . pop ( 'self' , None ) kwargs = params . pop ( 'kwargs' ) if mgr := self . driver_managers . get ( 'crossover' ) : return mgr . driver . crossover ( ** params , ** kwargs ) if kwargs . get ( 'agg' ) : pops = [ ] for ext in self . extension_managers [ 'crossover' ] . extensions : try : pops . append ( ext . obj . mutate ( ** params , ** kwargs ) ) except : continue return np . aggregate ( pops ) population = params [ 'population' ] for ext in self . extension_managers [ 'crossover' ] . extensions : try : params [ 'population' ] = population population = ext . obj . crossover ( ** kwargs ) except : continue return population
short_docstring: Crossover operation to generate new population
short_docstring_tokens: Crossover operation to generate new population
comment: """Crossover operation to generate new population
  
          Args:
              population (np.ndarray): the population to cross over, is 2D array
              agg (bool): if True, then aggregate multiple crossovers, otherwise is sequential.          
              **kwargs: Keyword arguments for plugins (other than default)
  
          Returns:
              np.ndarray: the crossed-over population
  
          """$SEP$# combine keyword arguments with **kwargs
  $SEP$# if there is a driver, then use it and run once
  $SEP$# if agg=True, then aggregate crossed over populations
  $SEP$# otherwise, run crossover for each plugin
  $SEP$# after first time, crosses over prior crossed-over population
  