def generate_A():
for every valid (state,action) in STATE_ACTIONS:
## No Op case
if action == ACTION_NONE:
A[state_row][state_action_col] = +1
continue
## Else
A[state_row][state_action_col] = 1
for every possible new_state:
A[new_state_row][state_action_col] -= probability[new_state]