Skip to content

Commit 8da669c

Browse files
author
Sanyam Kapoor
committed
Fix missing render()
1 parent 5e3b1fc commit 8da669c

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

TD/Cliff Environment Playground.ipynb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": 1,
6-
"metadata": {
7-
"collapsed": false
8-
},
6+
"metadata": {},
97
"outputs": [],
108
"source": [
119
"import gym\n",
@@ -21,9 +19,7 @@
2119
{
2220
"cell_type": "code",
2321
"execution_count": 2,
24-
"metadata": {
25-
"collapsed": false
26-
},
22+
"metadata": {},
2723
"outputs": [
2824
{
2925
"name": "stdout",
@@ -80,6 +76,13 @@
8076
"print(env.step(2))\n",
8177
"env.render()"
8278
]
79+
},
80+
{
81+
"cell_type": "code",
82+
"execution_count": null,
83+
"metadata": {},
84+
"outputs": [],
85+
"source": []
8386
}
8487
],
8588
"metadata": {
@@ -98,9 +101,9 @@
98101
"name": "python",
99102
"nbconvert_exporter": "python",
100103
"pygments_lexer": "ipython3",
101-
"version": "3.5.1"
104+
"version": "3.6.4"
102105
}
103106
},
104107
"nbformat": 4,
105-
"nbformat_minor": 0
108+
"nbformat_minor": 1
106109
}

TD/Windy Gridworld Playground.ipynb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 2,
6-
"metadata": {
7-
"collapsed": false
8-
},
5+
"execution_count": 1,
6+
"metadata": {},
97
"outputs": [],
108
"source": [
119
"import gym\n",
@@ -20,10 +18,8 @@
2018
},
2119
{
2220
"cell_type": "code",
23-
"execution_count": 5,
24-
"metadata": {
25-
"collapsed": false
26-
},
21+
"execution_count": 2,
22+
"metadata": {},
2723
"outputs": [
2824
{
2925
"name": "stdout",
@@ -119,6 +115,13 @@
119115
"print(env.step(1))\n",
120116
"env.render()"
121117
]
118+
},
119+
{
120+
"cell_type": "code",
121+
"execution_count": null,
122+
"metadata": {},
123+
"outputs": [],
124+
"source": []
122125
}
123126
],
124127
"metadata": {
@@ -137,9 +140,9 @@
137140
"name": "python",
138141
"nbconvert_exporter": "python",
139142
"pygments_lexer": "ipython3",
140-
"version": "3.5.1"
143+
"version": "3.6.4"
141144
}
142145
},
143146
"nbformat": 4,
144-
"nbformat_minor": 0
147+
"nbformat_minor": 1
145148
}

lib/envs/cliff_walking.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def __init__(self):
5353

5454
super(CliffWalkingEnv, self).__init__(nS, nA, P, isd)
5555

56+
def render(self, mode='human', close=False):
57+
self._render(mode, close)
58+
5659
def _render(self, mode='human', close=False):
5760
if close:
5861
return
@@ -78,4 +81,4 @@ def _render(self, mode='human', close=False):
7881
output += "\n"
7982

8083
outfile.write(output)
81-
outfile.write("\n")
84+
outfile.write("\n")

lib/envs/windy_gridworld.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def __init__(self):
5353

5454
super(WindyGridworldEnv, self).__init__(nS, nA, P, isd)
5555

56+
def render(self, mode='human', close=False):
57+
self._render(mode, close)
58+
5659
def _render(self, mode='human', close=False):
5760
if close:
5861
return
@@ -76,4 +79,4 @@ def _render(self, mode='human', close=False):
7679
output += "\n"
7780

7881
outfile.write(output)
79-
outfile.write("\n")
82+
outfile.write("\n")

0 commit comments

Comments
 (0)