# tinker_cookbook.rl.RolloutStrategy ## *class* [**tinker_cookbook.rl.RolloutStrategy**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/rollout_strategy.py#L49)(*ABC*) Controls how trajectories are collected from a group of environments. Subclasses implement `execute` which receives the [`EnvGroupBuilder`](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/envgroupbuilder/index.md) and a policy, creates envs, runs rollouts, and returns the surviving trajectories plus any error info. Implementations must be pickleable — use `@dataclass(frozen=True)` with only primitive fields. ### *property* [**catches_group_errors**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/rollout_strategy.py#L61) If True, group-level errors (`make_envs`, `compute_group_rewards`) are caught and the group is skipped. If False, they propagate. **Returns:** *bool* ### [**execute**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/rollout_strategy.py#L67)(*env_group_builder*, *policy*) Create envs, run rollouts, and return results. May raise on unrecoverable errors (e.g. retry budget exhausted). The caller (`do_group_rollout`) handles group-level error recovery based on `catches_group_errors`. **Parameters:** - [**env_group_builder**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/rollout_strategy.py#L69) (*[EnvGroupBuilder](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/envgroupbuilder/index.md)*) – Builder used to create the environments for this rollout group. - [**policy**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/rollout_strategy.py#L70) (*[TokenCompleter](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/completers/tokencompleter/index.md)*) – The policy (language model) used to generate actions during rollouts. **Returns:** *RolloutResult* – The collected trajectories, surviving environments, and any errors encountered. *Abstract method.* ## Referenced by - [tinker_cookbook.rl.FailFast](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/failfast/index.md) - [tinker_cookbook.rl.RetryOnFailure](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/retryonfailure/index.md)