README.md 2.85 KB
Newer Older
Duncan D.'s avatar
Duncan D. committed
1 2
# rounD_risk

Duncan Deveaux's avatar
Duncan Deveaux committed
3 4 5 6
Estimation of the relationship between the variation of TTC in an area and the amount of associated risk.

# How to use

Duncan Deveaux's avatar
Duncan Deveaux committed
7
  * To use the provided code, `ROUND_PATH = "path/to/round/data/"` should be replaced with the path to your local copy of the rounD dataset in the [topology.py](topology.py) file.
Duncan Deveaux's avatar
Duncan Deveaux committed
8 9 10 11

The provided TTC analysis code is a tool to assess the variation of TTC in roundabouts of the rounD dataset, as well as risk, and investigate on correlation between these two units.
The provided files should be run in the following order:

Duncan Deveaux's avatar
Duncan Deveaux committed
12 13 14
  * [visualization.py](visualization.py): Provide tools to visualize the tracks of all vehicles from a given tracks file. As well as a tool to replay the tracks frame by frame.
  * [parse.py](parse.py): Parses the provided tracks files (all from a single Location ID) to augment the tracks with TTC data.
  * [analysis.py](analysis.py): Uses the TTC-augmented tracks generated by the [parse.py](parse.py) file to study correlation between TTC variation and risk.
Duncan Deveaux's avatar
Duncan Deveaux committed
15 16 17 18 19 20 21

# How to add locations

For the moment, support for the location of ID 0 is provided.
In order to add new locations to the study, the following process should be followed:

  1. A Topology description has to be generated for the wanted location ID. The Topology description is a simple class instance which indicates the center point of the roundabout. It also provides a list of circular lanes that the roundabout contains.
Duncan Deveaux's avatar
Duncan Deveaux committed
22
     1. In order to define the Topology object, please refer to the comments and tools in the [visualization.py](visualization.py) file.
Duncan Deveaux's avatar
Duncan Deveaux committed
23 24 25 26
         * Replace the `input_file`, `input_meta_file` and `input_recordingMeta_file` with a tracks file of the wanted location ID.
         * A plot of all tracks of the file will appear. Use it to choose the center point of the roundabout and the distance of lanes to the center of the roundabouts.
         * Each lane should be 2.25meters long, see [topology.py](topology.py) for a simple example of a topology for Location 0.
         * Play with the `topology` object in line 85 of [visualization.py](visualization.py) until the generated blue lanes accurately wrap the tracks.
Duncan Deveaux's avatar
Duncan Deveaux committed
27
         
Duncan Deveaux's avatar
Duncan Deveaux committed
28
<br/>
Duncan Deveaux's avatar
Duncan Deveaux committed
29

Duncan Deveaux's avatar
Duncan Deveaux committed
30
  2. Use the [parse.py](parse.py) file to generate TTC-augmented data for the wanted location.
Duncan Deveaux's avatar
Duncan Deveaux committed
31 32 33
     1. Replace the `input_ids` variable with a list of all tracks id of the wanted location.
     2. **Do replace the `topology` object on line 73 with the new topology you generated in the first step.**
     3. Upon running the updated script, TTC-augmented data will be generated in a newly created ttc_parse/ directory.
Duncan Deveaux's avatar
Duncan Deveaux committed
34
     
Duncan Deveaux's avatar
Duncan Deveaux committed
35
<br/>
Duncan Deveaux's avatar
Duncan Deveaux committed
36

Duncan Deveaux's avatar
Duncan Deveaux committed
37
  3. Use the [analysis.py](analysis.py) file to generate the scatter plots and correlation analysis between the variation of TTC values and the amount of risk.
Duncan Deveaux's avatar
Duncan Deveaux committed
38 39
     1. Replace the `input_ids` variable with the list of all tracks id of the wanted location.
     2. Run the script to see the plotted results!