def make_vec_env(env_id, env_type, num_env, seed,<EOL>wrapper_kwargs=None,<EOL>start_index=<NUM_LIT:0>,<EOL>reward_scale=<NUM_LIT:1.0>,<EOL>flatten_dict_observations=True,<EOL>gamestate=None):
wrapper_kwargs = wrapper_kwargs or {}<EOL>mpi_rank = MPI.COMM_WORLD.Get_rank() if MPI else <NUM_LIT:0><EOL>seed = seed + <NUM_LIT> * mpi_rank if seed is not None else None<EOL>logger_dir = logger.get_dir()<EOL>def make_thunk(rank):<EOL><INDENT>return lambda: make_env(<EOL>env_id=env_id,<EOL>env_type=env_type,<EOL>mpi_rank=mpi_rank,<EOL>subrank=rank,<EOL>seed=seed,<EOL>reward_scale=reward_scale,<EOL>gamestate=gamestate,<EOL>flatten_dict_observations=flatten_dict_observations,<EOL>wrapper_kwargs=wrapper_kwargs,<EOL>logger_dir=logger_dir<EOL>)<EOL><DEDENT>set_global_seeds(seed)<EOL>if num_env > <NUM_LIT:1>:<EOL><INDENT>return SubprocVecEnv([make_thunk(i + start_index) for i in range(num_env)])<EOL><DEDENT>else:<EOL><INDENT>return DummyVecEnv([make_thunk(start_index)])<EOL><DEDENT>
Create a wrapped, monitored SubprocVecEnv for Atari and MuJoCo.