Skip to content

This repository offers code to repeat experiments and reuse the method in the study "Inferring vehicle spacing in urban traffic from trajectory data".

License

Notifications You must be signed in to change notification settings

Yiru-Jiao/DriverSpaceInference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inferring vehicle spacing in urban traffic from trajectory data

This study is published in the journal "Transportation Research Part C: Emerging Technologies" with gold open access, available at https://doi.org/10.1016/j.trc.2023.104289.

Highlights

  • A method to infer average 2D vehicle spacing from trajectory data is proposed.
  • A perspective on the relative movement between interacting vehicles is taken.
  • Empirical relations between average 2D spacing and relative speeds are identified.
  • The empirical relations are termed as interaction Fundamental Diagrams (iFDs).
  • iFDs describe the variation in required space for vehicle interactions.

In order to reuse the coordinate transformation into a relative movement system

Please refer to coortrans.py in the GSSM repository for a ready-to-use class.

In order to repeat the experiments:

Dependencies

tqdm, numpy, pandas, scipy, pyproj=3.2.0, joblib, matplotlib, shapely, scikit-learn

Data

Raw data can be downloaded from https://open-traffic.epfl.ch/index.php/downloads/ and saved in the folder ./RawDatasets/.

Resulting data, i.e., a zipped file of the ./OutputData/ folder, can be downloaded from https://doi.org/10.4121/8cadc255-5fd8-46ab-893a-64b76ca7b7f9.

Step-by-step instructions

Step 1. Run ./Code/Preprocessing.py to preprocess the rawdata.

Step 2. Use ./Code/IntersectionDetection.py and ./Code/IntersectionData.ipynb to identify and select intersections in the pNEUMA dataset.

Step 3. Run ./Code/Sampling_exp1-2.py, ./Code/Sampling_exp3.ipynb, and ./Code/Sampling_exp4.py to transform coordinates and sample vehicle pairs for different experiments.

Step 4. Run ./Code/Experiments.py to repeat our experiments in the article.

* ./Code/DriverSpaceInference.py is the library including classes and functions for the experiments

* We run the experiments in Linux with a cluster of CPUs. To be run on other OSs may need adjustments regarding the number of cores for parallel processing.

In order to apply the method to another dataset:

Step 1. Save raw data in the folder ./RawDatasets/.

Step 2. Create code to align the format of the new dataset to the format of the data to be saved in the folder ./InputData/.

Step 3. Design your application according to the code in ./Code/Experiments.py.

Citation

@article{Jiao2023,
  doi = {10.1016/j.trc.2023.104289},
  year = {2023},
  volume = {155},
  pages = {104289},
  author = {Yiru Jiao and Simeon C. Calvert and Sander {van Cranenburgh} and Hans {van Lint}},
  title = {Inferring vehicle spacing in urban traffic from trajectory data},
  journal = {Transportation Research Part C: Emerging Technologies}
}

About

This repository offers code to repeat experiments and reuse the method in the study "Inferring vehicle spacing in urban traffic from trajectory data".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published