在健身房环境中动态增加观察空间
我正在尝试为蛇游戏建立动态的健身环境。随着分数自然而增加,蛇的长度会增加。为了模拟动态性,我将随着分数的增加而逐渐在游戏中添加障碍物(墙壁)(当分数为5的倍数时)。墙的所有坐标都存储在列表中,每次分数通过5个倍数时,在随机位置添加了一个新段,并将其附加到列表中。
在参考现有解决方案时,我注意到有两种提及观察空间的方法:
- 第一个包括使用Gunt.spaces.box的整个窗口(对我来说这不太好)。
- 第二个是更紧凑的表示,得分更好。观察空间包括蛇的坐标,食物的坐标以及使用gym.spaces.dict的窗口尺寸。
我想为环境实施第二种方法,但是我不知道如何通过墙壁的坐标。
PS:这是我第一次在堆栈跨流上提出一个问题,因此,如果我的询问方式有任何问题/错误,请告诉我。
I am trying to build a dynamic gym environment for a snake game. As the score increases, naturally, the snake's length increases. To simulate dynamicity, I'm adding obstacles (walls) to the game gradually as the score increases (when the score is a multiple of 5). All the coordinates of a wall are stored in a list and every time the score passes a multiple of 5, a new segment is added at a random position and this is appended to the list.
While referring to existing solutions, I noticed that there are two ways of mentioning the observation space:
- The first one includes passing the entire window (this hasn't worked too well for me) using gym.spaces.Box.
- The second one is a more compact representation which resulted in a better score. The observation space included variables like the snake's coordinates, the food's coordinates, and the window size using gym.spaces.Dict.
I would like to implement the second approach for my environment, but I don't have any idea how I would pass the walls' coordinates.
P.S.: This is my first time asking a question on stack-overflow so if there's any issue/ mistake in my way of asking, do let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论