Welcome to Snake AI, a Python-based project that combines the classic Snake game with artificial intelligence (AI) to train an agent to play the game autonomously. This project uses reinforcement learning techniques to teach the agent how to navigate the game board, avoid obstacles, and collect rewards.
-
Reinforcement Learning: Utilizes reinforcement learning techniques to train an AI agent.
-
Pygame Integration: Uses the Pygame library for game development and visualization.
-
Training and Evaluation: Allows users to train the AI agent and evaluate its performance over time.
-
Plotting: Includes plotting functionality to visualize the agent's training progress.
To install and run Snake AI on your local machine, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/Srilakshmi-mothkur/snake-ai.git
-
Navigate to the project directory:
cd snake-ai
-
Install the required dependencies:
pip install -r requirements.txt
To train the AI agent and visualize its progress, follow these steps:
-
Run the
agent.py
script:python agent.py
-
Watch as the agent learns to play the Snake game autonomously.
-
Monitor the training progress with the plot displayed on the screen.
Contributions are welcomed. If you'd like to contribute, please follow these guidelines:
- Fork the repository and create your branch.
- Make your changes and test them thoroughly.
- Submit a pull request with a clear description of your changes.
Snake AI is licensed under the MIT License. See the LICENSE file for more details.
I would like to thank the contributors to the Pygame library for their efforts in creating an excellent framework for game development in Python.