docstr: Rollout worker generates experience by interacting with one or many environments.
  
  Args:
      venv: vectorized gym environments.
      policy (object): the policy that is used to act
      dims (dict of ints): the dimensions for observations (o), goals (g), and actions (u)
      logger (object): the logger that is used by the rollout worker
      rollout_batch_size (int): the number of parallel rollouts that should be used
      exploit (boolean): whether or not to exploit, i.e. to act optimally according to the
          current policy without any exploration
      use_target_net (boolean): whether or not to use the target net for rollouts
      compute_Q (boolean): whether or not to compute the Q values alongside the actions
      noise_eps (float): scale of the additive Gaussian noise
      random_eps (float): probability of selecting a completely random action
      history_len (int): length of history for statistics smoothing
      render (boolean): whether or not to render the rollouts
docstr_tok: ["Rollout","worker","generates","experience","by","interacting","with","one","or","many","environments",".","Args",":","venv",":","vectorized","gym","environments",".","policy","(","object",")",":","the","policy","that","is","used","to","act","dims","(","dict","of","ints",")",":","the","dimensions","for","observations","(","o",")",",","goals","(","g",")",",","and","actions","(","u",")","logger","(","object",")",":","the","logger","that","is","used","by","the","rollout","worker","rollout_batch_size","(","int",")",":","the","number","of","parallel","rollouts","that","should","be","used","exploit","(","boolean",")",":","whether","or","not","to","exploit",",","i.e",".","to","act","optimally","according","to","the","current","policy","without","any","exploration","use_target_net","(","boolean",")",":","whether","or","not","to","use","the","target","net","for","rollouts","compute_Q","(","boolean",")",":","whether","or","not","to","compute","the","Q","values","alongside","the","actions","noise_eps","(","float",")",":","scale","of","the","additive","Gaussian","noise","random_eps","(","float",")",":","probability","of","selecting","a","completely","random","action","history_len","(","int",")",":","length","of","history","for","statistics","smoothing","render","(","boolean",")",":","whether","or","not","to","render","the","rollouts"]
code: def __init__(
      self,
      venv,
      policy,
      dims,
      logger,
      T,
      rollout_batch_size=1,
      exploit=False,
      use_target_net=False,
      compute_Q=False,
      noise_eps=0,
      random_eps=0,
      history_len=100,
      render=False,
      monitor=False,
      **kwargs,
  ):
      """Rollout worker generates experience by interacting with one or many environments.
  
      Args:
          venv: vectorized gym environments.
          policy (object): the policy that is used to act
          dims (dict of ints): the dimensions for observations (o), goals (g), and actions (u)
          logger (object): the logger that is used by the rollout worker
          rollout_batch_size (int): the number of parallel rollouts that should be used
          exploit (boolean): whether or not to exploit, i.e. to act optimally according to the
              current policy without any exploration
          use_target_net (boolean): whether or not to use the target net for rollouts
          compute_Q (boolean): whether or not to compute the Q values alongside the actions
          noise_eps (float): scale of the additive Gaussian noise
          random_eps (float): probability of selecting a completely random action
          history_len (int): length of history for statistics smoothing
          render (boolean): whether or not to render the rollouts
      """
  
      assert self.T > 0
  
      self.info_keys = [
          key.replace("info_", "")
          for key in dims.keys()
          if key.startswith("info_")
      ]
  
      self.success_history = deque(maxlen=history_len)
      self.Q_history = deque(maxlen=history_len)
  
      self.n_episodes = 0
      self.reset_all_rollouts()
      self.clear_history()
  
file_path: baselines/baselines/her/rollout.py
imports: from collections import deque
  import numpy
  import pickle
  from baselines.her.util import convert_episode_to_batch_major, store_args
label_desc: Use image node_id 1 to create a new RolloutWorker object  with example: obj = RolloutWorker(venv, policy, dims, logger, T, rollout_batch_size, exploit, use_target_net, compute_Q, noise_eps, random_eps, history_len, render, monitor)