-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
53 lines (45 loc) · 2.96 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
''' * This file defines addresses to all data files, input files and output files.
* It also lists all the Global variables used in Non-Negative Matrix Factorization.
* In case any of the Factorization paramaters need to be changed, they should be changed in this file instead of locally within each program.'''
def generate_filenames(path, path_for_data=None):
if path_for_data is None:
path_for_data = path
filenames = {# Raw data files
'links': path + 'links.csv',
'nodes': path + 'nodes.csv',
'raw_data': path_for_data + 'travel_times_2011.csv',
'data_coo_form': path_for_data + 'data_coo_form.txt',
'data_trips': path_for_data + 'data_trips.csv',
'data_traveltimes': path_for_data + 'data_travel_times.csv',
'data_trips_transpose': path_for_data + 'data_trips_transpose.csv',
# Inputs and Outputs of Read_data.py
'full_link_ids': path + 'full_link_ids.txt',
'empty_link_ids': path + 'empty_link_ids.txt',
'full_link_trips': path + 'full_link_trips.json',
'full_link_traveltimes': path + 'full_link_travel_times.json',
'full_link_speeds': path + 'full_link_speeds.json',
# Inputs and Outputs of Phase1.py
'random': path + 'Random_numbers.txt',
'W_trips': path + 'W_trips.csv',
'W_speeds': path + 'W_speeds.csv',
'W_trips_seed': path + 'Seeded0,1/W_trips.csv',
'W_speeds_seed': path + 'Seeded0,1/W_speeds.csv',
'H_trips': path + 'H_trips.csv',
'H_speeds': path + 'H_speeds.csv',
'H_trips_seed': path + 'Seeded0,1/H_trips.csv',
'H_speeds_seed': path + 'Seeded0,1/H_speeds.csv',
'H_trips_axed': path + 'H_trips_axed.csv',
'H_speeds_axed': path + 'H_speeds_axed.csv',
'H_trips_axed_seed': path + 'Seeded0,1/H_trips_axed.csv',
'W_speeds_axed_seed': path + 'Seeded0,1/H_speeds_axed.csv'}
return filenames
'''Global variables'''
RANK = 50 # Rank for Matrix Factorization in Phase1.py
TRIPS = 1 # Boolean variable: 0 reads travel_speeds data, 1 reads number_of_trips data.
HOURS_IN_YEAR = 8760 # 24*365
SEEDED = 1 # Boolean variable: 1 or 0 means Phase1.py is seeded or not respectively.
TOTAL_LINKS = 260855 # Total Links aka Road-segments in NYC.
FULL_LINKS = 2302 # Links with less than 720 hours worth of missing data in a year.
EMPTY_LINKS = 234892 # Links with less that 720 hours worth of data in a year.
MID_LINKS = 23661 # TOTAL_LINKS - FULL_LINKS - EMPTY_LINKS
assert MID_LINKS == TOTAL_LINKS - FULL_LINKS - EMPTY_LINKS