parameters: (self, grid_length, grid_width, min_radius, max_sample_size)
docstring: Initializes the algorithm.
  
      Args:
        grid_length: The length of the bounding square in which points are
          sampled.
        grid_width: The width of the bounding square in which points are
          sampled.
        min_radius: The minimum distance between any pair of points.
        max_sample_size: The maximum number of sample points around a active site.
          See details in the algorithm description.
docstring_summary: Initializes the algorithm.
docstring_tokens: Initializes the algorithm .
function: def __init__(self, grid_length, grid_width, min_radius, max_sample_size):
      """Initializes the algorithm.
  
      Args:
        grid_length: The length of the bounding square in which points are
          sampled.
        grid_width: The width of the bounding square in which points are
          sampled.
        min_radius: The minimum distance between any pair of points.
        max_sample_size: The maximum number of sample points around a active site.
          See details in the algorithm description.
      """
      self._cell_length = min_radius / math.sqrt(2)
      self._grid_length = grid_length
      self._grid_width = grid_width
      self._grid_size_x = int(grid_length / self._cell_length) + 1
      self._grid_size_y = int(grid_width / self._cell_length) + 1
      self._min_radius = min_radius
      self._max_sample_size = max_sample_size
  
      # Flattern the 2D grid as an 1D array. The grid is used for fast nearest
      # point searching.
      self._grid = [None] * self._grid_size_x * self._grid_size_y
  
      # Generate the first sample point and set it as an active site.
      first_sample = np.array(np.random.random_sample(2)) * [grid_length, grid_width]
      self._active_list = [first_sample]
  
      # Also store the sample point in the grid.
      self._grid[self._point_to_index_1d(first_sample)] = first_sample
function_tokens: def __init__ ( self , grid_length , grid_width , min_radius , max_sample_size ) : self . _cell_length = min_radius / math . sqrt ( 2 ) self . _grid_length = grid_length self . _grid_width = grid_width self . _grid_size_x = int ( grid_length / self . _cell_length ) + 1 self . _grid_size_y = int ( grid_width / self . _cell_length ) + 1 self . _min_radius = min_radius self . _max_sample_size = max_sample_size # Flattern the 2D grid as an 1D array. The grid is used for fast nearest # point searching. self . _grid = [ None ] * self . _grid_size_x * self . _grid_size_y # Generate the first sample point and set it as an active site. first_sample = np . array ( np . random . random_sample ( 2 ) ) * [ grid_length , grid_width ] self . _active_list = [ first_sample ] # Also store the sample point in the grid. self . _grid [ self . _point_to_index_1d ( first_sample ) ] = first_sample