Skip to content

Commit

Permalink
rename width and height to rows and cols
Browse files Browse the repository at this point in the history
  • Loading branch information
bob7783 committed Dec 17, 2018
1 parent 7ec1b08 commit 3efb846
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions rl/grid_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@


class Grid: # Environment
def __init__(self, width, height, start):
self.width = width
self.height = height
def __init__(self, rows, cols, start):
self.rows = rows
self.cols = cols
self.i = start[0]
self.j = start[1]

Expand Down
8 changes: 4 additions & 4 deletions rl/iterative_policy_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
SMALL_ENOUGH = 1e-3 # threshold for convergence

def print_values(V, g):
for i in range(g.width):
for i in range(g.rows):
print("---------------------------")
for j in range(g.height):
for j in range(g.cols):
v = V.get((i,j), 0)
if v >= 0:
print(" %.2f|" % v, end="")
Expand All @@ -24,9 +24,9 @@ def print_values(V, g):


def print_policy(P, g):
for i in range(g.width):
for i in range(g.rows):
print("---------------------------")
for j in range(g.height):
for j in range(g.cols):
a = P.get((i,j), ' ')
print(" %s |" % a, end="")
print("")
Expand Down

0 comments on commit 3efb846

Please sign in to comment.