class_docstr: This buffer implements Prioritized Experience Replay.
  
  The algorithm has been described by Tom Schaul et. al. in "Prioritized
  Experience Replay". See https://arxiv.org/pdf/1511.05952.pdf for
  the full paper.
docstr: Initializes a PrioritizedReplayBuffer 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.
      alpha: How much prioritization is used
          (0.0=no prioritization, 1.0=full prioritization).
      ``**kwargs``: Forward compatibility kwargs.
docstr_tok: ["Initializes","a","PrioritizedReplayBuffer","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",".","alpha",":","How","much","prioritization","is","used","(","0.0=no","prioritization",",","1.0=full","prioritization",")",".","``","*","*","kwargs","``",":","Forward","compatibility","kwargs","."]
code: def __init__(
      self,
      capacity: int = 10000,
      storage_unit: str = "timesteps",
      alpha: float = 1.0,
      **kwargs,
  ):
      """Initializes a PrioritizedReplayBuffer 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.
          alpha: How much prioritization is used
              (0.0=no prioritization, 1.0=full prioritization).
          ``**kwargs``: Forward compatibility kwargs.
      """
      ReplayBuffer.__init__(self, capacity, storage_unit, **kwargs)
  
      assert alpha > 0
      self._alpha = alpha
  
      # Segment tree must have capacity that is a power of 2
      it_capacity = 1
      while it_capacity < self.capacity:
          it_capacity *= 2
  
      self._it_sum = SumSegmentTree(it_capacity)
      self._it_min = MinSegmentTree(it_capacity)
      self._max_priority = 1.0
      self._prio_change_stats = WindowStat("reprio", 1000)
  
imports: import random
  from typing import Any, Dict, List, Optional
  import numpy
  import ray
  import psutil
  from ray.rllib.execution.segment_tree import SumSegmentTree, MinSegmentTree
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.metrics.window_stat import WindowStat
  from ray.rllib.utils.replay_buffers.replay_buffer import ReplayBuffer
  from ray.rllib.utils.typing import SampleBatchType
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 1 to create a new PrioritizedReplayBuffer object from inherited base classes: ReplayBuffer with example: obj = PrioritizedReplayBuffer(capacity, storage_unit, alpha)