CS1440 AGT Server
Introduction
The AGT Server is a python platform designed to run and implement game environments that autonomous agents can connect to and compete in. Presently the server only supports
- Complete Information and Incomplete Information Matrix Games (e.g. Rock-Paper-Scissors, BotS, etc...)
However, at its core the server is also designed to be flexible so that new game environments can be easily created, modified, and adjusted.
Getting Started
Installation
Ensure that you have the latest version of pip installed
First clone the respositiory
git clone https://github.com/JohnUUU/agt-server-remastered.git
Please create a virtual environment first
python3 -m venv .venv
source .venv/bin/activate
For Users
pip install --upgrade pip
pip install agt_server
For Developers
In the root directory, install the project in an editable state
pip install --upgrade pip
pip install -e .
pip install -r requirements.txt
Usage
From here you can start a server in src/server
by running
python server.py [server_config_file] [--ip [ip_address]] [--port [port]]
Then you can run any of the example agents in src/agt_agents/test_agents
by running
Usage:
python [agent_file].py [name] [--join_server] [--ip [ip_address]] [--port [port]]
Or you can write a agent file that implements any of the src/agt_agents/base_agents
and then use
agent.connect(ip, port)
Frequently Asked Questions
-
I cant run rps_test.sh or any of the other .sh test files
- Unfortunately this is currently only supports Mac's
terminal.app
. If you are using the Mac terminal then make sure to chmod +x
the shell command before running it. - You may also need to change the IP address of each agent to be the ip address of your computers hostname as well.
-
I am recieving an error concerning my hostname
- Please find your ip address using
ifconfig
(Mac) or ipconfig
(Windows) under en0
or eth0
. Find your hostname using echo $HOST
and then set the host in \etc\hosts
. That usually fixes the problem. - Alternatively if that doesn't work you can just supply the ip address that you found to server.py when you run it using the optional
--ip
arguement. - This is mostly a bandaid solution by overriding the hostname locally and you'll have to do it everytime the ISP switches, if anyone has more experience with DNS resolution and wants to help please reach out!
-
What if the server hangs for some unexpected reason?
- These things can be hard to debug but the backup solution is that the server code will catch any interrupts (^C) commands
that you give it and return the currently compiled results to the best of its ability so that the agents will know who was winning at that point.