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).
code: def __init__(
      self,
      *,
      seed,
      max_episode_length,
      worker_number,
      n_envs=DEFAULT_N_ENVS,
      timesteps_per_call=1,
  ):
      super().__init__(
          seed=seed,
          max_episode_length=max_episode_length,
          worker_number=worker_number,
      )
      self._n_envs = n_envs
      self._timesteps_per_call = timesteps_per_call
      self._needs_env_reset = True
      self._envs = [None] * n_envs
      self._agents = [None] * n_envs
      self._episode_lengths = [0] * self._n_envs
      self._complete_fragments = []
      # Initialized in start_episode
      self._fragments = None
  
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 1 to create a new FragmentWorker object from inherited base classes: DefaultWorker with example: obj = FragmentWorker()