Skip to content

Getting started with the environment

Tuana Durmayüksel edited this page Jan 22, 2025 · 1 revision

Getting Started with the Environment

This page provides a comprehensive guide to setting up and running the project, including instructions for using the Command Line Interface (CLI), Graphical User Interface (GUI), and implementing custom bots. Additionally, troubleshooting steps for Python environments and installation are also covered.


1. Running the Command Line Interface (CLI)

Once you've installed the required dependencies, you can interact with the project using the Command Line Interface (CLI). The CLI is useful for testing the bots and running automated games between them.

To run the CLI, execute the following command:

python executables/cli.py

This will list all the available commands you can use in the CLI. For example, if you'd like to try a game where two bots (e.g., RandBot) play against each other, run:

python executables/cli.py random-game`.

The random-game command will initiate a game where two bots (random ) play against each other.

2. Running the Graphical User Interface (GUI)

The project also includes a graphical user interface (GUI) that lets you play visually against a bot. This is ideal if you prefer a more interactive experience compared to the CLI. To start the GUI, follow these steps:

  1. Run the server using the following command:
    python executables/server.py
  2. Open a web browser and navigate to http://127.0.0.1:8080. This will load the GUI, where you can play against the default bot, RandBot.
  3. You can modify the code in executables/server.py to choose different bots if you'd like to play against one other than RandBot.

Implementing more bots

The project comes with several example bots, which are located in the src/schnapsen/bots directory. If you want to create your own bot or learn how the existing bots work, you can start by looking at the example_bot.py file.

The documentation for the platform is hosted at https://intelligent-systems-course.github.io/schnapsen/

Troubleshooting

Getting the right python

The first hurdle in getting the platform to run is getting the right python version on your system. An easy way to get that is using virtual environments. We suggest you install conda to manage them. Then, you can use conda to create a new environment by running

conda create --name project_is python=3.10

With this environment created, you can start it

conda activate project_is

Inside this environment you can install the dependencies as instructed above.

Run the right python

If you install conda and create an environment, you can run python by just running the python command. However, often your system also provides a python version. To know which python is running, use

which python    # on linux
where python    # on windows (untested)

Now, you want to look at the output and make sure that this executable is inside the anaconda folder and not where your system stores its executables.