-
Notifications
You must be signed in to change notification settings - Fork 28
Running Py Pommerman Docker Agents
- Install Docker (Mac) (Windows) (Ubuntu). On Windows, Hyper-V is a requirement, so do allow that to be enabled when prompted (PC will restart).
- Start Docker. The Docker icon in the taskbar should be saying 'Docker is starting...'.
- Sign up for an account with Docker and log in.
- Docker icon in the taskbar should be saying 'Docker is running'. Make sure this is running before trying to run Docker agents!
- Open a terminal and run the following command to get previous competition entries (Details of entries):
docker pull multiagentlearning/{hakozakijunctions, eisenach, dypm.1/dypm.2, navocado, skynet955}
(select only 1 of the options to download; in the rest of this example we consider skynet955 was downloaded at multiagentlearning/skynet955).
- This should have the agents loaded in your Docker instance. Ready to run them!
Open a terminal in the root directory of python Pommerman repository and run command:
pom_battle --agents=test::agents.SimpleAgent,test::agents.SimpleAgent,test::agents.SimpleAgent,docker::multiagentlearning/skynet955 --config=PommeFFACompetition-v0 --render
If pom_battle command is not recognized, run instead:
python pommerman/cli/run_battle.py --agents=test::agents.SimpleAgent,test::agents.SimpleAgent,test::agents.SimpleAgent,docker::multiagentlearning/skynet955 --config=PommeFFACompetition-v0 --render
If you get errors about beyond top-level importing, navigate to pommerman/cli/run_battle.py
in an editor and modify lines 26-27 to say instead:
from pommerman import helpers
from pommerman import make
You should now see a game being played between 3 SimpleAgent players and the skynet955 controller.
Agents may be swapped to others in the framework in the format test::agents.AgentClass
(simplified to player::arrows
for human player and random::null
for random player), or to other docker agents in the format docker::dockerPathName
.
Further customization of run is possible, check pom_battle --help
or python pommerman/cli/run_battle.py --help
(Py-Pommerman docs)
Navigate to examples/simple_ffa_run.py
. In the agent_list (lines 17-21), include all the agents you want to play with. To recreate the above examples, set the list to:
agent_list = [
agents.SimpleAgent(),
agents.SimpleAgent(),
agents.SimpleAgent(),
agents.DockerAgent("multiagentlearning/skynet955", port=12345),
]
And run the file (examples/simple_ffa_run.py
).
To include a connecting agent to Java-Pommerman, find instructions here.
To create a docker agent from a different controller existing in the python framework (e.g. SimpleAgent), make sure the agent in the examples/docker-agent/run.py
file is set to the correct one (line 11). Then build the docker image with the following command line:
docker build -t {name} -f examples/docker-agent/Dockerfile .
This can then be included in executions of agents using the {name}
of your Docker image.
- Home
- Pommerman Game Rules
- Py-Pommerman
- Java-Pommerman
- Docker
- Python-Java Connection