MultiAgentLearning / playground

PlayGround: AI Research into Multi-Agent Learning.
https://www.pommerman.com
Apache License 2.0
768 stars 216 forks source link

Radio scenario agent death #199

Closed jault closed 5 years ago

jault commented 5 years ago

Defining an agent as

from pommerman.agents import BaseAgent
from pommerman.agents.simple_agent import SimpleAgent

class Agent(BaseAgent):

    def __init__(self):
        BaseAgent.__init__(self)

        self.simple = SimpleAgent()

    def act(self, obs, action_space):
        action = self.simple.act(obs, action_space)

        return [action, 0, 0]

Then using the radio scenario and the game loop provided in the docs with 4 of these agents, when one dies an error is thrown by the environment:

Traceback (most recent call last): File "C:/Users/James/PycharmProjects/pommerman/Game.py", line 67, in main() File "C:/Users/James/PycharmProjects/pommerman/Game.py", line 47, in main state, reward, done, info = env.step(actions) File "C:\Users\James\AppData\Local\Programs\Python\Python36\lib\site-packages\pommerman\envs\v2.py", line 85, in step personal_actions = [action[0] for action in actions] File "C:\Users\James\AppData\Local\Programs\Python\Python36\lib\site-packages\pommerman\envs\v2.py", line 85, in personal_actions = [action[0] for action in actions] TypeError: 'int' object is not subscriptable

weseldridge commented 5 years ago

Thanks for creating this.

cinjon commented 5 years ago

Just pushed @d0e4f6902 that fixes this. Thanks for bringing it to our attention!