class_docstr: Initialize a worker.
  
  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 where this update is
          occurring. This argument is used to set a different seed for each
          worker.
  
  Attributes:
      agent (Policy or None): The worker's agent.
      env (Environment or None): The worker's environment.
class_docstr_tok: ["Initialize","a","worker",".","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","where","this","update","is","occurring",".","This","argument","is","used","to","set","a","different","seed","for","each","worker",".","Attributes",":","agent","(","Policy","or","None",")",":","The","worker","'s","agent",".","env","(","Environment","or","None",")",":","The","worker","'s","environment","."]
docstr: Take a single time-step in the current episode.
  
  Returns:
      bool: True iff the episode is done, either due to the environment
      indicating termination of due to reaching `max_episode_length`.
docstr_tok: ["Take","a","single","time-step","in","the","current","episode",".","Returns",":","bool",":","True","iff","the","episode","is","done",",","either","due","to","the","environment","indicating","termination","of","due","to","reaching","`","max_episode_length","`","."]
code: def step_episode(self):
      """Take a single time-step in the current episode.
  
      Returns:
          bool: True iff the episode is done, either due to the environment
          indicating termination of due to reaching `max_episode_length`.
  
      """
      if self._eps_length < self._max_episode_length:
          a, agent_info = self.agent.get_action(self._prev_obs)
          es = self.env.step(a)
          self._observations.append(self._prev_obs)
          self._env_steps.append(es)
          for k, v in agent_info.items():
              self._agent_infos[k].append(v)
          self._eps_length += 1
  
          if not es.terminal:
              self._prev_obs = es.observation
              return False
      self._lengths.append(self._eps_length)
      self._last_observations.append(self._prev_obs)
      return True
  
file_path: garage/src/garage/sampler/default_worker.py
imports: from collections import defaultdict
  import numpy
  from garage import EpisodeBatch, StepType
  from garage.experiment import deterministic
  from garage.sampler import _apply_env_update
  from garage.sampler.worker import Worker
label_desc: Use image node_id 6 for calling the DefaultWorker obj's underlying member method code with example usage: obj.step_episode() and returns: True, False