He gets a negative reward for bumping into the walls or trying to leave the world. Now we let him run till he reaches his reward a few million times. We can guide him a bit by telling to go with the best path he know at the time instead of just randomly moving and hoping he hits the reward. The best number of for percent random I found was about .7. Oh, I almost forgot the colors on the map mean something.
Pure yellow is the best and red to black is increasingly worse.
So off the poor agent goes to learn his world. Needed for my open gl projects. Go to the CS Department Web Page.