视频跳棋¶

该环境是 Atari 环境 的一部分。请先阅读该页面以获取一般信息。
导入 |
|
---|---|
动作 |
离散 |
Parallel API |
是 |
手动控制 |
否 |
智能体 |
|
智能体 |
2 |
动作形状 |
(1,) |
动作值 |
[0,4] |
观察形状 |
(210, 160, 3) |
观察值 |
(0,255) |
一款经典的策略游戏,具有街机风格的控制。
通过跳过对手的棋子来捕获它们。要移动棋子,你需要将光标悬停在棋子上并按下开火键(动作 1),移动光标,然后再次按下开火键。请注意,按钮必须按住多帧才能被注册。
如果你通过捕获所有对手的棋子获胜,你将获得 +1 奖励,你的对手获得 -1 奖励。
这是一个计时游戏:如果玩家在 10 秒后没有采取行动,则该玩家将获得 -1 分的奖励,对手则没有奖励,计时器重置。这阻止了玩家无限期地拖延游戏,但也意味着它不再是纯粹的零和游戏。
环境参数¶
环境参数对所有 Atari 环境都是通用的,并在 Atari 基础文档 中进行了描述。
动作空间(最小)¶
在任何给定回合中,智能体可以从 5 个动作中选择一个。
动作 |
行为 |
---|---|
0 |
开火 |
1 |
向上移动 |
2 |
向右移动 |
3 |
向左移动 |
4 |
向下移动 |
版本历史¶
v4:最小动作空间 (1.18.0)
v3:无动作计时器 (1.9.0)
v2:修复跳棋奖励 (1.5.0)
v1:整个 API 的重大更改 (1.4.0)
v0:初始版本发布 (1.0.0)
用法¶
AEC¶
from pettingzoo.atari import video_checkers_v4
env = video_checkers_v4.env(render_mode="human")
env.reset(seed=42)
for agent in env.agent_iter():
observation, reward, termination, truncation, info = env.last()
if termination or truncation:
action = None
else:
# this is where you would insert your policy
action = env.action_space(agent).sample()
env.step(action)
env.close()
Parallel¶
from pettingzoo.atari import video_checkers_v4
env = video_checkers_v4.parallel_env(render_mode="human")
observations, infos = env.reset()
while env.agents:
# this is where you would insert your policy
actions = {agent: env.action_space(agent).sample() for agent in env.agents}
observations, rewards, terminations, truncations, infos = env.step(actions)
env.close()