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)
| 1478 | self.episode_history = {"state_actions": [], "rewards": []} |
| 1479 | |
| 1480 | def act(self, obs): |
| 1481 | r""" |
| 1482 | Execute the behavior policy--an :math:`\epsilon`-soft policy used to |
| 1483 | generate actions during training. |
| 1484 | |
| 1485 | Parameters |
| 1486 | ---------- |
| 1487 | obs : int, float, or :py:class:`ndarray <numpy.ndarray>` as returned by ``env.step(action)`` |
| 1488 | An observation from the environment. |
| 1489 | |
| 1490 | Returns |
| 1491 | ------- |
| 1492 | action : int, float, or :py:class:`ndarray <numpy.ndarray>` |
| 1493 | An action sampled from the distribution over actions defined by the |
| 1494 | epsilon-soft policy. |
| 1495 | """ # noqa: E501 |
| 1496 | s = self._obs2num[obs] |
| 1497 | return self.behavior_policy(s) |
| 1498 | |
| 1499 | def _epsilon_soft_policy(self, s, a=None): |
| 1500 | """ |