class_docstr: Tracks the current state of a (possibly multi-agent) episode.
class_docstr_tok: ["Tracks","the","current","state","of","a","(","possibly","multi-agent",")","episode","."]
docstr: Add action, reward, info, and next_obs as a new step.
  
  Args:
      agent_id: Agent ID.
      values: Dict of action, reward, info, and next_obs.
docstr_tok: ["Add","action",",","reward",",","info",",","and","next_obs","as","a","new","step",".","Args",":","agent_id",":","Agent","ID",".","values",":","Dict","of","action",",","reward",",","info",",","and","next_obs","."]
code: def add_action_reward_done_next_obs(
      self,
      agent_id: AgentID,
      values: Dict[str, TensorType],
  ) -> None:
      """Add action, reward, info, and next_obs as a new step.
  
      Args:
          agent_id: Agent ID.
          values: Dict of action, reward, info, and next_obs.
      """
      # Make sure, agent already has some (at least init) data.
      assert agent_id in self._agent_collectors
  
      self.active_agent_steps += 1
      self.total_agent_steps += 1
  
      # Include the current agent id for multi-agent algorithms.
      if agent_id != _DUMMY_AGENT_ID:
          values["agent_id"] = agent_id
  
      # Add action/reward/next-obs (and other data) to Trajectory.
      self._agent_collectors[agent_id].add_action_reward_next_obs(
          values
      )
  
      # Keep track of agent reward history.
      reward = values[SampleBatch.REWARDS]
      self.total_reward += reward
      self.agent_rewards[
          (agent_id, self.policy_for(agent_id))
      ] += reward
      self._agent_reward_history[agent_id].append(reward)
  
      # Keep track of last terminated info for agent.
      if SampleBatch.TERMINATEDS in values:
          self._last_terminateds[agent_id] = values[
              SampleBatch.TERMINATEDS
          ]
      # Keep track of last truncated info for agent.
      if SampleBatch.TRUNCATEDS in values:
          self._last_truncateds[agent_id] = values[
              SampleBatch.TRUNCATEDS
          ]
  
      # Keep track of last info dict if available.
      if SampleBatch.INFOS in values:
          self.set_last_info(agent_id, values[SampleBatch.INFOS])
  
imports: import random
  from collections import defaultdict
  import numpy
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple
  from ray.rllib.env.base_env import _DUMMY_AGENT_ID
  from ray.rllib.evaluation.collectors.simple_list_collector import _PolicyCollector, _PolicyCollectorGroup
  from ray.rllib.evaluation.collectors.agent_collector import AgentCollector
  from ray.rllib.policy.policy_map import PolicyMap
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.utils.typing import AgentID, EnvID, EnvInfoDict, PolicyID, TensorType
label_desc: Use image node_id 7 for calling the EpisodeV2 obj's underlying member method code with example usage: obj.add_action_reward_done_next_obs(agent_id, values) without return types