# How to tell RLLIB trainer (Not Tune) to run that many number of episodes

**URL:** <https://discuss.ray.io/t/how-to-tell-rllib-trainer-not-tune-to-run-that-many-number-of-episodes/3323>\
**Category:** RLlib\
**Created:** [August 23, 2021, 6:31pm UTC](https://discuss.ray.io/t/how-to-tell-rllib-trainer-not-tune-to-run-that-many-number-of-episodes/3323 "2021-08-23T18:31:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [August 24, 2021, 7:44am UTC](https://discuss.ray.io/t/how-to-tell-rllib-trainer-not-tune-to-run-that-many-number-of-episodes/3323/2 "2021-08-24T07:44:08Z")

</div>

Hi @Arif_Jahangir and welcome to the forum,

your question depends on your setup, i.e. are you using in your `config` `"batch_mode"="complete_episodes"` or `"batch_mode"="truncate_episodes"` (see [here](https://docs.ray.io/en/master/rllib-training.html#common-parameters) for a list of all configuration parameters)?

The number of episodes depends on multiple parameters: `"batch_mode"="complete_episodes"` would collect in a single batch only complete episodes, while `"truncate_episodes"` would mean that episodes can be truncated and where they get truncated depends on the configuration parameter `"rollout_fragment_length"` and the parameter `"count_steps_by"`.

That said, your episodes might take many many steps through the environment until an episode ends - so configuration parameters should fit your experiment well. I suggest you to read the RLlib documentation about [Sample Collection](https://docs.ray.io/en/master/rllib-sample-collection.html) where you find good information about how episodes get collected and what to think about when choosing corresponding configuration parameters.

See also [this discussion](https://discuss.ray.io/t/rllib-batch-size-interpretation-when-training-multiple-policies/637) for understanding environment and agent steps.

Best,  
Simon

---

_[View the full topic](https://discuss.ray.io/t/how-to-tell-rllib-trainer-not-tune-to-run-that-many-number-of-episodes/3323)._
