-
Notifications
You must be signed in to change notification settings - Fork 28
Running Java Agents in Py Pommerman (Direct Server Connection)
Both frameworks (Java and Python) will need to be run at the same time, so make sure they are both setup properly and can run independently on your machine.
In Py-Pommerman, find file examples/simple_ffa_run.py
and modify the agent list to the following:
agent_list = [
agents.HttpAgent(port=12344),
agents.SimpleAgent(),
agents.SimpleAgent(),
agents.SimpleAgent(),
]
This will have one Java agent (as player 0) playing against 3 SimpleAgent players from py-pommerman.
In Java-Pommerman, modify line 86 in network/Server.java
class to the desired agent, e.g.:
agent = new MCTSPlayer(0, id, new MCTSParams());
This will have an MCTS player with default parameters playing against the py-pommerman players.
Make sure the port number from the python file (12345 in this example) is the same in Java (line 32 in network/Server.java
class).
Finally, run the Java-Pommerman network/Server.java
class, followed by the Py-Pommerman file (examples/simple_ffa_run.py
).
- Home
- Pommerman Game Rules
- Py-Pommerman
- Java-Pommerman
- Docker
- Python-Java Connection