class_docstr: Vectorized Worker that collects partial episodes.
  
  Useful for off-policy RL.
  
  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.
      length of fragments before they're transmitted out of
      worker_number (int): The number of the worker this update is
          occurring in. This argument is used to set a different seed for
          each worker.
      n_envs (int): Number of environment copies to use.
      timesteps_per_call (int): Maximum number of timesteps to gather per env
          per call to the worker. Defaults to 1 (i.e. gather 1 timestep per
          env each call, or n_envs timesteps in total each call).
docstr: Take a single time-step in the current episode.
  
  Returns:
      bool: True iff at least one of the episodes was completed.
docstr_tok: ["Take","a","single","time-step","in","the","current","episode",".","Returns",":","bool",":","True","iff","at","least","one","of","the","episodes","was","completed","."]
code: def step_episode(self):
      """Take a single time-step in the current episode.
  
      Returns:
          bool: True iff at least one of the episodes was completed.
  
      """
      prev_obs = np.asarray([frag.last_obs for frag in self._fragments])
      actions, agent_infos = self.agent.get_actions(prev_obs)
      completes = [False] * len(self._envs)
      for i, action in enumerate(actions):
          frag = self._fragments[i]
          if self._episode_lengths[i] < self._max_episode_length:
              agent_info = {k: v[i] for (k, v) in agent_infos.items()}
              frag.step(action, agent_info)
              self._episode_lengths[i] += 1
          if (
              self._episode_lengths[i] >= self._max_episode_length
              or frag.step_types[-1] == StepType.TERMINAL
          ):
              self._episode_lengths[i] = 0
              complete_frag = frag.to_batch()
              self._complete_fragments.append(complete_frag)
              self._fragments[i] = InProgressEpisode(self._envs[i])
              completes[i] = True
      if any(completes):
          self.agent.reset(completes)
      return any(completes)
  
file_path: garage/src/garage/sampler/fragment_worker.py
imports: import copy
  import numpy
  from garage import EpisodeBatch, StepType
  from garage.sampler import _apply_env_update, InProgressEpisode
  from garage.sampler.default_worker import DefaultWorker
label_desc: Use image node_id 4 for calling the FragmentWorker obj's underlying member method code with example usage: obj.step_episode() and returns: any