Giter VIP home page Giter VIP logo

hanabi-q-learning-agent's Introduction

Computational Intelligence 2021-2022

Exam of computational intelligence 2021 - 2022. It requires teaching the client to play the game of Hanabi (rules can be found here).

Server

The server accepts passing objects provided in GameData.py back and forth to the clients. Each object has a serialize() and a deserialize(data: str) method that must be used to pass the data between server and client.

Watch out! I'd suggest to keep everything in the same folder, since serialization looks dependent on the import path (thanks Paolo Rabino for letting me know).

Server closes when no client is connected.

To start the server:

python server.py <minNumPlayers>

Arguments:

  • minNumPlayers, optional: game does not start until a minimum number of player has been reached. Default = 2

Commands for server:

  • exit: exit from the server

Client and Training

To start the client (client.py and old_client.py):

python client.py <IP> <PORT> <playerName>

To start the training client (training_client.py):

python client.py <IP> <PORT> <PlayerName> <training> <verbose> <save>

Arguments of client.py and old_client.py:

  • IP: IP address of the server (for localhost: 127.0.0.1)
  • PORT: server TCP port (default: 1024)
  • playerName: the name of the player, it must be

Arguments of training_client.py whiche must be isert in the same order riported below:

  • IP: IP address of the server (for localhost: 127.0.0.1)
  • PORT: server TCP port (default: 1024)
  • playerName: the name of the player, it must be:
    1. "squillero" if you want to save the Q-tables
    2. any other name if you don't want to save the Q-tables
  • trainig - it must be insert one of:
    1. "self" if you want a self-training approach
    2. "pre" if you want a manual-training approach
    3. any other word if you don't want to train
  • verbose - it must be insert one of:
    1. "verbose" if you want a clear output of the games
    2. any other word if you don't want output about the evolution of the games
  • save - it must be one of:
    1. "save" if you want to save the Q-tables after 50 iteration in the training folder
    2. any other word if you don't want to save the Q-tables after 50 iteration in the training folder

Commands for clients:

The clients are automatic. These commands could be used on old_client.py, in particular:

  • exit: exit from the game
  • ready: set your status to ready (lobby only)
  • show: show cards
  • hint <type> <destinatary>:
    • type: 'color' or 'value'
    • destinatary: name of the person you want to ask the hint to
  • discard <num>: discard the card num ([0-4]) from your hand

Credits

  • Game and server:
    • Giovanni Squillero
    • Andrea Calabrese
  • Client and Q-learning:
    • Alberto Castrignanò, s281689
    • Stefano Rainò, s282436

hanabi-q-learning-agent's People

Contributors

albinitpolito avatar

Watchers

 avatar

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.