class_docstr: BaseEnv that executes its sub environments as @ray.remote actors.
  
  This provides dynamic batching of inference as observations are returned
  from the remote simulator actors. Both single and multi-agent child envs
  are supported, and envs can be stepped synchronously or asynchronously.
  
  NOTE: This class implicitly assumes that the remote envs are gym.Env's
  
  You shouldn't need to instantiate this class directly. It's automatically
  inserted when you use the `remote_worker_envs=True` option in your
  Algorithm's config.
class_docstr_tok: ["BaseEnv","that","executes","its","sub","environments","as","@","ray.remote","actors",".","This","provides","dynamic","batching","of","inference","as","observations","are","returned","from","the","remote","simulator","actors",".","Both","single","and","multi-agent","child","envs","are","supported",",","and","envs","can","be","stepped","synchronously","or","asynchronously",".","NOTE",":","This","class","implicitly","assumes","that","the","remote","envs","are","gym.Env's","You","should","n't","need","to","instantiate","this","class","directly",".","It","'s","automatically","inserted","when","you","use","the","`","remote_worker_envs=True","`","option","in","your","Algorithm","'s","config","."]
docstr: Re-creates a sub-environment at the new index.
docstr_tok: ["Re-creates","a","sub-environment","at","the","new","index","."]
code: def _make_sub_env(self, idx: Optional[int] = None):
      """Re-creates a sub-environment at the new index."""
  
      # Our `make_env` creates ray actors directly.
      if self.make_env_creates_actors:
          sub_env = self.make_env(idx)
          if self.worker is not None:
              self.worker.callbacks.on_sub_environment_created(
                  worker=self.worker,
                  sub_environment=self.actors[idx],
                  env_context=self.worker.env_context.copy_with_overrides(
                      vector_index=idx
                  ),
              )
  
      # Our `make_env` returns actual envs -> Have to convert them into actors
      # using our utility wrapper classes.
      else:
  
          def make_remote_env(i):
              logger.info("Launching env {} in remote actor".format(i))
              if self.multiagent:
                  sub_env = _RemoteMultiAgentEnv.remote(
                      self.make_env, i
                  )
              else:
                  sub_env = _RemoteSingleAgentEnv.remote(
                      self.make_env, i
                  )
  
              if self.worker is not None:
                  self.worker.callbacks.on_sub_environment_created(
                      worker=self.worker,
                      sub_environment=sub_env,
                      env_context=self.worker.env_context.copy_with_overrides(
                          vector_index=i
                      ),
                  )
  
              return sub_env
  
          sub_env = make_remote_env(idx)
  
      return sub_env
  
imports: import gymnasium
  import logging
  from typing import Callable, Dict, List, Optional, Set, Tuple, TYPE_CHECKING
  import ray
  from ray.util import log_once
  from ray.rllib.env.base_env import BaseEnv, _DUMMY_AGENT_ID, ASYNC_RESET_RETURN
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.typing import AgentID, EnvID, EnvType, MultiEnvDict
label_desc: Use image node_id 10 for calling the RemoteBaseEnv obj's underlying member method code with example usage: obj._make_sub_env(idx) and returns: sub_env, sub_env