Building applications based on processed data#
Typical scenario#
Aggregate the traffic index data by intersection, corridor, or region;
Develop signal control algorithm;
Design signal offline signal plan;
Step 1: Create the configure file for your application#
The command line tool create_config_file
can create the
configuration file with arguments, which is provided by mtldp-utils
and is automatically installed when installing the library:
(mtldp) $ create_config_file --help
You can also create the configuration file by using this script
interactively. Notice that the value in the square brackets is the
default value, you can apply them by hitting the Enter
key.
(mtldp) $ create_config_file
(mtldp) $ Region ID: my_region
(mtldp) $ ...
Once you create the configuration file successfully, you will see this in the console:
Configuration file generated at: "configs/my_region.json"
Step 3: Download the processed data as input for your application#
Please contact henryliu@umich.edu to get the Google Drive download link to the processed data.
For the different types of data, they should be unzipped and put into the corresponding directory, and merge with the existing empty directory.
Step 4: Init the region and load data#
You can initialize your own region load data as input in your Python code:
from mtldp.utils.config import AppRegion
def main():
# date of interest
date_str_list = sorted([...])
# junction of interest
junction_id_list = [...]
my_region = AppRegion('configs/my_region.json')
my_region.load_traffic_network()
my_region.region.load_spat(start_date_str=date_str_list[0])
my_region.load_trajs(date_str_list, junction_id_list)
print(my_region.network, my_region.trajs_dict, my_region.spat)