# tinker_cookbook.rl.TrajectoryGroup ## *class* [**tinker_cookbook.rl.TrajectoryGroup**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/types.py#L400)() A group of trajectories produced by one [`EnvGroupBuilder`](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/envgroupbuilder/index.md). Created by the rollout executor after running all environments in a group and computing group rewards. This is the primary data structure consumed by RL training algorithms. The `_G` suffix follows the project convention for tensors/lists indexed over the group dimension. **Fields:** - [**trajectories_G**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/types.py#L421) (*list\[[Trajectory](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/trajectory/index.md)\]*) - [**final_rewards_G**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/types.py#L422) (*list[float]*) – computed by the EnvGroupBuilder, looking at whole group - [**metrics_G**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/types.py#L423) (*list[Metrics]*) - [**rollout_errors**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/types.py#L427) (*list\[[RolloutError](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/rollouterror/index.md)\]*, default: `field(default_factory=list)`) – Empty list means no trajectory errors occurred. ### [**get_total_rewards**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/rl/types.py#L429)() Get the total reward (return) for each trajectory in the group. The total reward is the sum of the per-timestep rewards (from `Env.step`) plus the final group reward (from `EnvGroupBuilder.compute_group_rewards`). **Returns:** *list[float]* – Total rewards, one per trajectory in the group. ## Referenced by - [tinker_cookbook.rl.assemble_training_data](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/assemble_training_data/index.md) - [tinker_cookbook.rl.compute_advantages](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/compute_advantages/index.md) - [tinker_cookbook.rl.RolloutError](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/rl/rollouterror/index.md)