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

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:

主站蜘蛛池模板: 古蔺县| 麻城市| 德兴市| 湘西| 沧州市| 德惠市| 威宁| 宜川县| 余庆县| 平安县| 宁波市| 全椒县| 嘉兴市| 永嘉县| 通辽市| 天门市| 三门县| 雅安市| 天镇县| 神池县| 兰州市| 永新县| 龙山县| 瑞丽市| 房山区| 贡嘎县| 迁西县| 南皮县| 定州市| 长丰县| 阿城市| 浮梁县| 利辛县| 崇礼县| 行唐县| 景东| 会东县| 陇川县| 衢州市| 临沧市| 马尔康县|