class_docstr: Wheel bandit environment for 2D contexts
  (see https://arxiv.org/abs/1802.09127).
class_docstr_tok: ["Wheel","bandit","environment","for","2D","contexts","(","see","https",":","\/\/arxiv.org\/abs\/1802.09127",")","."]
code: def step(self, action):
      assert (
          self._elapsed_steps is not None
      ), "Cannot call env.step() before calling reset()"
  
      action = int(action)
      self._elapsed_steps += 1
      rewards = [
          np.random.normal(self.means[j], self.std)
          for j in range(self.num_actions)
      ]
      context = self._current_context
      r_big = np.random.normal(self.mu_3, self.std)
  
      if np.linalg.norm(context) >= self.delta:
          if context[0] > 0:
              if context[1] > 0:
                  # First quadrant
                  rewards[1] = r_big
                  opt_action = 1
              else:
                  # Fourth quadrant
                  rewards[4] = r_big
                  opt_action = 4
          else:
              if context[1] > 0:
                  # Second quadrant
                  rewards[2] = r_big
                  opt_action = 2
              else:
                  # Third quadrant
                  rewards[3] = r_big
                  opt_action = 3
      else:
          # Smaller region where action 0 is optimal
          opt_action = 0
  
      reward = rewards[action]
  
      regret = rewards[opt_action] - reward
  
      self._current_context = self._sample_context()
      return (
          self._current_context,
          reward,
          True,
          False,
          {"regret": regret, "opt_action": opt_action},
      )
  
imports: import copy
  import random
  import gymnasium
  import numpy
  from gymnasium.spaces import Box, Discrete
label_desc: Use image node_id 4 for calling the WheelBanditEnv obj's underlying member method code with example usage: obj.step(action) and returns: self,  reward,  True,  False,  dict