@@ -34,6 +34,7 @@ def display_image(obs, mode="RGB"):
34
34
# to be 3-D.
35
35
img1 .show ()
36
36
37
+
37
38
def discrete_environment_example ():
38
39
39
40
config = {}
@@ -245,7 +246,6 @@ def grid_environment_image_representations_example():
245
246
display_image (next_obs )
246
247
247
248
248
-
249
249
def atari_wrapper_example ():
250
250
251
251
config = {
@@ -304,6 +304,7 @@ def mujoco_wrapper_example():
304
304
try :
305
305
from mdp_playground .envs import get_mujoco_wrapper
306
306
from gym .envs .mujoco .half_cheetah_v3 import HalfCheetahEnv
307
+
307
308
wrapped_mujoco_env = get_mujoco_wrapper (HalfCheetahEnv )
308
309
309
310
env = wrapped_mujoco_env (** config )
@@ -319,7 +320,12 @@ def mujoco_wrapper_example():
319
320
env .close ()
320
321
321
322
except ImportError as e :
322
- print ("Exception:" , type (e ), e , "caught. You may need to install mujoco-py. NOT running mujoco_wrapper_example." )
323
+ print (
324
+ "Exception:" ,
325
+ type (e ),
326
+ e ,
327
+ "caught. You may need to install mujoco-py. NOT running mujoco_wrapper_example." ,
328
+ )
323
329
return
324
330
325
331
@@ -337,12 +343,13 @@ def minigrid_wrapper_example():
337
343
import gym
338
344
339
345
from gym_minigrid .wrappers import RGBImgPartialObsWrapper , ImgObsWrapper
340
- env = gym .make ('MiniGrid-Empty-8x8-v0' )
341
- env = RGBImgPartialObsWrapper (env ) # Get pixel observations
342
- env = ImgObsWrapper (env ) # Get rid of the 'mission' field
346
+
347
+ env = gym .make ("MiniGrid-Empty-8x8-v0" )
348
+ env = RGBImgPartialObsWrapper (env ) # Get pixel observations
349
+ env = ImgObsWrapper (env ) # Get rid of the 'mission' field
343
350
344
351
env = GymEnvWrapper (env , ** config )
345
- obs = env .reset () # This now produces an RGB tensor only
352
+ obs = env .reset () # This now produces an RGB tensor only
346
353
347
354
print (
348
355
"Taking a step in the environment with a random action and printing the transition:"
0 commit comments