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: Update an agent, assuming it implements :class:`~Policy`.
  
  Args:
      agent_update (np.ndarray or dict or Policy): If a tuple, dict, or
          np.ndarray, these should be parameters to agent, which should
          have been generated by calling `Policy.get_param_values`.
          Alternatively, a policy itself. Note that other implementations
          of `Worker` may take different types for this parameter.
docstr_tok: ["Update","an","agent",",","assuming","it","implements",":","class",":","`","~Policy","`",".","Args",":","agent_update","(","np.ndarray","or","dict","or","Policy",")",":","If","a","tuple",",","dict",",","or","np.ndarray",",","these","should","be","parameters","to","agent",",","which","should","have","been","generated","by","calling","`","Policy.get_param_values","`",".","Alternatively",",","a","policy","itself",".","Note","that","other","implementations","of","`","Worker","`","may","take","different","types","for","this","parameter","."]
code: def update_agent(self, agent_update):
      """Update an agent, assuming it implements :class:`~Policy`.
  
      Args:
          agent_update (np.ndarray or dict or Policy): If a tuple, dict, or
              np.ndarray, these should be parameters to agent, which should
              have been generated by calling `Policy.get_param_values`.
              Alternatively, a policy itself. Note that other implementations
              of `Worker` may take different types for this parameter.
  
      """
      if isinstance(agent_update, (dict, tuple, np.ndarray)):
          self.agent.set_param_values(agent_update)
      elif agent_update is not None:
          self.agent = agent_update
  
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 3 for calling the DefaultWorker obj's underlying member method code with example usage: obj.update_agent(agent_update) without return types