官术网_书友最值得收藏!

There's more...

You may wonder why we need to install Atari dependencies. In fact, there are a few more environments that do not accompany the installation of gym, such as Box2d, Classic control, MuJoCo, and Robotics.

Take the Box2d environments, for example; we need to install the Box2d dependencies before we first run the environments. Again, two installation approaches are as follows:

pip install gym[box2d]
pip install -e '.[box2d]'

After that, we can play around with the LunarLander environment, as follows:

>>> env = gym.make('LunarLander-v2')
>>> env.reset()
array([-5.0468446e-04, 1.4135642e+00, -5.1140346e-02, 1.1751971e-01,
5.9164839e-04, 1.1584054e-02, 0.0000000e+00, 0.0000000e+00],
dtype=float32)
>>> env.render()

A game window will pop up:

主站蜘蛛池模板: 临城县| 阿拉善右旗| 明星| 调兵山市| 天津市| 宜川县| 苏尼特左旗| 维西| 宾阳县| 徐州市| 邛崃市| 库车县| 咸宁市| 车险| 安义县| 灵寿县| 长春市| 徐州市| 仙游县| 海原县| 乌拉特前旗| 健康| 泗洪县| 聊城市| 儋州市| 汝城县| 安西县| 石渠县| 冕宁县| 开封市| 义乌市| 灌南县| 大宁县| 岚皋县| 东乡族自治县| 辽宁省| 广东省| 巴东县| 盐城市| 武定县| 广水市|