class_docstr: Experience Replay Buffer
  
  As described in
  https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf.
  
  Args:
      capacity (int): capacity in terms of number of transitions
      num_steps (int): Number of timesteps per stored transition
          (for N-step updates)
class_docstr_tok: ["Experience","Replay","Buffer","As","described","in","https",":","\/\/storage.googleapis.com\/deepmind-media\/dqn\/DQNNaturePaper.pdf",".","Args",":","capacity","(","int",")",":","capacity","in","terms","of","number","of","transitions","num_steps","(","int",")",":","Number","of","timesteps","per","stored","transition","(","for","N-step","updates",")"]
code: def stop_current_episode(self, env_id=0):
      last_n_transitions = self.last_n_transitions[env_id]
      # if n-step transition hist is not full, add transition;
      # if n-step hist is indeed full, transition has already been added;
      if 0 < len(last_n_transitions) < self.num_steps:
          self.memory.append(list(last_n_transitions))
      # avoid duplicate entry
      if 0 < len(last_n_transitions) <= self.num_steps:
          del last_n_transitions[0]
      while last_n_transitions:
          self.memory.append(list(last_n_transitions))
          del last_n_transitions[0]
      assert len(last_n_transitions) == 0
  
file_path: pfrl/pfrl/replay_buffers/replay_buffer.py
imports: import collections
  import pickle
  from typing import Optional
  from pfrl import replay_buffer
  from pfrl.collections.random_access_queue import RandomAccessQueue
label_desc: Use image node_id 3 for calling the ReplayBuffer obj's underlying member method code with example usage: obj.stop_current_episode(env_id) without return types