original_docstring: set parameters and state variable based on dimension,
          mueff and possibly further options.
  
          
docstring: set parameters and state variable based on dimension,
  mueff and possibly further options.
docstring_tokens: set parameters and state variable based on dimension mueff and possibly further options .
code: def initialize(self, es):
          """set parameters and state variable based on dimension,
          mueff and possibly further options.
  
          """
          self.disregard_length_setting = True if es.opts['CSA_disregard_length'] else False
          if es.opts['CSA_clip_length_value'] is not None:
              try:
                  if len(es.opts['CSA_clip_length_value']) == 0:
                      es.opts['CSA_clip_length_value'] = [-np.Inf, np.Inf]
                  elif len(es.opts['CSA_clip_length_value']) == 1:
                      es.opts['CSA_clip_length_value'] = [-np.Inf, es.opts['CSA_clip_length_value'][0]]
                  elif len(es.opts['CSA_clip_length_value']) == 2:
                      es.opts['CSA_clip_length_value'] = np.sort(es.opts['CSA_clip_length_value'])
                  else:
                      raise ValueError('option CSA_clip_length_value should be a number of len(.) in [1,2]')
              except TypeError:  # len(...) failed
                  es.opts['CSA_clip_length_value'] = [-np.Inf, es.opts['CSA_clip_length_value']]
              es.opts['CSA_clip_length_value'] = list(np.sort(es.opts['CSA_clip_length_value']))
              if es.opts['CSA_clip_length_value'][0] > 0 or es.opts['CSA_clip_length_value'][1] < 0:
                  raise ValueError('option CSA_clip_length_value must be a single positive or a negative and a positive number')
          ## meta_parameters.cs_exponent == 1.0
          b = 1.0
          ## meta_parameters.cs_multiplier == 1.0
          self.cs = 1.0 * (es.sp.weights.mueff + 2)**b / (es.N**b + (es.sp.weights.mueff + 3)**b)
  
          self.damps = es.opts['CSA_dampfac'] * (0.5 +
                                            0.5 * min([1, (es.sp.lam_mirr / (0.159 * es.sp.popsize) - 1)**2])**1 +
                                            2 * max([0, ((es.sp.weights.mueff - 1) / (es.N + 1))**es.opts['CSA_damp_mueff_exponent'] - 1]) +
                                            self.cs
                                            )
          self.max_delta_log_sigma = 1  # in symmetric use (strict lower bound is -cs/damps anyway)
  
          if self.disregard_length_setting:
              es.opts['CSA_clip_length_value'] = [0, 0]
              ## meta_parameters.cs_exponent == 1.0
              b = 1.0 * 0.5
              ## meta_parameters.cs_multiplier == 1.0
              self.cs = 1.0 * (es.sp.weights.mueff + 1)**b / (es.N**b + 2 * es.sp.weights.mueff**b)
              self.damps = es.opts['CSA_dampfac'] * 1  # * (1.1 - 1/(es.N+1)**0.5)
              if es.opts['verbose'] > 1:
                  print('CMAAdaptSigmaCSA Parameters: ')
                  for k, v in self.__dict__.items():
                      print('  ', k, ':', v)
          self.ps = np.zeros(es.N)
          self._ps_updated_iteration = -1
          self.is_initialized = True
code_tokens: def initialize ( self , es ) : self . disregard_length_setting = True if es . opts [ 'CSA_disregard_length' ] else False if es . opts [ 'CSA_clip_length_value' ] is not None : try : if len ( es . opts [ 'CSA_clip_length_value' ] ) == 0 : es . opts [ 'CSA_clip_length_value' ] = [ - np . Inf , np . Inf ] elif len ( es . opts [ 'CSA_clip_length_value' ] ) == 1 : es . opts [ 'CSA_clip_length_value' ] = [ - np . Inf , es . opts [ 'CSA_clip_length_value' ] [ 0 ] ] elif len ( es . opts [ 'CSA_clip_length_value' ] ) == 2 : es . opts [ 'CSA_clip_length_value' ] = np . sort ( es . opts [ 'CSA_clip_length_value' ] ) else : raise ValueError ( 'option CSA_clip_length_value should be a number of len(.) in [1,2]' ) except TypeError : es . opts [ 'CSA_clip_length_value' ] = [ - np . Inf , es . opts [ 'CSA_clip_length_value' ] ] es . opts [ 'CSA_clip_length_value' ] = list ( np . sort ( es . opts [ 'CSA_clip_length_value' ] ) ) if es . opts [ 'CSA_clip_length_value' ] [ 0 ] > 0 or es . opts [ 'CSA_clip_length_value' ] [ 1 ] < 0 : raise ValueError ( 'option CSA_clip_length_value must be a single positive or a negative and a positive number' ) b = 1.0 self . cs = 1.0 * ( es . sp . weights . mueff + 2 ) ** b / ( es . N ** b + ( es . sp . weights . mueff + 3 ) ** b ) self . damps = es . opts [ 'CSA_dampfac' ] * ( 0.5 + 0.5 * min ( [ 1 , ( es . sp . lam_mirr / ( 0.159 * es . sp . popsize ) - 1 ) ** 2 ] ) ** 1 + 2 * max ( [ 0 , ( ( es . sp . weights . mueff - 1 ) / ( es . N + 1 ) ) ** es . opts [ 'CSA_damp_mueff_exponent' ] - 1 ] ) + self . cs ) self . max_delta_log_sigma = 1 if self . disregard_length_setting : es . opts [ 'CSA_clip_length_value' ] = [ 0 , 0 ] b = 1.0 * 0.5 self . cs = 1.0 * ( es . sp . weights . mueff + 1 ) ** b / ( es . N ** b + 2 * es . sp . weights . mueff ** b ) self . damps = es . opts [ 'CSA_dampfac' ] * 1 if es . opts [ 'verbose' ] > 1 : print ( 'CMAAdaptSigmaCSA Parameters: ' ) for k , v in self . __dict__ . items ( ) : print ( '  ' , k , ':' , v ) self . ps = np . zeros ( es . N ) self . _ps_updated_iteration = - 1 self . is_initialized = True
short_docstring: set parameters and state variable based on dimension,
  mueff and possibly further options.
short_docstring_tokens: set parameters and state variable based on dimension mueff and possibly further options .
comment: """set parameters and state variable based on dimension,
          mueff and possibly further options.
  
          """$SEP$# len(...) failed$SEP$## meta_parameters.cs_exponent == 1.0$SEP$## meta_parameters.cs_multiplier == 1.0$SEP$# in symmetric use (strict lower bound is -cs/damps anyway)$SEP$## meta_parameters.cs_exponent == 1.0$SEP$## meta_parameters.cs_multiplier == 1.0$SEP$# * (1.1 - 1/(es.N+1)**0.5)