# How I can generate the exactly same results in the rllib?

**URL:** <https://discuss.ray.io/t/how-i-can-generate-the-exactly-same-results-in-the-rllib/4217>\
**Category:** RLlib\
**Created:** [November 23, 2021, 2:25pm UTC](https://discuss.ray.io/t/how-i-can-generate-the-exactly-same-results-in-the-rllib/4217 "2021-11-23T14:25:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saeid93](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/saeid93/32/411_2.png) [@saeid93](https://discuss.ray.io/u/saeid93)\
**Post date:** [November 23, 2021, 2:25pm UTC](https://discuss.ray.io/t/how-i-can-generate-the-exactly-same-results-in-the-rllib/4217/1 "2021-11-23T14:25:14Z")

</div>

I want to reproduce the exact same results in my experiments with having the same learning seed for the environment and learning algorithm. I am using the PPO algorithm. I have tested my environment out of the learning cycle and I’m sure that it is totally generating the same observations and actions every time (given a ceratin seed). Therefore I am sure that the environment seeding implementation is correct. However, in the experiments, some of the training results (with exactly the same config and seed) generate similar results and some of them are not. How can I make sure I have everything to generate exact similar results.

---

<div class="post-metadata">

**Author:** ![Lars\_Simon\_Zehnder](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/lars_simon_zehnder/32/1185_2.png) [@Lars\_Simon\_Zehnder](https://discuss.ray.io/u/Lars_Simon_Zehnder)\
**Post date:** [November 23, 2021, 5:41pm UTC](https://discuss.ray.io/t/how-i-can-generate-the-exactly-same-results-in-the-rllib/4217/2 "2021-11-23T17:41:13Z")

</div>

Hi @saeid93 ,

you can use the `seed` hyperparameter in the `Trainer` configuration:

```auto
# This argument, in conjunction with worker_index, sets the random seed of
# each worker, so that identically configured trials will have identical
# results. This makes experiments reproducible.
"seed": None,

```

Set the seed to any positive integer value and you should get reproducible results. I would then also try to get rid of any seed setting inside of the environment.

Hope this helps
