GithubHelp home page GithubHelp logo

projectis's Introduction

Schnapsen platform - Project Intelligent Systems 2022-2023

Please Create Dataset and Run KNN_modelling

The dataset and KNN model are too large, so please create datasets and model the KNN to run the code.

Getting started

This is the improved platform for the schnapsen card game. To get to know the concept of the game, please visit this web page.

To use the platform, your python version must be at least 3.9, we suggest installing conda an using an environment.

To get started, install the schnapsen package and itse dependencies in editable mode by running:

pip install -e .

To run the tests, run:

pip install -e '.[test]'  # on Linux / MacOS
pip install -e ".[test]"  # on Windows
pytest ./tests

If the above fails, try deactivating your environment and activating it again. Then retry installing the dependencies.

Running the CLI

After intalling, you can try the provided command line interface examples. Most examples are bots playing against each other; read the code for details.

To run the CLI, run:

python cli.py

This will list the available commands.

For example, if you want try a RandBot play against another RandBot, type python cli.py random-game.

Running the GUI

The graphical user interface (GUI) lets you play visually against a bot (e.g., You vs. RandBot).

To start the GUI, run:

python executables/server.py

Now, open your webbrowser and type in the server address (i.e., http://127.0.0.1:8080). By default, you are playing against RandBot. You can also play against other bots. Run

python server.py --help

for more details.

Implementing more bots

You will find bot examples in the src/schnapsen/bots folder. You can look at the example_bot.py file for various methods provided to your bot.

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.

Documentation

The code is documented using reStructuredText. You can either read the documentation along the code, or generate a more suer friendly version. A pregenerated version of the documentation can be found int he doc folder. It can be regenerated by runnign the following in the root of the repository.

pip install pdoc
pdoc --html src/schnapsen executables/ -o doc/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.