Note
Ray 2.40 uses RLlib’s new API stack by default. The Ray team has mostly completed transitioning algorithms, example scripts, and documentation to the new code base.
If you’re still using the old API stack, see New API stack migration guide for details on how to migrate.
SingleAgentEpisode API#
rllib.env.single_agent_episode.SingleAgentEpisode#
Constructor#
A class representing RL environment episodes for individual agents. |
|
Validates the episode's data. |
Getting basic information#
Returning the length of an episode. |
|
Calculates an episode's return, excluding the lookback buffer's rewards. |
|
Returns the duration of this Episode (chunk) in seconds. |
|
Whether the episode is actually done (terminated or truncated). |
|
True, if the data in this episode is already stored as numpy arrays. |
|
Returns the number of environment steps. |
Getting environment data#
Returns individual observations or batched ranges thereof from this episode. |
|
Returns individual info dicts or list (ranges) thereof from this episode. |
|
Returns individual actions or batched ranges thereof from this episode. |
|
Returns individual rewards or batched ranges thereof from this episode. |
|
Returns extra model outputs (under given key) from this episode. |
|
Returns all temporarily stored data items (list) under the given key. |
Adding data#
Adds the initial data (after an |
|
Adds results of an |
|
Temporarily adds (until |
Creating and handling episode chunks#
Returns a successor episode chunk (of len=0) continuing from this Episode. |
|
Returns a slice of this episode with the given slice object. |
|
Adds the given |
|
Converts this Episode's list attributes to numpy arrays. |