战争领主 (Warlords)

../../../_images/atari_warlords.gif

此环境属于雅达利环境系列。请先阅读该页面以获取一般信息。

导入

from pettingzoo.atari import warlords_v3

动作

离散

并行 API

手动控制

智能体

agents= ['first_0', 'second_0', 'third_0', 'fourth_0']

智能体

4

动作形状

(1,)

动作取值

[0,5]

观察形状

(210, 160, 3)

观察取值

(0,255)

四人混战,最后的幸存者!

保护你的堡垒免受球的攻击,并将球击向你的对手。

当你的堡垒被摧毁时,你将获得 -1 奖励并结束游戏。如果你是最后一位幸存者,你将获得 +1 奖励。

沃之巫师 (wizard_of_wor) 官方手册

环境参数

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

动作空间 (最小集)

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

动作

行为

0

无操作

1

射击

2

向上移动

3

向右移动

4

向左移动

5

向下移动

版本历史

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

  • v2:整个 API 的重大变更 (1.4.0)

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

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

用法

AEC

from pettingzoo.atari import warlords_v3

env = warlords_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 warlords_v3

env = warlords_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.warlords.warlords.raw_env(**kwargs: Any)[source]