ray.rllib.utils.exploration.random.Random#

class ray.rllib.utils.exploration.random.Random(action_space: gymnasium.spaces.Space, *, model: ModelV2, framework: str | None, **kwargs)[source]#

Bases: Exploration

A random action selector (deterministic/greedy for explore=False).

If explore=True, returns actions randomly from self.action_space (via Space.sample()). If explore=False, returns the greedy/max-likelihood action.

Methods

__init__

Initialize a Random Exploration object.

before_compute_actions

Hook for preparations before policy.compute_actions() is called.

get_exploration_optimizer

May add optimizer(s) to the Policy's own optimizers.

get_state

Returns the current exploration state.

on_episode_end

Handles necessary exploration logic at the end of an episode.

on_episode_start

Handles necessary exploration logic at the beginning of an episode.

postprocess_trajectory

Handles post-processing of done episode trajectories.

set_state

Sets the Exploration object's state to the given values.