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","."]
code: def try_restart(self, env_id: Optional[EnvID] = None) -> None:
      if isinstance(env_id, int):
          env_id = [env_id]
      if env_id is None:
          env_id = list(range(len(self.envs)))
      for idx in env_id:
          # Recreate the sub-env.
          logger.warning(
              f"Trying to restart sub-environment at index {idx}."
          )
          self.env_states[idx].env = self.envs[idx] = self.make_env(idx)
          logger.warning(
              f"Sub-environment at index {idx} restarted successfully."
          )
  
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 5 for calling the MultiAgentEnvWrapper obj's underlying member method code with example usage: obj.try_restart(env_id) without return types