class_docstr: A simple RL environment loop.
  
  This takes `Environment` and `Actor` instances and coordinates their
  interaction. Agent is updated if `should_update=True`. This can be used as:
  
    loop = EnvironmentLoop(environment, actor)
    loop.run(num_episodes)
  
  A `Counter` instance can optionally be given in order to maintain counts
  between different Acme components. If not given a local Counter will be
  created to maintain counts between calls to the `run` method.
  
  A `Logger` instance can also be passed in order to control the output of the
  loop. If not given a platform-specific default logger will be used as defined
  by utils.loggers.make_default_logger. A string `label` can be passed to easily
  change the label associated with the default logger; this is ignored if a
  `Logger` instance is given.
  
  A list of 'Observer' instances can be specified to generate additional metrics
  to be logged by the logger. They have access to the 'Environment' instance,
  the current timestep datastruct and the current action.
class_docstr_tok: ["A","simple","RL","environment","loop",".","This","takes","`","Environment","`","and","`","Actor","`","instances","and","coordinates","their","interaction",".","Agent","is","updated","if","`","should_update=True","`",".","This","can","be","used","as",":","loop","=","EnvironmentLoop","(","environment",",","actor",")","loop.run","(","num_episodes",")","A","`","Counter","`","instance","can","optionally","be","given","in","order","to","maintain","counts","between","different","Acme","components",".","If","not","given","a","local","Counter","will","be","created","to","maintain","counts","between","calls","to","the","`","run","`","method",".","A","`","Logger","`","instance","can","also","be","passed","in","order","to","control","the","output","of","the","loop",".","If","not","given","a","platform-specific","default","logger","will","be","used","as","defined","by","utils.loggers.make_default_logger",".","A","string","`","label","`","can","be","passed","to","easily","change","the","label","associated","with","the","default","logger",";","this","is","ignored","if","a","`","Logger","`","instance","is","given",".","A","list","of","'Observer","'","instances","can","be","specified","to","generate","additional","metrics","to","be","logged","by","the","logger",".","They","have","access","to","the","'Environment","'","instance",",","the","current","timestep","datastruct","and","the","current","action","."]
code: def __init__(
      self,
      environment: dm_env.Environment,
      actor: core.Actor,
      counter: Optional[counting.Counter] = None,
      logger: Optional[loggers.Logger] = None,
      should_update: bool = True,
      label: str = "environment_loop",
      observers: Sequence[observers_lib.EnvLoopObserver] = (),
  ):
      # Internalize agent and environment.
      self._environment = environment
      self._actor = actor
      self._counter = counter or counting.Counter()
      self._logger = logger or loggers.make_default_logger(
          label, steps_key=self._counter.get_steps_key()
      )
      self._should_update = should_update
      self._observers = observers
  
file_path: acme/acme/environment_loop.py
imports: import operator
  import time
  from typing import List, Optional, Sequence
  from acme import core
  from acme.utils import counting
  from acme.utils import loggers
  from acme.utils import observers
  from acme.utils import signals
  import dm_env
  from dm_env import specs
  import numpy
  import tree
label_desc: Use image node_id 1 to create a new EnvironmentLoop object from inherited base classes: core with example: obj = EnvironmentLoop(environment, actor, counter, logger, should_update, label, observers)