Commit d4a32136 authored by Steven Cordwell's avatar Steven Cordwell
Browse files

clean up QLearning code a bit

parent 8a57e24e
......@@ -986,13 +986,12 @@ class QLearning(MDP):
# The following check won't be done in MDP()'s initialisation, so let's
# do it here
if (n_iter < 10000):
raise ValueError("PyMDPtoolbox: n_iter should be greater than "
"10000.")
self.max_iter = int(n_iter)
assert self.max_iter >= 10000, "PyMDPtoolbox: n_iter should be " \
"greater than 10000."
# We don't want to send this to MDP because _computePR should not be
# run on it
# MDP.__init__(self, transitions, reward, discount, None, n_iter)
# run on it, so check that it defines an MDP
check(transitions, reward)
if (transitions.dtype is object):
......@@ -1010,8 +1009,6 @@ class QLearning(MDP):
self.discount = discount
self.max_iter = n_iter
# Initialisations
self.Q = zeros((self.S, self.A))
self.mean_discrepancy = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment