Git Product home page Git Product logo

rubimonti / neural-network-catan Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 8.31 MB

The settlers of Catan is a very popular board game based in building and colonizing the island of Catan. In this project, a neural network is trained to play the game and try to win the most games as possible.

License: Other

Python 100.00%
catan-board-game machine-learning neural-network python3 simulation catan

neural-network-catan's Introduction

Neural-Network-Catan

The settlers of Catan is a very popular board game based in building and colonizing the island of Catan. Created by Klaus Teuber, this game has sold millions of copies in more than 15 languages all over the world.

In this project, a simulation of the game is creted in order to provide a neural network the facilities to be trained to play the game and try to win the most games as possible. The project is divided in two parts, the training of the neural network and the execution of the game itself.

Explanation of the proyect

The goal of this project is to:

  • Build a simulator that can execute the game of catan and all variables and information are available to the player at any moment during the game.
  • Create an artificial intelligence able to beat 3 players whose actions are chosen randomly.

For more information, read the paper located at the base directory of this repositoy.

How to use the project

This tutorial is for Linux users with python 3 installed

First of all, clone this repository in your local machine.

git clone https://github.com/RubiMonti/Neural-Network-Catan.git

Afterwards, check if the modules needed are installed:

pip3 install pygad

If it is up to date, everything is ready to run, access the repository and execute the following commands to execute the game with the trained agent:

cd Game
python3 catan.py

You can also train the agent and introduced the new arguments in the simulation. The process of obtaining new arguments is very long (aproximately 16 hours) so make sure you have some spare time:

cd Training
python3 Genetic_Algorithm.py
mv Best_solution.txt ../Game/
cd ../Game/
python3 catan.py Best_solution.txt

A window must pop up and the game shall begin. You can pause the game pressing the 'p' key and continue it by pressing the same button again. When the game ends, just close the window to end the program.

neural-network-catan's People

Stargazers

 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.