Skip to content

OUIDEAS/MDP_GridWorld

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MDP GridWorld

A simple artificial intelligence MDP to find the optimal policy of a given map.

screenshot

Installation:

  1. Install Python3 on your computer.
sudo apt-get install python3
  1. Install Python3's Tkinter on your computer.
sudo apt install idle3 python3-tk
  1. Clone/download this folder to your computer.

  2. give the file mdp_grid_world permissions to execute.

chmod a+x mdp_grid_world
  1. run ./mdp_grid_world within this folder to show the help message.

Implementation:

All the implementation was done using Python3, with the Tkinter module (a module that facilitates GUI development in python).

There are a few files in the project:

  • mdp_grid_world: this is the main/launch file, it ties all the other files together.

  • GUI.py: Has two sub-classes that defines the aspects and aesthetics of the graphical interface like buttons, checkboxes, etc... one class opens the rules settings window and the other opens the main windows.

  • GridWorld.py: A class that defines a grid object with cells and colors and cell types, used by the GUI class to represent the world.

  • Policy.py: This the brains of the project, it implements both the value and policy iterations to solve the grid.

  • world.txt: An optional file that enables the user to define his own grid to better understand the MDP process. It could be named anything as long as it is passed correctly to the main program.

How to Load a grid world file:

  1. Create a file and name it anything, say world.txt and open it.

  2. Layout your grid as lowercase letters:

    2.1 v means a void cell.

    2.2 w means a wall cell.

    2.3 e means an exit cell.

    2.4 p means a pit cell.

  3. run the program passing the file's name as an argument:

./mdp_grid_world world.txt
  1. Example of a world.txt file:

    v v v e

    v w v p

    v w v w

    v v v v

About

A simple artificial intelligence MDP to find the optimal policy of a given map.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%