class_docstr: This buffer implements reservoir sampling.
  
  The algorithm has been described by Jeffrey S. Vitter in "Random sampling
  with a reservoir".
docstr: Initializes a ReservoirBuffer instance.
  
  Args:
      capacity: Max number of timesteps to store in the FIFO
              buffer. After reaching this number, older samples will be
              dropped to make space for new ones.
      storage_unit: Either 'timesteps', 'sequences' or
              'episodes'. Specifies how experiences are stored.
docstr_tok: ["Initializes","a","ReservoirBuffer","instance",".","Args",":","capacity",":","Max","number","of","timesteps","to","store","in","the","FIFO","buffer",".","After","reaching","this","number",",","older","samples","will","be","dropped","to","make","space","for","new","ones",".","storage_unit",":","Either","'timesteps","'",",","'sequences","'","or","'episodes","'",".","Specifies","how","experiences","are","stored","."]
code: def __init__(
      self,
      capacity: int = 10000,
      storage_unit: str = "timesteps",
      **kwargs,
  ):
      """Initializes a ReservoirBuffer instance.
  
      Args:
          capacity: Max number of timesteps to store in the FIFO
                  buffer. After reaching this number, older samples will be
                  dropped to make space for new ones.
          storage_unit: Either 'timesteps', 'sequences' or
                  'episodes'. Specifies how experiences are stored.
      """
      ReplayBuffer.__init__(self, capacity, storage_unit)
      self._num_add_calls = 0
      self._num_evicted = 0
  
file_path: ray/python/ray/rllib/utils/replay_buffers/reservoir_replay_buffer.py
imports: from typing import Any, Dict
  import random
  import ray
  import psutil
  from ray.rllib.utils.annotations import ExperimentalAPI, override
  from ray.rllib.utils.replay_buffers.replay_buffer import ReplayBuffer, warn_replay_capacity
  from ray.rllib.utils.typing import SampleBatchType
label_desc: Use image node_id 1 to create a new ReservoirReplayBuffer object from inherited base classes: ReplayBuffer with example: obj = ReservoirReplayBuffer(capacity, storage_unit)