Skip to content

PacmanRL - Reinforcement Learning for Pacman (Q-Learning / SARSA)

License

Notifications You must be signed in to change notification settings

Sphincz/PacmanRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PacmanRL - Reinforcement Learning for Pacman 🎮

Introduction

Welcome to PacmanRL, an academic project designed for the curricular unit of Unsupervised Learning. This project combines the classic Pacman game with the field of Reinforcement Learning (RL). The aim is to provide students with hands-on experience in developing and implementing RL algorithms, specifically Q-Learning and SARSA, to control Pacman.

Objective

The primary goal of PacmanRL is to create an RL agent that learns optimal strategies for navigating the maze, collecting pellets, and avoiding ghosts.

Technical Framework

  • Python Version: Python 3.11+
  • Main Libraries:
    • Pygame: A set of Python modules designed for writing video games.
    • Gymnasium: A toolkit for developing and comparing reinforcement learning algorithms.
    • MiniGrid: A minimalistic gridworld environment for reinforcement learning.

Project Structure

  • main.py: Entry point of the game.
  • game/: Contains core game logic, including Pacman and ghost entities, and maze management.
  • gui/: Houses the graphical user interface components for rendering the game view.
  • agents/: Includes the RL agents for Q-Learning and SARSA.

Getting Started

To configure your project, you need to clone the repository, set up your development environment by installing the necessary dependencies, and familiarize yourself with the project's structure and objectives. Ensure you have Python 3.11 installed on your machine.

Steps:

  1. Clone the repository:
git clone https://github.com/Sphincz/PacmanRL
  1. Navigate to the project directory:
cd PacmanRL
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the game:
python main.py

Evaluation Criteria

  • CA1: Correctness and efficiency of the RL algorithm development and implementation.
  • CA2: Ability of the algorithm to make strategic decisions in navigating the maze and avoiding ghosts.
  • CA3: Clarity, organization, and documentation of the code, as well as best coding practices.
  • CA4: Demonstration of a profound understanding of reinforcement learning principles and their application in game strategy optimization.
  • CA5: Creative approaches and solutions to challenges encountered during development.
  • CA6: Presentation and defense of the project in the final evaluation session.