@@ -56,11 +56,32 @@ def HALFCHEETAH_VERSIONED():
5656
5757def PONG_VERSIONED ():
5858 # load gym
59+ # Gymnasium says that the ale_py behaviour changes from 1.0
60+ # but with python 3.12 it is already the case with 0.29.1
61+ try :
62+ import ale_py # noqa
63+ except ImportError :
64+ pass
65+
5966 if gym_backend () is not None :
6067 _set_gym_environments ()
6168 return _PONG_VERSIONED
6269
6370
71+ def BREAKOUT_VERSIONED ():
72+ # load gym
73+ # Gymnasium says that the ale_py behaviour changes from 1.0
74+ # but with python 3.12 it is already the case with 0.29.1
75+ try :
76+ import ale_py # noqa
77+ except ImportError :
78+ pass
79+
80+ if gym_backend () is not None :
81+ _set_gym_environments ()
82+ return _BREAKOUT_VERSIONED
83+
84+
6485def PENDULUM_VERSIONED ():
6586 # load gym
6687 if gym_backend () is not None :
@@ -69,42 +90,46 @@ def PENDULUM_VERSIONED():
6990
7091
7192def _set_gym_environments ():
72- global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED
93+ global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED , _BREAKOUT_VERSIONED
7394
7495 _CARTPOLE_VERSIONED = None
7596 _HALFCHEETAH_VERSIONED = None
7697 _PENDULUM_VERSIONED = None
7798 _PONG_VERSIONED = None
99+ _BREAKOUT_VERSIONED = None
78100
79101
80102@implement_for ("gym" , None , "0.21.0" )
81103def _set_gym_environments (): # noqa: F811
82- global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED
104+ global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED , _BREAKOUT_VERSIONED
83105
84106 _CARTPOLE_VERSIONED = "CartPole-v0"
85107 _HALFCHEETAH_VERSIONED = "HalfCheetah-v2"
86108 _PENDULUM_VERSIONED = "Pendulum-v0"
87109 _PONG_VERSIONED = "Pong-v4"
110+ _BREAKOUT_VERSIONED = "Breakout-v4"
88111
89112
90113@implement_for ("gym" , "0.21.0" , None )
91114def _set_gym_environments (): # noqa: F811
92- global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED
115+ global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED , _BREAKOUT_VERSIONED
93116
94117 _CARTPOLE_VERSIONED = "CartPole-v1"
95118 _HALFCHEETAH_VERSIONED = "HalfCheetah-v4"
96119 _PENDULUM_VERSIONED = "Pendulum-v1"
97120 _PONG_VERSIONED = "ALE/Pong-v5"
121+ _BREAKOUT_VERSIONED = "ALE/Breakout-v5"
98122
99123
100124@implement_for ("gymnasium" )
101125def _set_gym_environments (): # noqa: F811
102- global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED
126+ global _CARTPOLE_VERSIONED , _HALFCHEETAH_VERSIONED , _PENDULUM_VERSIONED , _PONG_VERSIONED , _BREAKOUT_VERSIONED
103127
104128 _CARTPOLE_VERSIONED = "CartPole-v1"
105129 _HALFCHEETAH_VERSIONED = "HalfCheetah-v4"
106130 _PENDULUM_VERSIONED = "Pendulum-v1"
107131 _PONG_VERSIONED = "ALE/Pong-v5"
132+ _BREAKOUT_VERSIONED = "ALE/Breakout-v5"
108133
109134
110135if _has_gym :
0 commit comments