> For the complete documentation index, see [llms.txt](https://avikpal.gitbook.io/social-driving/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avikpal.gitbook.io/social-driving/scripts/action-recorder.md).

# Action Recorder

Register the actions of the agents for analyzing later

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.
