Skip to content

Commit

Permalink
update ch1.md
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwang067 committed Jul 25, 2023
1 parent 5d248d6 commit e164cf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/chapter1/chapter1.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def play(env, agent, render=False, train=False):

上面代码中的 play 函数可以让智能体和环境交互一个回合,该函数有 4 个参数。env 是环境类。agent 是智能体类。render 是 bool 型变量,其用于判断是否需要图形化显示。如果 render 为 True,则在交互过程中会调用 env.render() 以显示图形界面,通过调用 env.close() 可关闭图形界面。train 是 bool 型变量,其用于判断是否训练智能体,在训练过程中设置为 True,让智能体学习;在测试过程中设置为 False,让智能体保持不变。该函数的返回值 episode\_reward 是 float 型的数值,其表示智能体与环境交互一个回合的回合总奖励。

接下来,我们使用下面的代码让智能体和环境交互一个回合,并且显示图像界面
接下来,我们使用下面的代码让智能体和环境交互一个回合,并显示图形界面

```python
env.seed(3) # 设置随机种子,让结果可复现
Expand Down

0 comments on commit e164cf2

Please sign in to comment.