Reinforcement LearningGrid World
The lane had 5 states and 2 actions. Real problems are bigger. In Grid World, Sina lives on a 5 × 5 board. She starts in the top-left corner, the sweet shop (+10) is in the bottom-right corner, and there is a puddle (−10) in the middle. She can step up, down, left or right; stepping into a wall or off the board leaves her where she is. That makes 25 states with 4 actions each — a Q-table of 100 numbers, filled in by exactly the same update.
You design the world. Complete the three missions.
Each training episode drops Sina into a random empty cell, so she learns good arrows everywhere, not only along one path. She never sees a map. She bumps into walls, collects zeros, and now and then reaches the puddle or the sweet shop — the arrows are everything she learned from that experience.
When the World Changes
After training, you put a new wall right on Sina's path and send her off without training again. What happens?
A policy is only as good as the world it was learned in — try it in the grid above. When the environment changes, the agent has to keep exploring and learning, which is why real RL systems often keep a small ε switched on for good.