Skip to content

UCT-based agent that plays Tablut with Ashton rules

License

Notifications You must be signed in to change notification settings

Scheggetta/uct-tablut

Repository files navigation

SPTeam - tablut

UCT-based agent that plays Tablut with Ashton rules.

The slides of our project are available here.

Competition results

Our team placed in 3rd position! Competition results will be published here.

Installation

The following guide assumes you are using a Linux operating system to run our program.

Dependencies

  • Python 3.9 or above / Pypy 3.9 or above (at least one of them)
  • Java 8 (installation guide)
  • git (installation guide)

Get repository

Run the following command on a clean terminal:

git clone https://github.com/Scheggetta/SPTeam-tablut

PyPy

As a performance booster we warmly advice to use PyPy just-in-time interpreter.

Run the following command on a clean terminal:

# Replace /path/to/SPTeam-tablut with SPTeam-tablut folder location
cd /path/to/SPTeam-tablut

curl https://downloads.python.org/pypy/pypy3.9-v7.3.9-linux64.tar.bz2 -o pypy.tar.bz2
mkdir pypy && tar -xf pypy.tar.bz2 -C pypy --strip-components=1

How to run

There are three possible configurations:

  • UCT agent vs random agent
  • UCT agent vs UCT agent
  • random agent vs random agent (that's boring 。^‿^。)

In all three configurations it's necessary to open three terminals:

  1. for the server
  2. for the white agent
  3. for the black agent

The way you launch both server and agents is equal for all configurations. What changes are the agents' parameters.

Agents' parameters

  • player: can be WHITE or BLACK.
  • timeout: positive integer that represents the time in seconds available to the agent before sending a move to the server. Both agents don't necessarily have to set the same timeout value.
  • ip_address: server ip address. If the agent runs on the same machine as the server, set ip_address to localhost.

Terminal instructions

First, run the server:

cd /path/to/SPTeam-tablut
java -jar Server.jar

Second, run the first agent and then the second one.

Random agent

To run the random agent:

cd /path/to/SPTeam-tablut

# Replace player, timeout and ip_address according to Agents' parameter section
java -jar RandomPlayer.jar <player> <timeout> <ip_address>

UCT agent

To run the UCT agent:

cd /path/to/SPTeam-tablut
./pypy/bin/pypy3 main.py <player> <timeout> <ip_address>

SPTeam

Credits