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 initial env obs at the start of a new episode
  
  Args:
      agent_id: Agent ID.
      init_obs: Initial observations.
      init_infos: Initial infos dicts.
      t: timestamp.
docstr_tok: ["Add","initial","env","obs","at","the","start","of","a","new","episode","Args",":","agent_id",":","Agent","ID",".","init_obs",":","Initial","observations",".","init_infos",":","Initial","infos","dicts",".","t",":","timestamp","."]
code: def add_init_obs(
      self,
      *,
      agent_id: AgentID,
      init_obs: TensorType,
      init_infos: Dict[str, TensorType],
      t: int = -1,
  ) -> None:
      """Add initial env obs at the start of a new episode
  
      Args:
          agent_id: Agent ID.
          init_obs: Initial observations.
          init_infos: Initial infos dicts.
          t: timestamp.
      """
      policy = self.policy_map[self.policy_for(agent_id)]
  
      # Add initial obs to Trajectory.
      assert agent_id not in self._agent_collectors
  
      self._agent_collectors[agent_id] = AgentCollector(
          policy.view_requirements,
          max_seq_len=policy.config["model"]["max_seq_len"],
          disable_action_flattening=policy.config.get(
              "_disable_action_flattening", False
          ),
          is_policy_recurrent=policy.is_recurrent(),
          intial_states=policy.get_initial_state(),
          _enable_new_api_stack=policy.config.get(
              "_enable_new_api_stack", False
          ),
      )
      self._agent_collectors[agent_id].add_init_obs(
          episode_id=self.episode_id,
          agent_index=self.agent_index(agent_id),
          env_id=self.env_id,
          init_obs=init_obs,
          init_infos=init_infos,
          t=t,
      )
  
      self._has_init_obs[agent_id] = True
  
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 6 for calling the EpisodeV2 obj's underlying member method code with example usage: obj.add_init_obs() without return types