class_docstr: Implements an exploration strategy for Policies.
  
  An Exploration takes model outputs, a distribution, and a timestep from
  the agent and computes an action to apply to the environment using an
  implemented exploration schema.
class_docstr_tok: ["Implements","an","exploration","strategy","for","Policies",".","An","Exploration","takes","model","outputs",",","a","distribution",",","and","a","timestep","from","the","agent","and","computes","an","action","to","apply","to","the","environment","using","an","implemented","exploration","schema","."]
docstr: Args:
      action_space: The action space in which to explore.
      framework: One of "tf" or "torch".
      policy_config: The Policy's config dict.
      model: The Policy's model.
      num_workers: The overall number of workers used.
      worker_index: The index of the worker using this class.
docstr_tok: ["Args",":","action_space",":","The","action","space","in","which","to","explore",".","framework",":","One","of","``","tf","''","or","``","torch","''",".","policy_config",":","The","Policy","'s","config","dict",".","model",":","The","Policy","'s","model",".","num_workers",":","The","overall","number","of","workers","used",".","worker_index",":","The","index","of","the","worker","using","this","class","."]
code: def __init__(
      self,
      action_space: Space,
      *,
      framework: str,
      policy_config: AlgorithmConfigDict,
      model: ModelV2,
      num_workers: int,
      worker_index: int,
  ):
      """
      Args:
          action_space: The action space in which to explore.
          framework: One of "tf" or "torch".
          policy_config: The Policy's config dict.
          model: The Policy's model.
          num_workers: The overall number of workers used.
          worker_index: The index of the worker using this class.
      """
      self.action_space = action_space
      self.policy_config = policy_config
      self.model = model
      self.num_workers = num_workers
      self.worker_index = worker_index
      self.framework = framework
      # The device on which the Model has been placed.
      # This Exploration will be on the same device.
      self.device = None
      if isinstance(self.model, nn.Module):
          params = list(self.model.parameters())
          if params:
              self.device = params[0].device
  
file_path: ray/rllib/utils/exploration/exploration.py
imports: from gymnasium.spaces import Space
  from typing import Dict, List, Optional, Union, TYPE_CHECKING
  from ray.rllib.env.base_env import BaseEnv
  from ray.rllib.models.action_dist import ActionDistribution
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import DeveloperAPI, PublicAPI
  from ray.rllib.utils.framework import try_import_torch, TensorType
  from ray.rllib.utils.typing import LocalOptimizer, AlgorithmConfigDict
label_desc: Use image node_id 1 to create a new Exploration object  with example: obj = Exploration(action_space)