A simple artificial intelligence MDP to find the optimal policy of a given map.
- Install
Python3on your computer.
sudo apt-get install python3- Install
Python3's Tkinteron your computer.
sudo apt install idle3 python3-tk-
Clone/download this folder to your computer.
-
give the file
mdp_grid_worldpermissions to execute.
chmod a+x mdp_grid_world- run
./mdp_grid_worldwithin this folder to show the help message.
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.
-
Create a file and name it anything, say
world.txtand open it. -
Layout your grid as lowercase letters:
2.1
vmeans a void cell.2.2
wmeans a wall cell.2.3
emeans an exit cell.2.4
pmeans a pit cell. -
run the program passing the file's name as an argument:
./mdp_grid_world world.txt-
Example of a
world.txtfile:v v v e
v w v p
v w v w
v v v v
