MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / make_env

Function make_env

4-atari-hard/env.py:169–181  ·  view source on GitHub ↗

Single gymnasium env with the standard Atari preprocessing. Used for `--test` rendering; envpool has no human render mode.

(args)

Source from the content-addressed store, hash-verified

167
168
169def make_env(args):
170 """Single gymnasium env with the standard Atari preprocessing.
171
172 Used for `--test` rendering; envpool has no human render mode."""
173 gym_id, _ = ENV_IDS[args.env]
174 env = gym.make(gym_id, frameskip=1,
175 render_mode="human" if (args.render or args.test) else None)
176 env = gym.wrappers.AtariPreprocessing(
177 env, noop_max=30, frame_skip=4, screen_size=84,
178 terminal_on_life_loss=False, grayscale_obs=True, scale_obs=False,
179 )
180 env = gym.wrappers.FrameStackObservation(env, stack_size=4)
181 return env
182
183
184def make_vec_env(args, n_envs, seed=0):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected