class_docstr: Class used to generate new coordinates based on the distorted
  Cauchy-Lorentz distribution. Depending on the steps within the strategy
  chain, the class implements the strategy for generating new location
  changes.
  
  Parameters
  ----------
  lb : array_like
      A 1-D NumPy ndarray containing lower bounds of the generated
      components. Neither NaN or inf are allowed.
  ub : array_like
      A 1-D NumPy ndarray containing upper bounds for the generated
      components. Neither NaN or inf are allowed.
  visiting_param : float
      Parameter for visiting distribution. Default value is 2.62.
      Higher values give the visiting distribution a heavier tail, this
      makes the algorithm jump to a more distant region.
      The value range is (1, 3]. It's value is fixed for the life of the
      object.
  rand_gen : {`~numpy.random.RandomState`, `~numpy.random.Generator`}
      A `~numpy.random.RandomState`, `~numpy.random.Generator` object
      for using the current state of the created random generator container.
class_docstr_tok: ["Class","used","to","generate","new","coordinates","based","on","the","distorted","Cauchy-Lorentz","distribution",".","Depending","on","the","steps","within","the","strategy","chain",",","the","class","implements","the","strategy","for","generating","new","location","changes",".","Parameters","--","--","--","--","--","lb",":","array_like","A","1-D","NumPy","ndarray","containing","lower","bounds","of","the","generated","components",".","Neither","NaN","or","inf","are","allowed",".","ub",":","array_like","A","1-D","NumPy","ndarray","containing","upper","bounds","for","the","generated","components",".","Neither","NaN","or","inf","are","allowed",".","visiting_param",":","float","Parameter","for","visiting","distribution",".","Default","value","is","2.62",".","Higher","values","give","the","visiting","distribution","a","heavier","tail",",","this","makes","the","algorithm","jump","to","a","more","distant","region",".","The","value","range","is","(","1",",","3","]",".","It","'s","value","is","fixed","for","the","life","of","the","object",".","rand_gen",":","{","`","~numpy.random.RandomState","`",",","`","~numpy.random.Generator","`","}","A","`","~numpy.random.RandomState","`",",","`","~numpy.random.Generator","`","object","for","using","the","current","state","of","the","created","random","generator","container","."]
docstr: Based on the step in the strategy chain, new coordinated are
  generated by changing all components is the same time or only
  one of them, the new values are computed with visit_fn method
docstr_tok: ["Based","on","the","step","in","the","strategy","chain",",","new","coordinated","are","generated","by","changing","all","components","is","the","same","time","or","only","one","of","them",",","the","new","values","are","computed","with","visit_fn","method"]
code: def visiting(self, x, step, temperature):
      """Based on the step in the strategy chain, new coordinated are
      generated by changing all components is the same time or only
      one of them, the new values are computed with visit_fn method
      """
      dim = x.size
      if step < dim:
          # Changing all coordinates with a new visiting value
          visits = self.visit_fn(temperature, dim)
          upper_sample, lower_sample = self.rand_gen.uniform(size=2)
          visits[visits > self.TAIL_LIMIT] = (
              self.TAIL_LIMIT * upper_sample
          )
          visits[visits < -self.TAIL_LIMIT] = (
              -self.TAIL_LIMIT * lower_sample
          )
          x_visit = visits + x
          a = x_visit - self.lower
          b = np.fmod(a, self.bound_range) + self.bound_range
          x_visit = np.fmod(b, self.bound_range) + self.lower
          x_visit[
              np.fabs(x_visit - self.lower) < self.MIN_VISIT_BOUND
          ] += 1.0e-10
      else:
          # Changing only one coordinate at a time based on strategy
          # chain step
          x_visit = np.copy(x)
          visit = self.visit_fn(temperature, 1)
          if visit > self.TAIL_LIMIT:
              visit = self.TAIL_LIMIT * self.rand_gen.uniform()
          elif visit < -self.TAIL_LIMIT:
              visit = -self.TAIL_LIMIT * self.rand_gen.uniform()
          index = step - dim
          x_visit[index] = visit + x[index]
          a = x_visit[index] - self.lower[index]
          b = (
              np.fmod(a, self.bound_range[index])
              + self.bound_range[index]
          )
          x_visit[index] = (
              np.fmod(b, self.bound_range[index]) + self.lower[index]
          )
          if (
              np.fabs(x_visit[index] - self.lower[index])
              < self.MIN_VISIT_BOUND
          ):
              x_visit[index] += self.MIN_VISIT_BOUND
      return x_visit
  
imports: import numpy
  from scipy.optimize import OptimizeResult
  from scipy.optimize import minimize
  from scipy.special import gammaln
  from scipy._lib._util import check_random_state
label_desc: Use image node_id 2 for calling the VisitingDistribution obj's underlying member method code with example usage: obj.visiting(x, step, temperature) and returns: x_visit