class_docstr: Class that implements within a Markov chain the strategy for location
  acceptance and local search decision making.
  
  Parameters
  ----------
  acceptance_param : float
      Parameter for acceptance distribution. It is used to control the
      probability of acceptance. The lower the acceptance parameter, the
      smaller the probability of acceptance. Default value is -5.0 with
      a range (-1e4, -5].
  visit_dist : VisitingDistribution
      Instance of `VisitingDistribution` class.
  func_wrapper : ObjectiveFunWrapper
      Instance of `ObjectiveFunWrapper` class.
  minimizer_wrapper: LocalSearchWrapper
      Instance of `LocalSearchWrapper` class.
  rand_gen : {None, int, `numpy.random.Generator`,
              `numpy.random.RandomState`}, optional
  
      If `seed` is None (or `np.random`), the `numpy.random.RandomState`
      singleton is used.
      If `seed` is an int, a new ``RandomState`` instance is used,
      seeded with `seed`.
      If `seed` is already a ``Generator`` or ``RandomState`` instance then
      that instance is used.
  energy_state: EnergyState
      Instance of `EnergyState` class.
class_docstr_tok: ["Class","that","implements","within","a","Markov","chain","the","strategy","for","location","acceptance","and","local","search","decision","making",".","Parameters","--","--","--","--","--","acceptance_param",":","float","Parameter","for","acceptance","distribution",".","It","is","used","to","control","the","probability","of","acceptance",".","The","lower","the","acceptance","parameter",",","the","smaller","the","probability","of","acceptance",".","Default","value","is","-5.0","with","a","range","(","-1e4",",","-5","]",".","visit_dist",":","VisitingDistribution","Instance","of","`","VisitingDistribution","`","class",".","func_wrapper",":","ObjectiveFunWrapper","Instance","of","`","ObjectiveFunWrapper","`","class",".","minimizer_wrapper",":","LocalSearchWrapper","Instance","of","`","LocalSearchWrapper","`","class",".","rand_gen",":","{","None",",","int",",","`","numpy.random.Generator","`",",","`","numpy.random.RandomState","`","}",",","optional","If","`","seed","`","is","None","(","or","`","np.random","`",")",",","the","`","numpy.random.RandomState","`","singleton","is","used",".","If","`","seed","`","is","an","int",",","a","new","``","RandomState","``","instance","is","used",",","seeded","with","`","seed","`",".","If","`","seed","`","is","already","a","``","Generator","``","or","``","RandomState","``","instance","then","that","instance","is","used",".","energy_state",":","EnergyState","Instance","of","`","EnergyState","`","class","."]
code: def accept_reject(self, j, e, x_visit):
      r = self._rand_gen.uniform()
      pqv_temp = 1.0 - (
          (1.0 - self.acceptance_param)
          * (e - self.energy_state.current_energy)
          / self.temperature_step
      )
      if pqv_temp <= 0.0:
          pqv = 0.0
      else:
          pqv = np.exp(np.log(pqv_temp) / (1.0 - self.acceptance_param))
  
      if r <= pqv:
          # We accept the new location and update state
          self.energy_state.update_current(e, x_visit)
          self.xmin = np.copy(self.energy_state.current_location)
  
      # No improvement for a long time
      if self.not_improved_idx >= self.not_improved_max_idx:
          if j == 0 or self.energy_state.current_energy < self.emin:
              self.emin = self.energy_state.current_energy
              self.xmin = np.copy(self.energy_state.current_location)
  
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 StrategyChain obj's underlying member method code with example usage: obj.accept_reject(j, e, x_visit) without return types