ray.rllib.algorithms.algorithm_config.AlgorithmConfig.get_rollout_fragment_length#

AlgorithmConfig.get_rollout_fragment_length(worker_index: int = 0) int[source]#

Automatically infers a proper rollout_fragment_length setting if “auto”.

Uses the simple formula: rollout_fragment_length = train_batch_size / (num_envs_per_worker * num_rollout_workers)

If result is not a fraction AND worker_index is provided, will make those workers add another timestep, such that the overall batch size (across the workers) will add up to exactly the train_batch_size.

Returns:

The user-provided rollout_fragment_length or a computed one (if user value is “auto”).