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)
| 640 | break |
| 641 | |
| 642 | def act(self, obs): |
| 643 | r""" |
| 644 | Execute the behavior policy--an :math:`\epsilon`-soft policy used to |
| 645 | generate actions during training. |
| 646 | |
| 647 | Parameters |
| 648 | ---------- |
| 649 | obs : int, float, or :py:class:`ndarray <numpy.ndarray>` as returned by ``env.step(action)`` |
| 650 | An observation from the environment. |
| 651 | |
| 652 | Returns |
| 653 | ------- |
| 654 | action : int, float, or :py:class:`ndarray <numpy.ndarray>` |
| 655 | An action sampled from the distribution over actions defined by the |
| 656 | epsilon-soft policy. |
| 657 | """ # noqa: E501 |
| 658 | s = self._obs2num[obs] |
| 659 | return self.behavior_policy(s) |
| 660 | |
| 661 | def run_episode(self, max_steps, render=False): |
| 662 | """ |