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

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:

主站蜘蛛池模板: 朔州市| 开原市| 响水县| 叶城县| 来宾市| 福州市| 惠水县| 朝阳县| 蓬莱市| 腾冲县| 长治县| 漳平市| 尉氏县| 叶城县| 甘德县| 宁河县| 讷河市| 临沭县| 青冈县| 肇东市| 双鸭山市| 孝感市| 横峰县| 阜阳市| 肃北| 阳曲县| 青冈县| 碌曲县| 洪雅县| 英吉沙县| 林芝县| 荥阳市| 固原市| 克拉玛依市| 拜城县| 桐城市| 延庆县| 慈利县| 中卫市| 长丰县| 观塘区|