docstr: Set position to random location
  
  This method resets particles that exeed the bounds to a random position
  inside the boundary conditions.
docstr_tok: ["Set","position","to","random","location","This","method","resets","particles","that","exeed","the","bounds","to","a","random","position","inside","the","boundary","conditions","."]
code: def random(self, position, bounds, **kwargs):
      """Set position to random location
  
      This method resets particles that exeed the bounds to a random position
      inside the boundary conditions.
      """
      lb, ub = bounds
      lower_than_bound, greater_than_bound = self._out_of_bounds(
          position, bounds
      )
      # Set indices that are greater than bounds
      new_pos = position
      new_pos[greater_than_bound[0]] = np.array(
          [
              np.array([u - l for u, l in zip(ub, lb)])
              * np.random.random_sample((position.shape[1],))
              + lb
          ]
      )
      new_pos[lower_than_bound[0]] = np.array(
          [
              np.array([u - l for u, l in zip(ub, lb)])
              * np.random.random_sample((position.shape[1],))
              + lb
          ]
      )
      return new_pos
  
imports: import inspect
  import logging
  import numpy
  import math
  from copy import copy
  from ..utils.reporter import Reporter
label_desc: Use image node_id 6 for calling the BoundaryHandler obj's underlying member method code with example usage: obj.random(position, bounds) and returns: new_pos