class_docstr: Wrapper around a replay buffer in order to use HER.
  This implementation is inspired by to the one found in https://github.com/NervanaSystems/coach/.
  
  :param replay_buffer: (ReplayBuffer)
  :param n_sampled_goal: (int) The number of artificial transitions to generate for each actual transition
  :param goal_selection_strategy: (GoalSelectionStrategy) The method that will be used to generate
      the goals for the artificial transitions.
  :param wrapped_env: (HERGoalEnvWrapper) the GoalEnv wrapped using HERGoalEnvWrapper,
      that enables to convert observation to dict, and vice versa
class_docstr_tok: ["Wrapper","around","a","replay","buffer","in","order","to","use","HER",".","This","implementation","is","inspired","by","to","the","one","found","in","https",":","\/\/github.com\/NervanaSystems\/coach\/",".",":","param","replay_buffer",":","(","ReplayBuffer",")",":","param","n_sampled_goal",":","(","int",")","The","number","of","artificial","transitions","to","generate","for","each","actual","transition",":","param","goal_selection_strategy",":","(","GoalSelectionStrategy",")","The","method","that","will","be","used","to","generate","the","goals","for","the","artificial","transitions",".",":","param","wrapped_env",":","(","HERGoalEnvWrapper",")","the","GoalEnv","wrapped","using","HERGoalEnvWrapper",",","that","enables","to","convert","observation","to","dict",",","and","vice","versa"]
docstr: add a new transition to the buffer
  
  :param obs_t: (np.ndarray) the last observation
  :param action: ([float]) the action
  :param reward: (float) the reward of the transition
  :param obs_tp1: (np.ndarray) the new observation
  :param done: (bool) is the episode done
  :param info: (dict) extra values used to compute reward
docstr_tok: ["add","a","new","transition","to","the","buffer",":","param","obs_t",":","(","np.ndarray",")","the","last","observation",":","param","action",":","(","[","float","]",")","the","action",":","param","reward",":","(","float",")","the","reward","of","the","transition",":","param","obs_tp1",":","(","np.ndarray",")","the","new","observation",":","param","done",":","(","bool",")","is","the","episode","done",":","param","info",":","(","dict",")","extra","values","used","to","compute","reward"]
code: def add(self, obs_t, action, reward, obs_tp1, done, info):
      """
      add a new transition to the buffer
  
      :param obs_t: (np.ndarray) the last observation
      :param action: ([float]) the action
      :param reward: (float) the reward of the transition
      :param obs_tp1: (np.ndarray) the new observation
      :param done: (bool) is the episode done
      :param info: (dict) extra values used to compute reward
      """
      assert self.replay_buffer is not None
      # Update current episode buffer
      self.episode_transitions.append(
          (obs_t, action, reward, obs_tp1, done, info)
      )
      if done:
          # Add transitions (and imagined ones) to buffer only when an episode is over
          self._store_episode()
          # Reset episode buffer
          self.episode_transitions = []
  
file_path: stable-baselines/stable_baselines/her/replay_buffer.py
imports: import copy
  from enum import Enum
  import numpy
label_desc: Use image node_id 2 for calling the HindsightExperienceReplayWrapper obj's underlying member method code with example usage: obj.add(obs_t, action, reward, obs_tp1, done, info) without return types