class_docstr: The lowest-level env interface used by RLlib for sampling.
  
  BaseEnv models multiple agents executing asynchronously in multiple
  vectorized sub-environments. A call to `poll()` returns observations from
  ready agents keyed by their sub-environment ID and agent IDs, and
  actions for those agents can be sent back via `send_actions()`.
  
  All other RLlib supported env types can be converted to BaseEnv.
  RLlib handles these conversions internally in RolloutWorker, for example:
  
  gym.Env => rllib.VectorEnv => rllib.BaseEnv
  rllib.MultiAgentEnv (is-a gym.Env) => rllib.VectorEnv => rllib.BaseEnv
  rllib.ExternalEnv => rllib.BaseEnv
  
  .. testcode::
      :skipif: True
  
      MyBaseEnv = ...
      env = MyBaseEnv()
      obs, rewards, terminateds, truncateds, infos, off_policy_actions = (
          env.poll()
      )
      print(obs)
  
      env.send_actions({
        "env_0": {
          "car_0": 0,
          "car_1": 1,
        }, ...
      })
      obs, rewards, terminateds, truncateds, infos, off_policy_actions = (
          env.poll()
      )
      print(obs)
  
      print(terminateds)
  
  .. testoutput::
  
      {
          "env_0": {
              "car_0": [2.4, 1.6],
              "car_1": [3.4, -3.2],
          },
          "env_1": {
              "car_0": [8.0, 4.1],
          },
          "env_2": {
              "car_0": [2.3, 3.3],
              "car_1": [1.4, -0.2],
              "car_3": [1.2, 0.1],
          },
      }
      {
          "env_0": {
              "car_0": [4.1, 1.7],
              "car_1": [3.2, -4.2],
          }, ...
      }
      {
          "env_0": {
              "__all__": False,
              "car_0": False,
              "car_1": True,
          }, ...
      }
class_docstr_tok: ["The","lowest-level","env","interface","used","by","RLlib","for","sampling",".","BaseEnv","models","multiple","agents","executing","asynchronously","in","multiple","vectorized","sub-environments",".","A","call","to","`","poll","(",")","`","returns","observations","from","ready","agents","keyed","by","their","sub-environment","ID","and","agent","IDs",",","and","actions","for","those","agents","can","be","sent","back","via","`","send_actions","(",")","`",".","All","other","RLlib","supported","env","types","can","be","converted","to","BaseEnv",".","RLlib","handles","these","conversions","internally","in","RolloutWorker",",","for","example",":","gym.Env","=",">","rllib.VectorEnv","=",">","rllib.BaseEnv","rllib.MultiAgentEnv","(","is-a","gym.Env",")","=",">","rllib.VectorEnv","=",">","rllib.BaseEnv","rllib.ExternalEnv","=",">","rllib.BaseEnv","..","testcode",":",":",":","skipif",":","True","MyBaseEnv","=","...","env","=","MyBaseEnv","(",")","obs",",","rewards",",","terminateds",",","truncateds",",","infos",",","off_policy_actions","=","(","env.poll","(",")",")","print","(","obs",")","env.send_actions","(","{","``","env_0","''",":","{","``","car_0","''",":","0",",","``","car_1","''",":","1",",","}",",","...","}",")","obs",",","rewards",",","terminateds",",","truncateds",",","infos",",","off_policy_actions","=","(","env.poll","(",")",")","print","(","obs",")","print","(","terminateds",")","..","testoutput",":",":","{","``","env_0","''",":","{","``","car_0","''",":","[","2.4",",","1.6","]",",","``","car_1","''",":","[","3.4",",","-3.2","]",",","}",",","``","env_1","''",":","{","``","car_0","''",":","[","8.0",",","4.1","]",",","}",",","``","env_2","''",":","{","``","car_0","''",":","[","2.3",",","3.3","]",",","``","car_1","''",":","[","1.4",",","-0.2","]",",","``","car_3","''",":","[","1.2",",","0.1","]",",","}",",","}","{","``","env_0","''",":","{","``","car_0","''",":","[","4.1",",","1.7","]",",","``","car_1","''",":","[","3.2",",","-4.2","]",",","}",",","...","}","{","``","env_0","''",":","{","``","__all__","''",":","False",",","``","car_0","''",":","False",",","``","car_1","''",":","True",",","}",",","...","}"]
docstr: Returns observations from ready agents.
  
  All return values are two-level dicts mapping from EnvID to dicts
  mapping from AgentIDs to (observation/reward/etc..) values.
  The number of agents and sub-environments may vary over time.
  
  Returns:
      Tuple consisting of:
      New observations for each ready agent.
      Reward values for each ready agent. If the episode is just started,
      the value will be None.
      Terminated values for each ready agent. The special key "__all__" is used to
      indicate episode termination.
      Truncated values for each ready agent. The special key "__all__"
      is used to indicate episode truncation.
      Info values for each ready agent.
      Agents may take off-policy actions, in which case, there will be an entry
      in this dict that contains the taken action. There is no need to
      `send_actions()` for agents that have already chosen off-policy actions.
docstr_tok: ["Returns","observations","from","ready","agents",".","All","return","values","are","two-level","dicts","mapping","from","EnvID","to","dicts","mapping","from","AgentIDs","to","(","observation\/reward\/etc","..",")","values",".","The","number","of","agents","and","sub-environments","may","vary","over","time",".","Returns",":","Tuple","consisting","of",":","New","observations","for","each","ready","agent",".","Reward","values","for","each","ready","agent",".","If","the","episode","is","just","started",",","the","value","will","be","None",".","Terminated","values","for","each","ready","agent",".","The","special","key","``","__all__","''","is","used","to","indicate","episode","termination",".","Truncated","values","for","each","ready","agent",".","The","special","key","``","__all__","''","is","used","to","indicate","episode","truncation",".","Info","values","for","each","ready","agent",".","Agents","may","take","off-policy","actions",",","in","which","case",",","there","will","be","an","entry","in","this","dict","that","contains","the","taken","action",".","There","is","no","need","to","`","send_actions","(",")","`","for","agents","that","have","already","chosen","off-policy","actions","."]
code: def poll(
      self,
  ) -> Tuple[
      MultiEnvDict,
      MultiEnvDict,
      MultiEnvDict,
      MultiEnvDict,
      MultiEnvDict,
      MultiEnvDict,
  ]:
      """Returns observations from ready agents.
  
      All return values are two-level dicts mapping from EnvID to dicts
      mapping from AgentIDs to (observation/reward/etc..) values.
      The number of agents and sub-environments may vary over time.
  
      Returns:
          Tuple consisting of:
          New observations for each ready agent.
          Reward values for each ready agent. If the episode is just started,
          the value will be None.
          Terminated values for each ready agent. The special key "__all__" is used to
          indicate episode termination.
          Truncated values for each ready agent. The special key "__all__"
          is used to indicate episode truncation.
          Info values for each ready agent.
          Agents may take off-policy actions, in which case, there will be an entry
          in this dict that contains the taken action. There is no need to
          `send_actions()` for agents that have already chosen off-policy actions.
      """
      raise NotImplementedError
  
imports: import logging
  from typing import Callable, Tuple, Optional, List, Dict, Any, TYPE_CHECKING, Union, Set
  import gymnasium
  import ray
  from ray.rllib.utils.annotations import Deprecated, DeveloperAPI, PublicAPI
  from ray.rllib.utils.typing import AgentID, EnvID, EnvType, MultiEnvDict
label_desc: Use image node_id 2 for calling the BaseEnv obj's underlying member method code with example usage: obj.poll() without return types