A pathfinding simulation using reinforcement learning, where a car navigates a grid to reach a goal while avoiding obstacles like barriers and cones.
- Python 3.9
- Pygame
- Numpy
- Matplotlib
- Pandas
- Clone the Repository:
git clone https://github.com/yourusername/graduation-project.git
- Install the Required Dependencies:
pip install pygame numpy matplotlib pandas
- Run the Main Script:
python main.py
This project implements a reinforcement learning-based agent that learns to navigate a grid with obstacles. The car uses Q-learning to explore the environment, gradually improving its decision-making by learning from rewards and penalties.
Car: The agent that moves within the grid. Goal: The target that the agent must reach. Obstacles: Barriers and cones that the car must avoid.
- Q-learning Algorithm: Used to learn the best path to the goal.
- Pygame Visualization: Real-time graphical representation of the agent's movement.
- Reward System: The agent receives rewards or penalties based on its actions.
Below is the Q-table heatmap, which shows the learned Q-values for each state-action pair and indicates the agent's learned policy.

The reward table displays the total reward accumulated by the agent over each episode and shows how it improves over time.
