class_docstr: Internal adapter of MultiAgentEnv to BaseEnv.
  
  This also supports vectorization if num_envs > 1.
class_docstr_tok: ["Internal","adapter","of","MultiAgentEnv","to","BaseEnv",".","This","also","supports","vectorization","if","num_envs",">","1","."]
docstr: Resets all or one particular sub-environment's state (by index).
  
  Args:
      idx: The index to reset at. If None, reset all the sub-environments' states.
docstr_tok: ["Resets","all","or","one","particular","sub-environment","'s","state","(","by","index",")",".","Args",":","idx",":","The","index","to","reset","at",".","If","None",",","reset","all","the","sub-environments","'","states","."]
code: def _init_env_state(self, idx: Optional[int] = None) -> None:
      """Resets all or one particular sub-environment's state (by index).
  
      Args:
          idx: The index to reset at. If None, reset all the sub-environments' states.
      """
      # If index is None, reset all sub-envs' states:
      if idx is None:
          self.env_states = [
              _MultiAgentEnvState(
                  env, self.restart_failed_sub_environments
              )
              for env in self.envs
          ]
      # Index provided, reset only the sub-env's state at the given index.
      else:
          assert isinstance(idx, int)
          self.env_states[idx] = _MultiAgentEnvState(
              self.envs[idx], self.restart_failed_sub_environments
          )
  
imports: import gymnasium
  import logging
  from typing import Callable, Dict, List, Tuple, Optional, Union, Set, Type
  from ray.rllib.env.base_env import BaseEnv
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.utils.annotations import ExperimentalAPI, override, PublicAPI, DeveloperAPI
  from ray.rllib.utils.typing import AgentID, EnvCreator, EnvID, EnvType, MultiAgentDict, MultiEnvDict
  from ray.util import log_once
label_desc: Use image node_id 15 for calling the MultiAgentEnvWrapper obj's underlying member method code with example usage: obj._init_env_state(idx) without return types