I am working through the famous RL textbook by Sutton & Barto. Currently, I am on the value iteration chapter. To gain better understanding, I coded up a small example, inspired by this article.
The problem is the following
There is a rat (R) in a grid. Every square is accessible. The goal is to find the cheese (C). However, there is also a trap (T). The game is over whenever the rat either find the cheese or is trapped (these are my terminal states).
The rat can move up, down, left, and right (always by one square).
I modeled the reward as follows:
-1 for every step
5 for finding the cheese
-5 for getting trapped
I used value iteration for this and it worked out quite nice.
However, now I would like to add another cheese to the equation. In order to win the game, the rat has to collect both cheese pieces.
I am unsure how to model this scenario. I don't think it will work when I use both cheese squares and the trap square as terminal states, with rewards for both cheese squares.
How can I model this scenario? Should I somehow combine the two cheese states into one?