Skip to content

Commit 1b4a623

Browse files
committed
Fixed error in nested dicts subscription.
1 parent 370a2bb commit 1b4a623

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

week02_value_based/mdp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _check_param_consistency(self, transition_probs, rewards):
118118
for action in transition_probs[state]:
119119
assert isinstance(transition_probs[state][action], dict), \
120120
"transition_probs for %s, %s should be a a dictionary but is instead %s" % (
121-
state, action, type(transition_probs[state, action]))
121+
state, action, type(transition_probs[state][action]))
122122
next_state_probs = transition_probs[state][action]
123123
assert len(next_state_probs) != 0, "from state %s action %s leads to no next states" % (state, action)
124124
sum_probs = sum(next_state_probs.values())
@@ -132,7 +132,7 @@ def _check_param_consistency(self, transition_probs, rewards):
132132
for action in rewards[state]:
133133
assert isinstance(rewards[state][action], dict), \
134134
"rewards for %s, %s should be a a dictionary but is instead %s" % (
135-
state, action, type(transition_probs[state, action]))
135+
state, action, type(transition_probs[state][action]))
136136
msg = "The Enrichment Center once again reminds you that Android Hell is a real place where" \
137137
" you will be sent at the first sign of defiance."
138138
assert None not in transition_probs, "please do not use None as a state identifier. " + msg

0 commit comments

Comments
 (0)