concept grid - world environment in category reinforcement learning

This is an excerpt from Manning's book Grokking Deep Reinforcement Learning.
A Concrete Example
The Bandit Walk environment
Let’s make these concepts concrete with our first RL environment: I created this very simple environment for this book; I call it the Bandit Walk (BW).
BW is a very simple grid-world (GW) environment. GWs are a common type of environments for studying RL algorithms that are grids of any size. GWs can have any model (transition and reward functions) you can think of, and can make any kind of actions available.
But, they all commonly make move actions available to the agent: LEFT, DOWN, RIGHT, UP (or WEST, SOUTH, EAST, NORTH, which is more precise because the agent has no heading and usually has no visibility of the full grid, but cardinal directions can also be more confusing). And, of course, each action with the logical transitions; E.g. a left moves the agent left most of the time, etc. Also, they all tend to have a fully-observable discrete state and observation spaces (that is state == observation) with integers representing the cell id location of the agent. A “Walk” is a special case of grid-world environments with a single row. In reality, what I call a “Walk,” is more commonly referred to as a “Corridor.” But, in this book, I use the term “Walk” for all the grid-world environments with a single row.
The Bandit Walk (BW) is a walk with 3 states, but only 1 non-terminal state. Environments that have a single non-terminal state are called “bandit” environments. “Bandit” here is an analogy to slot machines, which are also known as “one-armed bandits”; they have one arm and, if you like gambling, can empty your pockets, just like a bandit would.
The BW environment has just 2 actions available: a left (action 0) and an right (action 1) action. BW has a deterministic transition function: a left actions always moves the agent to the left, and a right action always moves the agent to the right. The reward signal is a +1 when landing on the rightmost cell, 0 otherwise. The agent starts in the middle cell.
Figure 2.3 The bandit walk (BW) environment
