-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathPrepHwyNet.job
200 lines (161 loc) · 8.37 KB
/
PrepHwyNet.job
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
; ----------------------------------------------------------------------------------------------------------------
;
; PrepHwyNet.job
;
; TP+ script does three things. First, it computes the bus travel time on every highway link by assuming a fixed
; delay (in minutes per mile), segmented by area type and facility type. Links with speeds below a very low
; minimum threshold are sped up to that minimum threshold to help the path builder find valid paths. This step
; also adds transit-only nodes to the highway network which are needed for the second and third steps in the script.
;
; Second, transit-only access links are added to the highway network. This is necessary for TP+ to
; automatically generate walk and drive access links.
;
; Third, and last, transit-only transfer links are added to the highway network. This is necessary for TP+
; to automatically generate transfer access links.
;
; The script first loops through the five time periods, which are: (a) early AM, 3 am to 6 am; (b) AM peak period,
; 6 am to 10 am; (c) midday, 10 am to 3 pm; (d) PM peak period, 3 pm to 7 pm; and, (e) evening, 7 pm to 3 am the next
; day.
;
; The facility type (FT) codes used by this script are as follows: (1) freeway-to-freeway connector; (2) freeway;
; (3) expressway; (4) collector; (5) freeway ramp; (6) dummy link; (7) major arterial; (8) metered ramp;
; (9) special facility.
;
; The area type (AT) codes used by this script are as follows: (0) regional core; (1) central business
; district (CBD); (2) urban business; (3) urban; (4) suburban; (5) rural.
;
; Input: (1) A highway network that contains the following variables: (i) PNROK, for which a code of 1 means
; the link can be used for park-and-ride connectors, a 0 means the link cannot
; (see CreateFiveHighwayNetworks.job); (ii) CTIM, which is the congested travel time (iii) FT,
; facility type, whose codes are described above; (iv) AT, area type, whose codes are described above;
; (v) DISTANCE, coded in miles.
;
; (2) Access link files, which connect transit-only infrastructure to the highway network; these files
; contain only an A-node and a B-node, where the A-node is on the highway network and the B-node is
; a walk-access-funnel link, meaning all walk-access links enter the transit-only infrastructure
; via this node, which allows for easier accounting of walk access usage.
;
; (3) Transfer link files, which allow bus users to transfer directly to transit-only infrastructure;
; these files contain an A-node, B-node, and a distance, in miles. The A-node is a point on the
; highway network (the point where the nearest bus stops) and the B-node is a stop on the transit-
; only infrastructure.
;
; Output: (1) A time-period-specific transit background network that contains transit-only nodes and the
; variables PNR_TIME, which is the park-and-ride drive access link time (big values allow us to
; disallow park-and-riding on certain bridges) and BUS_TIME, which is the speed buses travel
; on highway lanes;
;
; (2) The above network with transit access links included, as described above;
;
; (3) The network in (1) with transit transfer links included, as described above.
;
; Notes: (1)
;
; See also: (1) TransitSkims.job -- Uses the bus speeds computed here to estimate transit travel times
; (2) BuildTransitNetworks.job -- Creates the transit networks that are subsequently skimmed and assigned
; (3) CreateFiveHighwayNetworks.job -- Codes the PNROK variable on the network
;
; version: Travel Model One (v 0.3)
; authors: dto (2011 09 08); dto (2010 08 10); gde
;
;
; ----------------------------------------------------------------------------------------------------------------
; set the minimum speed below which links are written to SpeedErrors.log
token_minimum_speed = 3.0
token_minimum_speed_fwy = 6.0
; time period loop
loop period = 1, 5
; define a two-letter token for each time period
if (period = 1)
token_period = 'EA'
elseif (period = 2)
token_period = 'AM'
elseif (period = 3)
token_period = 'MD'
elseif (period = 4)
token_period = 'PM'
elseif (period = 5)
token_period = 'EV'
endif
; faster to do without distributing using cluster
*echo iter %ITER% > "%MODEL_DIR%\logs\SpeedErrors_@token_period@.log"
; compute bus travel times
run pgm = network
; use the same highway network used in the skimming
neti[1] = "%MODEL_DIR%\hwy\avgload@token_period@.net"
; output a time-period-specific transit background network
neto = @token_period@_transit_background.net
fileo printo[1] = "%MODEL_DIR%\logs\SpeedErrors_@token_period@.log" APPEND=T
; bus time is a function of highway time and delay per mile, segmented by area type and facility type
delayfactor = 0.0
; buses travel on freeway-to-freeway connectors, freeways, and expressways at the same speed as automobiles
if (FT = 1 | FT = 2 | FT = 3 | FT = 8)
; segment by area type to facility easy change in the future, if needed
if (AT = 0) delayfactor = 0.0
if (AT = 1) delayfactor = 0.0
if (AT = 2) delayfactor = 0.0
if (AT = 3) delayfactor = 0.0
if (AT = 4) delayfactor = 0.0
if (AT = 5) delayfactor = 0.0
; all other facilities get an area-type-specific delay factor
else
; delay is minutes per mile
if (AT = 0) delayfactor = 2.46
if (AT = 1) delayfactor = 2.46
if (AT = 2) delayfactor = 1.74
if (AT = 3) delayfactor = 1.74
if (AT = 4) delayfactor = 1.14
if (AT = 5) delayfactor = 0.08
endif
; log and fix very slow speeds that will give TRNBUILD difficulty in building transit paths
if (CTIM>0) ; lmz update; was (TSIN = 0)
; compute the congested speed
CSPD = DISTANCE / (CTIM/60.0)
if (((FT<=4)|(FT=8)) & (CSPD < @token_minimum_speed_fwy@))
CSPD = @token_minimum_speed_fwy@
CTIM = li.1.DISTANCE / (CSPD/60.0)
list = "cspd@token_period@ below threshold of @token_minimum_speed_fwy@ mph for link: ", a(8.0), "-", b(8.0), printo=1
elseif (CSPD < @token_minimum_speed@)
CSPD = @token_minimum_speed@
CTIM = li.1.DISTANCE / (CSPD/60.0)
list = "cspd@token_period@ below threshold of @token_minimum_speed@ mph for link: ", a(8.0), "-", b(8.0), printo=1
endif
endif
; set the park-and-ride time to the highway time, except the bridges which the park-and-ride paths ignore
if (PNROK=1)
PNR_TIME = CTIM
else
PNR_TIME = 9999
endif
; compute bus time
; no congestion for BRT facilities (two-levels)
IF (BRT = 1)
BUS_TIME = FFT + (delayfactor * DISTANCE * 0.5)
ELSEIF (BRT = 2)
BUS_TIME = CTIM + (delayfactor * DISTANCE * 0.5)
ELSEIF (BRT = 3)
; Bus on highway shoulder -- assume 35 mph or congested time, which ever is less
BUS_TIME = min(CTIM, li.1.DISTANCE / (35.0/60.0))
ELSE
BUS_TIME = CTIM + (delayfactor * DISTANCE)
ENDIF
endrun
; add transit-only access links to the highway network to facilitate automated access link building
run pgm = network
; use the input network created by the previous step
neti = @token_period@_transit_background.net
; add the access links
linki[2] = "%MODEL_DIR%\trn\transitLines.access", var = a, var = b, rev = 1
; output a temporary network used in the BuildTransitNetworks.job script
neto = @token_period@_temporary_transit_background_accesslinks.net
endrun
; add transit-only transfer links to the highway network to facilitate automated transfer link building
run pgm=network
; use the input network created by the previous step
neti = @token_period@_transit_background.net
; add the transit transfer links
linki[2] = "%MODEL_DIR%\trn\transitLines.xfer", var = a, var = b, var = DISTANCE, rev = 1
; output a temporary network used in the BuildTransitNetworks.job script
neto = @token_period@_temporary_transit_background_transferlinks.net
endrun
endloop ; period