victor-hugo-dc / connectfour-ai

Monte Carlo Tree Search and Deep Q-Network implementations for Connect Four.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connect 4 MCTS and Deep Q-Network

Implementation of a Monte Carlo Tree Search algorithm and a Deep Q-Network for Connect Four. Made as a final project for Computational Intelligence for Games. The orginal code was written in a Jupyter notebook but has since been transferred to individual files for ease of use and modularity.

Usage

To run this project,

  1. Install Python 3.8 or above from here
  2. Clone the repository:
    git clone https://github.com/victor-hugo-dc/connectfour-ai.git
    
    or download as a zip file and extract.
  3. To install all dependencies, run:
    pip install -r requirements.txt
    
  4. In simulate.py, view the possible simulations that can be made with the MCTS. Choose a match up, write it in the main file and in the root directory, run:
    python3 main.py
    
  5. To run the DQN, go in the ai directory and run train.py

Authors

About

Monte Carlo Tree Search and Deep Q-Network implementations for Connect Four.


Languages

Language:Python 100.0%