-
Notifications
You must be signed in to change notification settings - Fork 22
/
data.py
53 lines (46 loc) · 1.16 KB
/
data.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
""" SAMPLE
In this file you can find sample data which could be used
into the TrafficFlowMod class in model.py file
"""
# Graph represented by directed dictionary
# In order: first ("5", "7"), second ("5", "9"), third ("6", "7")...
graph = [
("5", ["7", "9"]),
("6", ["7", "8"]),
("7", ["8", "10"]),
("8", ["11", "12"]),
("9", ["10", "16"]),
("10", ["11", "13"]),
("11", ["14"]),
("12", ["15"]),
("13", ["14", "16"]),
("14", ["15", "17"]),
("15", []),
("16", ["17"]),
("17", [])
]
# Capacity of each link (Conjugated to Graph with order)
# Here all the 19 links have the same capacity
capacity = [3600] * 19
# Free travel time of each link (Conjugated to Graph with order)
free_time = [
10, 10,
10, 14.1,
10, 10,
10, 14.1,
10, 22.4,
10, 10,
10,
10,
10, 10,
10, 10,
10
]
# Origin-destination pairs
origins = ["5", "6"]
destinations = ["15", "17"]
# Generated ordered OD pairs:
# first ("5", "15"), second ("5", "17"), third ("6", "15")...
# Demand between each OD pair (Conjugated to the Cartesian
# product of Origins and destinations with order)
demand = [6000, 6750, 7500, 5250]