# Seed of envs while using multi works/vector envs

**URL:** <https://discuss.ray.io/t/seed-of-envs-while-using-multi-works-vector-envs/3965>\
**Category:** RLlib\
**Created:** [October 28, 2021, 3:28am UTC](https://discuss.ray.io/t/seed-of-envs-while-using-multi-works-vector-envs/3965 "2021-10-28T03:28:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yiwc](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yiwc/32/1665_2.png) [@yiwc](https://discuss.ray.io/u/yiwc)\
**Post date:** [October 28, 2021, 3:28am UTC](https://discuss.ray.io/t/seed-of-envs-while-using-multi-works-vector-envs/3965/1 "2021-10-28T03:28:27Z")

</div>

Dear RAY/RLLIB team, thanks for your amazing project!

I have a question about what’s your strategy to set envs seed? When I used num\_workers==10,num\_envs\_per\_worker==10, I found in each env, they have exactly the same seed. I don’t think that’s correct . Maybe I used it wrong way.

Any suggestion on how to best set seed for each envs? and make sure they are not the same?

Much Thanks!

---

<div class="post-metadata">

**Author:** ![albheim](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@albheim](https://discuss.ray.io/u/albheim)\
**Post date:** [October 28, 2021, 7:39am UTC](https://discuss.ray.io/t/seed-of-envs-while-using-multi-works-vector-envs/3965/2 "2021-10-28T07:39:53Z")

</div>

If the environment has a seed function it should be seeded by each individual worker with `seed + worker_id` in my understanding.

---

<div class="post-metadata">

**Author:** ![yiwc](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yiwc/32/1665_2.png) [@yiwc](https://discuss.ray.io/u/yiwc)\
**Post date:** [October 30, 2021, 3:47pm UTC](https://discuss.ray.io/t/seed-of-envs-while-using-multi-works-vector-envs/3965/3 "2021-10-30T15:47:40Z")

</div>

Yes Got it, Thanks much!
