This repository demonstrates the use of GFlowNet to generate adversarial driving maneuvers within traffic simulations, illustrated through integrations with Gymnasium, a MetaDrive PPO agent, and Openpilot.

To run the experiments, follow the steps below:

1. Create a new Python environment with requirements.txt. 

2. To use Openpilot, one needs to contact the authors of Acero (https://www.usenix.org/conference/usenixsecurity23/presentation/song) to obtain the openpilot_client docker image.

   For other environments, one can run "python train.py -m gfn -s meta --seed 10 -t 10000", note when running use metadrive, the successful attacks would be recorded in the saved_demos folder.

