> 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/master.md).

# Social Driving

Design multi-agent environments and simple reward functions such that social driving behavior emerges

![Snapshot of 7 agents in a nuScenes Intersection](https://3130025199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJSWArJeUGkoad_pu7m%2F-MKKXiagdwDQJJMXa5VD%2F-MKKYQ2qPRdks5-ZJIEQ%2Fteaser.png?alt=media\&token=89f7ef96-a71e-43b7-95b5-2407f3e9224e)

## Installation

Create a new Conda environment

```
$ conda create --name sdriving python=3.8
$ conda activate sdriving
```

Follow the instructions given [here](https://pytorch.org/get-started/locally/) to install PyTorch. Install PyTorch version `1.5.2` or `1.7` if you want to use JIT compilation which speeds up the code by roughly 1.5-2x.

Install the [Nuscenes DevKit](https://github.com/nutonomy/nuscenes-devkit/) for access to realistic simulation environments. Use the master branch instead of the pip version. Additionally, download the map expansion pack.

Finally, install sdriving using the following instructions.

```
$ git clone https://github.com/fidler-lab/social-driving.git sdriving
$ cd sdriving
$ python setup.py develop
```

If you need to train an agent, some additional configuration is needed. You can skip these steps if you are only interested in generating rollouts / don't care about logging on the server (using `WANDB_MODE=dryrun`).

1. Create a Wandb account using `wandb login` and following the steps given there.
2. A project named `social-driving` will be automatically created. If anything goes wrong here please open an issue.
