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

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:

主站蜘蛛池模板: 乡城县| 张家港市| 平和县| 丰顺县| 长沙县| 达州市| 罗江县| 麻栗坡县| 青铜峡市| 海淀区| 滁州市| 胶南市| 翁源县| 资兴市| 武隆县| 施秉县| 永和县| 齐齐哈尔市| 保康县| 邹平县| 全南县| 武强县| 惠水县| 昌黎县| 和政县| 万宁市| 泰宁县| 通渭县| 桂阳县| 大安市| 喀喇| 昆明市| 大田县| 香格里拉县| 遂平县| 读书| 永州市| 新绛县| 盐山县| 阜宁县| 郸城县|