class_docstr: Optimal RLlib policy for the CliffWalkingWallEnv environment, defined in
  ray/rllib/examples/env/cliff_walking_wall_env.py, with epsilon-greedy exploration.
  
  The policy takes a random action with probability epsilon, specified
  by `config["epsilon"]`, and the optimal action with probability  1 - epsilon.
class_docstr_tok: ["Optimal","RLlib","policy","for","the","CliffWalkingWallEnv","environment",",","defined","in","ray\/rllib\/examples\/env\/cliff_walking_wall_env.py",",","with","epsilon-greedy","exploration",".","The","policy","takes","a","random","action","with","probability","epsilon",",","specified","by","`","config","[","``","epsilon","''","]","`",",","and","the","optimal","action","with","probability","1","-","epsilon","."]
code: def compute_actions(
      self,
      obs_batch: Union[List[TensorStructType], TensorStructType],
      state_batches: Optional[List[TensorType]] = None,
      **kwargs,
  ) -> Tuple[TensorType, List[TensorType], Dict[str, TensorType]]:
      obs = np.array(obs_batch, dtype=int)
      action_probs = self.action_dist[obs]
      actions = np.zeros(len(obs), dtype=int)
      for i in range(len(obs)):
          actions[i] = np.random.choice(4, p=action_probs[i])
      return (
          actions,
          [],
          {
              SampleBatch.ACTION_PROB: action_probs[
                  np.arange(len(obs)), actions
              ]
          },
      )
  
file_path: ray/python/ray/rllib/examples/policy/cliff_walking_wall_policy.py
imports: import gymnasium
  from typing import Dict, Union, List, Tuple, Optional
  import numpy
  from ray.rllib.policy.policy import Policy, ViewRequirement
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.models.torch.torch_action_dist import TorchCategorical
  from ray.rllib.utils.typing import AlgorithmConfigDict, TensorStructType, TensorType
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.debug import update_global_seed_if_necessary
label_desc: Use image node_id 2 for calling the CliffWalkingWallPolicy obj's underlying member method code with example usage: obj.compute_actions(obs_batch, state_batches) and returns: actions,  list,  dict