Skip to content

Commit 38e81a0

Browse files
author
Chris Elion
authored
add env.step() (#3068)
1 parent 9e091a8 commit 38e81a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

notebooks/getting-started.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
"outputs": [],
7777
"source": [
7878
"env = UnityEnvironment(file_name=env_name)\n",
79+
"# Step once to make sure brains are sent over.\n",
80+
"env.step()\n",
7981
"\n",
8082
"# Set the default brain to work with\n",
8183
"default_brain = env.external_brain_names[0]\n",
@@ -116,7 +118,7 @@
116118
"metadata": {},
117119
"source": [
118120
"### 5. Take random actions in the environment\n",
119-
"Once we restart an environment, we can step the environment forward and provide actions to all of the agents within the environment. Here we simply choose random actions based on the `action_space_type` of the default brain. \n",
121+
"Once we restart an environment, we can step the environment forward and provide actions to all of the agents within the environment. Here we simply choose random actions based on the `action_space_type` of the default brain.\n",
120122
"\n",
121123
"Once this cell is executed, 10 messages will be printed that detail how much reward will be accumulated for the next 10 episodes. The Unity environment will then pause, waiting for further signals telling it what to do next. Thus, not seeing any animation is expected when running this cell."
122124
]
@@ -134,7 +136,7 @@
134136
" while not done:\n",
135137
" action_size = brain.vector_action_space_size\n",
136138
" if brain.vector_action_space_type == 'continuous':\n",
137-
" env_info = env.step(np.random.randn(len(env_info.agents), \n",
139+
" env_info = env.step(np.random.randn(len(env_info.agents),\n",
138140
" action_size[0]))[default_brain]\n",
139141
" else:\n",
140142
" action = np.column_stack([np.random.randint(0, action_size[i], size=(len(env_info.agents))) for i in range(len(action_size))])\n",
@@ -180,7 +182,7 @@
180182
"nbconvert_exporter": "python",
181183
"pygments_lexer": "ipython3",
182184
"version": "3.6.6"
183-
}
185+
},
184186
},
185187
"nbformat": 4,
186188
"nbformat_minor": 1

0 commit comments

Comments
 (0)