rllib/env/vector_env.py
def vectorize_gym_envs(
        make_env: Optional[Callable[[int], EnvType]] = None,
        existing_envs: Optional[List[gym.Env]] = None,
        num_envs: int = 1,
        action_space: Optional[gym.Space] = None,
        observation_space: Optional[gym.Space] = None,
        # Deprecated. These seem to have never been used.
        env_config=None,
        policy_config=None,
    ) -> "_VectorizedGymEnv":
        """Translates any given gym.Env(s) into a VectorizedEnv object.

        Args:
            make_env: Factory that produces a new gym.Env taking the sub-env's
                vector index as only arg. Must be defined if the
                number of `existing_envs` is less than `num_envs`.
            existing_envs: Optional list of already instantiated sub
                environments.
            num_envs: Total number of sub environments in this VectorEnv.
            action_space: The action space. If None, use existing_envs[0]'s
                action space.
            observation_space: The observation space. If None, use
                existing_envs[0]'s observation space.

        Returns:
            The resulting _VectorizedGymEnv object (subclass of VectorEnv).
        """
        return _VectorizedGymEnv(
            make_env=make_env,
            existing_envs=existing_envs or [],
            num_envs=num_envs,
            observation_space=observation_space,
            action_space=action_space,
        )
Translates any given gym.Env(s) into a VectorizedEnv object.

        Args:
            make_env: Factory that produces a new gym.Env taking the sub-env's
                vector index as only arg. Must be defined if the
                number of `existing_envs` is less than `num_envs`.
            existing_envs: Optional list of already instantiated sub
                environments.
            num_envs: Total number of sub environments in this VectorEnv.
            action_space: The action space. If None, use existing_envs[0]'s
                action space.
            observation_space: The observation space. If None, use
                existing_envs[0]'s observation space.

        Returns:
            The resulting _VectorizedGymEnv object (subclass of VectorEnv).
        
Translates any given gym.Env(s) into a VectorizedEnv object.
Translates any given gym . Env ( s ) into a VectorizedEnv object .
def vectorize_gym_envs(
        make_env: Optional[Callable[[int], EnvType]] = None,
        existing_envs: Optional[List[gym.Env]] = None,
        num_envs: int = 1,
        action_space: Optional[gym.Space] = None,
        observation_space: Optional[gym.Space] = None,
        env_config=None,
        policy_config=None,
    ) -> "_VectorizedGymEnv":
        return _VectorizedGymEnv(
            make_env=make_env,
            existing_envs=existing_envs or [],
            num_envs=num_envs,
            observation_space=observation_space,
            action_space=action_space,
        )
def vectorize_gym_envs ( make_env : Optional [ Callable [ [ int ] , EnvType ] ] = None , existing_envs : Optional [ List [ gym . Env ] ] = None , num_envs : int = 1 , action_space : Optional [ gym . Space ] = None , observation_space : Optional [ gym . Space ] = None , env_config = None , policy_config = None , ) -> "_VectorizedGymEnv" : return _VectorizedGymEnv ( make_env = make_env , existing_envs = existing_envs or [ ] , num_envs = num_envs , observation_space = observation_space , action_space = action_space , )
Translates any given gym.Env(s) into a VectorizedEnv object.
Translates any given gym . Env ( s ) into a VectorizedEnv object .
# Deprecated. These seem to have never been used. """Translates any given gym.Env(s) into a VectorizedEnv object.

        Args:
            make_env: Factory that produces a new gym.Env taking the sub-env's
                vector index as only arg. Must be defined if the
                number of `existing_envs` is less than `num_envs`.
            existing_envs: Optional list of already instantiated sub
                environments.
            num_envs: Total number of sub environments in this VectorEnv.
            action_space: The action space. If None, use existing_envs[0]'s
                action space.
            observation_space: The observation space. If None, use
                existing_envs[0]'s observation space.

        Returns:
            The resulting _VectorizedGymEnv object (subclass of VectorEnv).
        """
The resulting _VectorizedGymEnv object (subclass of VectorEnv).
The resulting _VectorizedGymEnv object ( subclass of VectorEnv ) .
make_env
Optional[Callable[[int], EnvType]]
Factory that produces a new gym.Env taking the sub-env's
vector index as only arg. Must be defined if the
number of `existing_envs` is less than `num_envs`.
Factory that produces a new gym . Env taking the sub - env ' s vector index as only arg . Must be defined if the number of ` existing_envs ` is less than ` num_envs ` .
existing_envs
Optional[List[gym.Env]]
Optional list of already instantiated sub
environments.
Optional list of already instantiated sub environments .
num_envs
int
Total number of sub environments in this VectorEnv.
Total number of sub environments in this VectorEnv .
action_space
Optional[gym.Space]
The action space. If None, use existing_envs[0]'s
action space.
The action space . If None use existing_envs [ 0 ] ' s action space .
observation_space
Optional[gym.Space]
The observation space. If None, use
existing_envs[0]'s observation space.
The observation space . If None use existing_envs [ 0 ] ' s observation space .
env_config
policy_config