Subprocess Vectorization¶
Single-Agent¶
- class xuance.environment.vector_envs.subprocess.subproc_vec_env.SubprocVecEnv(env_fns, env_seed, in_series=1)[源代码]¶
基类:
VecEnvVecEnv that runs multiple environments in parallel in subproceses and communicates with them via pipes. Recommended to use when num_envs > 1 and step() can be a bottleneck.
- close_extras()[源代码]¶
Clean up the extra resources, beyond what’s in this base class. Only runs when not self.closed.
- reset()[源代码]¶
Reset all the environments and return an array of observations, or a dict of observation arrays. If step_async is still doing work, that work will be cancelled and step_wait() should not be called until step_async() is invoked again.
Multi-Agent¶
- class xuance.environment.vector_envs.subprocess.subproc_vec_maenv.SubprocVecEnv_Football(env_fns, env_seed, context='spawn', in_series=1)[源代码]¶
- class xuance.environment.vector_envs.subprocess.subproc_vec_maenv.SubprocVecEnv_StarCraft2(env_fns, env_seed, context='spawn', in_series=1)[源代码]¶
- class xuance.environment.vector_envs.subprocess.subproc_vec_maenv.SubprocVecMultiAgentEnv(env_fns, env_seed, context='spawn', in_series=1)[源代码]¶
基类:
VecEnvVecEnv that runs multiple environments in parallel in subproceses and communicates with them via pipes. Recommended to use when num_envs > 1 and step() can be a bottleneck.
- close_extras()[源代码]¶
Clean up the extra resources, beyond what’s in this base class. Only runs when not self.closed.
- reset()[源代码]¶
Reset all the environments and return an array of observations, or a dict of observation arrays. If step_async is still doing work, that work will be cancelled and step_wait() should not be called until step_async() is invoked again.