This project contains the code accompanying the paper "Modeling Human Driver Behavior During Highway Merging Using the Communication-Enabled Interaction Framework" by Olger Siebinga, Samir H.A. Mohammad, and Arkady Zgonnikov. This software was created to model interactive driving behavior between two human drivers in a highway merging scenario. The model is based on the Communication-Enable Interaction framework. This repository includes code to execute simulate a merging interaction and playback and evaluate the published data. The data that was gathered for the publication can be found here.
This repository is derived from https://github.com/tud-hri/simple-merging-experiment
, https://github.com/tud-hri/cei-model
, and https://github.com/tud-hri/sidewalk-simulation
.
The main project folder contains four run-scripts: simulate_single_trial_offline.py
, simulate_gap_velocity_grid.py
, playback.py
, and plot_single_trial.py
. The script simulate_gap_velocity_grid.py
script will replicate the experiment as described in the paper. It will use multiprocessing
to simulate 900 trials, 100 for the 9 different conditions described in the paper.
simulate_single_trial_offline.py
will run a single simulation. Please make changes to the file to change the (initial) conditions. The output is saved in a pickle file in the data folder. The playback.py
script can be used to replay a trial of the experiment. Select which trial to load by changing the file name in the script’s main block. The plot_single_trial.py
script can be used to gain more insight into the recorded data.
All modules will be briefly outlined here.
The agents
module contains classes that can be used to provide input to the vehicles. The name agents
is derived from AI terminology, where every decision-maker is considered an agent. The module contains a base class and one agent implementation: the CEI agent described in the paper.
The controllableobjects
module contains the dynamical models of controllable objects. In this work, only a bicycle model is used. This bicycle model can be controlled with continuous acceleration, deceleration and steering inputs. Where the first two are normalized between 0-1 and the steering angle ranges from -1 to 1. It is possible to enable resistance (rolling resistance and drag) but in this work these have been disabled for simplicity.
The design_tools
module contains scripts which were used to develop the model. These scripts provide insight into the design of the risk, reward, and belief functions.
The evaluate
module contains scripts to replicate all results published in the paper, including all plots and regression results.
All files related to the graphical user interfaces are located in the GUI module. All GUI files are made with pyqt. There are one main GUI in the project: simulation_gui
. This is the user interface that is used when recorded data is played back. The GUI module also contains some widgets that are used to display specific information. They should be self-explanatory.
The simulation module contains two classes that are used when running the simulation (experiment). The simmasters take care of the clock. These classes contain the loop in which all update functions are called. The normal SimMaster class runs the experiment while the PlaybackMaster is used when replaying a recorded trial. The simmasters are also used for saving the experiment data and status. To initialize all data storage, the simmasters have a maximum run time. If this maximum time is exceeded, the simulation will automatically stop.
The SimulationConstants
class can be used to create simple data objects that hold the parameters of the simulation. These are the dimensions of the track and the vehicles, and the timing parameters.
The trackobjects
module contains the definition of the track. In this work, the realistic merging track is used. This track consists of a variable number of lanes of which the first is always the merge lane.