Now, it's time to build our maze solver!
Using a DQN to solve a little ASCII maze is a bit like bringing a bulldozer to the beach to make sandcastles for your kids: it's completely unnecessary, but you get to play with a big machine. However, as a tool for learning about DQNs, mazes are invaluable. This is because the number of states or actions in the game is limited, and the representation of constraints is also simple (such as the walls of our maze that our agent cannot move through). This means that we can step through our program and easily inspect what our network is doing.
We will follow these steps:
- Create a maze.go file for this bit of code
- Import our libraries and set our data type
- Define our Maze{}
- Write a NewMaze() function to instantiate this struct
We also need to define our Maze{} helper functions. These include...