# How do I set seed (randomize) for each rollout (for a given environment, worker and vector environment)?

**URL:** <https://discuss.ray.io/t/how-do-i-set-seed-randomize-for-each-rollout-for-a-given-environment-worker-and-vector-environment/11962>\
**Category:** RLlib\
**Created:** [August 28, 2023, 3:18pm UTC](https://discuss.ray.io/t/how-do-i-set-seed-randomize-for-each-rollout-for-a-given-environment-worker-and-vector-environment/11962 "2023-08-28T15:18:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![omsrisagar](https://avatars.discourse-cdn.com/v4/letter/o/91b2a8/32.png) [@omsrisagar](https://discuss.ray.io/u/omsrisagar)\
**Post date:** [August 28, 2023, 3:18pm UTC](https://discuss.ray.io/t/how-do-i-set-seed-randomize-for-each-rollout-for-a-given-environment-worker-and-vector-environment/11962/1 "2023-08-28T15:18:13Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

I know how to set a seed for a given environment, worker, vector\_environment. What this does is, the same seed is used for all the training iterations and all the rollouts within that training iteration. So if you have 3 rollouts per iteration and 10 training iterations - all 3x10 = 30 rollouts use the same seed. Please advise how do I randomize i.e., set a specific seed for each of the above rollouts (episodes)? The reason is that I would like to randomize the initialization of my environment (placement/assignment of agents in multi-agent environment) for each rollout/episode.
