Code QuizIntermediate MDP Step Function
Spot the bug in an MDP step returning reward and terminal flag.
Codejavascript
// An MDP transition: given state+action, produce next state & reward
function step(state, action) {
const nextState = transition(state, action);
const reward = rewardFn(state, action);
const done = isTerminal(state);
return { reward, done };
}What is the bug in this MDP step function?