class_docstr: Worker with a single policy and multiple environments.
  
  Alternates between taking a single step in all environments and asking the
  policy for an action for every environment. This allows computing a batch
  of actions, which is generally much more efficient than computing a single
  action when using neural networks.
  
  Args:
      seed (int): The seed to use to intialize random number generators.
      max_episode_length (int or float): The maximum length of episodes which
          will be sampled. Can be (floating point) infinity.
      worker_number (int): The number of the worker this update is
          occurring in. This argument is used  set a different seed for
          each worker.
      n_envs (int): Number of environment copies to use.
class_docstr_tok: ["Worker","with","a","single","policy","and","multiple","environments",".","Alternates","between","taking","a","single","step","in","all","environments","and","asking","the","policy","for","an","action","for","every","environment",".","This","allows","computing","a","batch","of","actions",",","which","is","generally","much","more","efficient","than","computing","a","single","action","when","using","neural","networks",".","Args",":","seed","(","int",")",":","The","seed","to","use","to","intialize","random","number","generators",".","max_episode_length","(","int","or","float",")",":","The","maximum","length","of","episodes","which","will","be","sampled",".","Can","be","(","floating","point",")","infinity",".","worker_number","(","int",")",":","The","number","of","the","worker","this","update","is","occurring","in",".","This","argument","is","used","set","a","different","seed","for","each","worker",".","n_envs","(","int",")",":","Number","of","environment","copies","to","use","."]
docstr: Collect all completed episodes.
  
  Returns:
      EpisodeBatch: A batch of the episodes completed since the last call
          to collect_episode().
docstr_tok: ["Collect","all","completed","episodes",".","Returns",":","EpisodeBatch",":","A","batch","of","the","episodes","completed","since","the","last","call","to","collect_episode","(",")","."]
code: def collect_episode(self):
      """Collect all completed episodes.
  
      Returns:
          EpisodeBatch: A batch of the episodes completed since the last call
              to collect_episode().
  
      """
      if len(self._completed_episodes) == 1:
          result = self._completed_episodes[0]
      else:
          result = EpisodeBatch.concatenate(*self._completed_episodes)
      self._completed_episodes = []
      return result
  
file_path: garage/src/garage/sampler/vec_worker.py
imports: import collections
  import copy
  import numpy
  from garage import EpisodeBatch, StepType
  from garage.sampler import _apply_env_update
  from garage.sampler.default_worker import DefaultWorker
label_desc: Use image node_id 7 for calling the VecWorker obj's underlying member method code with example usage: obj.collect_episode() and returns: result