# Rollouts

To generate rollouts for any of the registered environments run:

```bash
$ python -m sdriving.scripts.rollout --help
```

The configurable parameters are listed below:

```bash
usage: rollout.py [-h] -s SAVE_DIR [-m MODEL_SAVE_PATH]
                  [-tep NUM_TEST_EPISODES] --env ENV [--env-kwargs ENV_KWARGS]
                  [--model-type {one_step,two_step,None}] [--no-render] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -s SAVE_DIR, --save-dir SAVE_DIR
  -m MODEL_SAVE_PATH, --model-save-path MODEL_SAVE_PATH
  -tep NUM_TEST_EPISODES, --num-test-episodes NUM_TEST_EPISODES
  --env ENV
  --env-kwargs ENV_KWARGS
  --model-type {one_step,two_step,None}
  --no-render
  -v, --verbose
```

To test the proper functioning of an environment a good check is to generate a rollout for the same without passing any pretrained model. This will simulate the environment by sampling random actions from the action space. Even though this is not an exhaustive test and the training can still fail, it ensures that the pipeline for sampling environment observations and the episode rollout strategy used in the trainer works properly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avikpal.gitbook.io/social-driving/scripts/rollouts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
