# Action Recorder

This extends the functionality of the rollouts script by recording the actions and various other statistics of the environments as described [here](https://github.com/fidler-lab/social-driving/blob/master/sdriving/scripts/action_recorder.py#L20-L88). To use it see:

```
python -m sdriving.scripts.action_recorder --help
```

The configurable parameters for this script are

```
usage: action_recorder.py [-h] -s SAVE_DIR -f FNAME [-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
  -f FNAME, --fname FNAME
  -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
```

This script takes the same arguments as `rollout.py` and an additional argument `-f` which is the path to a `csv` file for saving the records.


---

# 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/action-recorder.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.
