Commit 287ec766 authored by Steven Cordwell's avatar Steven Cordwell
Browse files

reconfigure the reward table to store the state

parent 33ebe256
......@@ -562,12 +562,13 @@ def exampleRand(S, A, is_sparse=False, is_sqlite=False, mask=None):
for a in range(A):
cmd = '''
CREATE TABLE transition%s (row INTEGER, col INTEGER,
val REAL);
CREATE TABLE reward%s (val REAL);''' % (a, a)
prob REAL);
CREATE TABLE reward%s (state INTEGER, val REAL);''' % (a, a)
states = range(S)
reward = rand(S).tolist()
cmd = "INSERT INTO reward%s VALUES(?)" % a
c.executemany(cmd, zip(reward))
cmd = "INSERT INTO reward%s VALUES(?, ?)" % a
c.executemany(cmd, zip(states, reward))
for s in xrange(S):
n = randint(1, S//3)
# timeit [90894] * 20330
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