r""" Execute the behavior policy--an :math:`\epsilon`-soft policy used to generate actions during training. Parameters ---------- obs : int, float, or :py:class:`ndarray ` as returned by ``env.step(action)`` An observation from the
(self, obs)
| 1233 | self._on_policy_update(s, a, r, s_, a_) |
| 1234 | |
| 1235 | def act(self, obs): |
| 1236 | r""" |
| 1237 | Execute the behavior policy--an :math:`\epsilon`-soft policy used to |
| 1238 | generate actions during training. |
| 1239 | |
| 1240 | Parameters |
| 1241 | ---------- |
| 1242 | obs : int, float, or :py:class:`ndarray <numpy.ndarray>` as returned by ``env.step(action)`` |
| 1243 | An observation from the environment. |
| 1244 | |
| 1245 | Returns |
| 1246 | ------- |
| 1247 | action : int, float, or :py:class:`ndarray <numpy.ndarray>` |
| 1248 | An action sampled from the distribution over actions defined by the |
| 1249 | epsilon-soft policy. |
| 1250 | """ # noqa: E501 |
| 1251 | s = self._obs2num[obs] |
| 1252 | return self.behavior_policy(s) |
| 1253 | |
| 1254 | def greedy_policy(self, max_steps, render=True): |
| 1255 | """ |