Skip to content

Implementation of Reinforcement learning using Q learning algorithm- Robot in Maze - Matlab

Notifications You must be signed in to change notification settings

threemmm/ML-Q-Learning-Robot-in-Maze-MATLAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Learning

Reinforcement learning / Q-Learning

Implementation of Q-learning algorithm for solving maze in Matlab

This Q-Learning code for MATLAB has been written by Mohammad Maghsoudi Mehrabani. It trains an agent to find the way from start point to goal point through a 20x20 maze.

  • Actions include turning and moving through the maze
  • The agent earns rewards from the environment under certain conditions
  • The agent’s goal is to maximize the reward

The Base Map

alt text

Base map is stored in maze.txt included Start Point, Goal Point, Walls and Obstacles.

Rewards:

  • Goal = 200
  • Hole = -10
  • Oil = -5
  • Free Cells = -1

How to run

Just open Main.m file and click on Run button

And Following convergence of the algorithm, MATLAB will print out the best path to the goal

Output :

  • Optimal Path which shows the best path from start point to goal point - the best path is shown in below: alt text

  • Figure 1 : Average Cumulative Rewards of each Episode of 30 Runs vs. Episodes alt text

  • Figure 2 : Average Steps of each Episode of 30 Runs vs. Episodes alt text

About

Implementation of Reinforcement learning using Q learning algorithm- Robot in Maze - Matlab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages