夺宝奇谋:竞技版

../../../_images/atari_entombed_competitive.gif

此环境是 Atari 环境的一部分。请先阅读该页面以获取一般信息。

导入

from pettingzoo.atari import entombed_competitive_v3

动作

离散

并行 API

手动控制

智能体

agents= ['first_0', 'second_0']

智能体

2

动作形状

(1,)

动作值

[0,17]

观测形状

(210, 160, 3)

观测值

(0,255)

《夺宝奇谋》的竞技版是一场比拼谁坚持最久的竞赛。

你需要快速向下穿越一个持续生成的迷宫,你只能看到其中的一部分。如果你被困住,你就输了。请注意,你很容易发现自己身处死胡同,只有使用稀有道具才能逃脱。此外,还有危险的僵尸潜伏在你周围,需要避开。每当你的对手死亡时,你获得 +1 的奖励,你的对手获得 -1 的奖励。

《夺宝奇谋》官方手册

环境参数

环境参数对所有 Atari 环境都通用,并在基础 Atari 文档中进行了描述。

动作空间

在任何给定回合中,智能体可以从 18 种动作中选择一种。

动作

行为

0

无操作

1

射击

2

向上移动

3

向右移动

4

向左移动

5

向下移动

6

向上偏右移动

7

向上偏左移动

8

向下偏右移动

9

向下偏左移动

10

向上射击

11

向右射击

12

向左射击

13

向下射击

14

向上偏右射击

15

向上偏左射击

16

向下偏右射击

17

向下偏左射击

版本历史

  • v3:最小动作空间 (1.18.0)

  • v2:整个 API 的重大更改,修复了《夺宝奇谋》的奖励 (1.4.0)

  • v1:修复了所有环境处理过早死亡的方式 (1.3.0)

  • v0:初始版本发布 (1.0.0)

用法

AEC

from pettingzoo.atari import entombed_competitive_v3

env = entombed_competitive_v3.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()

并行

from pettingzoo.atari import entombed_competitive_v3

env = entombed_competitive_v3.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()

API

class pettingzoo.atari.entombed_competitive.entombed_competitive.raw_env(**kwargs)[源代码]