ray.rllib.env.single_agent_episode.SingleAgentEpisode.__len__#

SingleAgentEpisode.__len__() int[source]#

Returning the length of an episode.

The length of an episode is defined by the length of its data, excluding the lookback buffer data. The length is the number of timesteps an agent has stepped through an environment thus far.

The length is 0 in case of an episode whose env has NOT been reset yet, but also 0 right after the env.reset() data has been added via self.add_env_reset(). Only after the first call to env.step() (and self.add_env_step(), the length will be 1.

Returns:

An integer, defining the length of an episode.