class_docstr: Implementation of the epsilon-greedy policy.
code: def _action(
      self,
      time_step,
      policy_state=(),
      seed: Optional[types.Seed] = None,
  ):
      if seed is not None:
          raise NotImplementedError(
              "seed is not supported; but saw seed: {}".format(seed)
          )
      self._count += 1
      # _random_function()'s range should be [0, 1), so if epsilon is 1,
      # we should always use random policy, and if epislon is 0, it
      # should always use greedy_policy since the if condition won't be
      # met.
      if self._random_function() < self._get_epsilon():
          # Avoid mixing policy_state from greedy_policy and random_policy,
          # always return policy_state from greedy_policy.
          action_step = self._random_policy.action(time_step)
          return policy_step.PolicyStep(
              action_step.action, policy_state
          )
      else:
          return self._greedy_policy.action(
              time_step, policy_state=policy_state
          )
  
file_path: agents/tf_agents/policies/py_epsilon_greedy_policy.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional
  import numpy
  from tf_agents.policies import py_policy
  from tf_agents.policies import random_py_policy
  from tf_agents.trajectories import policy_step
  from tf_agents.typing import types
label_desc: Use image node_id 5 for calling the EpsilonGreedyPolicy obj's underlying member method code with example usage: obj._action(time_step, policy_state, seed) and returns: policy_step, self