Explore Library
Code QuizIntermediate

Environment Step Loop

Spot why this agent never actually advances through the environment.

Codepython
state = env.reset()
done = False
while not done:
    action = policy(state)
    next_state, reward, done = env.step(action)
    learn(state, action, reward, next_state)
    # advance to the next state
    state = state

What is the bug in this environment interaction loop?