Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network rebuild #60

Open
wants to merge 10 commits into
base: TM2.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 12 additions & 85 deletions model-files/scripts/assign/HwyAssign.job
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@
; ----------------------------------------------------------------------------------------------------------------

;read max cost parameters
;read file = %BASE_SCRIPTS%\block\maxCosts.block
;read file = %BASE_SCRIPTS%\block\hwyparam.block
hwy_block_param = '%BASE_SCRIPTS%\block\hwyparam.block'
speed_cap_block_param = '%BASE_SCRIPTS%\block\SpeedCapacity_1hour.block'
free_flow_block_param = '%BASE_SCRIPTS%\block\FreeFlowSpeed.block'
vdf_block_param = '%BASE_SCRIPTS%\block\SpeedFlowCurve.block'

Expand Down Expand Up @@ -163,30 +160,16 @@ loop period = 1,3
NETO = hwy\avgload@token_period@_taz_delete.net

PHASE=LINKMERGE
;

; Capacity and Speed Lookups
;
; Set based on CAPCLASS
;
LOOKUP NAME= Cap,LOOKUP[1]=1,RESULT=2,
FILE = %BASE_SCRIPTS%\block\SPDCAP_LOOKUP.DAT
CAP_HRLN = Cap(1,CAPCLASS)
CAP_LANE = CAP_HRLN * @token_capfacnum@
CAP_TOTAL = CAP_LANE * LANES_@token_period@
CAP_TOTAL = CAP_LANE * LANES
CAP_TOTFAC = CAP_TOTAL

/*
;F&P added if statement to only use speed lookup if inside Marin (Marin=1) and not a freeway (FT<>2)
IF (COUNTY = 'Marin' & FT <> 1) ; non-freeway in Marin County
LOOKUP NAME= Spd,LOOKUP[2]=1,RESULT=3,
FILE = %BASE_SCRIPTS%\block\SPDCAP_LOOKUP.DAT
SPEED = Spd(2,CAPCLASS)
FFS = SPEED
ELSE
SPEED = FFS
ENDIF
*/

if (FFS > 0)
FFT = (60.0 / 5280.0) * FEET / FFS ; (60 minutes / 1 hour) * (1 mile / 5280 feet) * (feet) * (miles / hour) => minutes
else
Expand Down Expand Up @@ -238,9 +221,6 @@ loop period = 1,3
; hwyParam.bock contains variables used in the remainder of the script, particularly in the generalized cost expressions
read file = @hwy_block_param@

; read in the speed/capacity table
;read file = @speed_cap_block_param@ - removed by F&P

; set the working variables

phase = linkread
Expand All @@ -267,10 +247,6 @@ loop period = 1,3
; TOLLBOOTH set to distinguish value tolls from bridge tolls
lw.tollclass = li.TOLLBOOTH

; the speed/capacity table and the computation of the volume/delay function parameter (see FreeFlowSpeed.block) uses the capacity class code
; which is area type * 15 + facility type - modified by F&P
;lw.capclass = li.CAPCLASS - removed by F&P

; free-flow speed is used in the volume/delay functions
ffs = li.FFS

Expand All @@ -288,8 +264,6 @@ loop period = 1,3
; set the generalized cost, which is the combination of three tokens

lw.gencost_da = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_DA)
;lw.gencost_s2 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S2 / sr2costShare) + @token_hov_xfer_pen@
;lw.gencost_s3 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S3 / sr3costShare) + @token_hov_xfer_pen@
lw.gencost_s2 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S2 / sr2costShare)
lw.gencost_s3 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S3 / sr3costShare)
lw.gencost_vsm = lw.time + (0.6 / truckVot) * (lw.dist * truckOpCost + li.TOLL@token_period@_VSM)
Expand All @@ -301,13 +275,13 @@ loop period = 1,3
; the USE variable defines what type of vehicles can use the roadway

; Group 23 defines HOV 2 and 3+ facilities
if (li.USECLASS_@token_period@ = 2,3) addtogroup = 23
if (li.USECLASS = 2,3) addtogroup = 23

; Group 3 defines HOV 3+ facilities
if (li.USECLASS_@token_period@ = 3) addtogroup = 3
if (li.USECLASS = 3) addtogroup = 3

; Group 4 defines facilities not available to trucks
if (li.USECLASS_@token_period@ = 2,3,4) addtogroup = 4
if (li.USECLASS = 2,3,4) addtogroup = 4

; Group 11 defines the value toll links the non-value-toll-paying users are prohibited from using
if (lw.tollclass >= firstvalue && li.TOLL@token_period@_DA > 0) addtogroup = 11
Expand Down Expand Up @@ -373,8 +347,6 @@ loop period = 1,3

; set the generalized cost functions (same as before, only now we start with "time")
lw.gencost_da = time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_DA)
;lw.gencost_s2 = time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S2 / sr2costShare) + @token_hov_xfer_pen@
;lw.gencost_s3 = time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S3 / sr3costShare) + @token_hov_xfer_pen@
lw.gencost_s2 = time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S2 / sr2costShare)
lw.gencost_s3 = time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S3 / sr3costShare)
lw.gencost_vsm = time + (0.6 / truckVot) * (lw.dist * truckOpCost + li.TOLL@token_period@_VSM)
Expand Down Expand Up @@ -456,11 +428,6 @@ loop period = 1,2
MAZMAZVOL=LI.2.MAZMAZVOL
ENDPHASE
endrun


; *DEL hwy\avgload@token_period@_taz.net
; *copy hwy\avgload@token_period@_taz_temp2.net hwy\avgload@token_period@_taz.net
; *DEL hwy\avgload@token_period@_taz_temp2.net

;Delete links for assignment and add in speeds and capacities
run pgm = network
Expand All @@ -469,31 +436,16 @@ loop period = 1,2

PHASE=LINKMERGE

;
; Capacity and Speed Lookups
;
; Set based on CAPCLASS
;

LOOKUP NAME= Cap,LOOKUP[1]=1,RESULT=2,
FILE = %BASE_SCRIPTS%\block\SPDCAP_LOOKUP.DAT
CAP_HRLN = Cap(1,CAPCLASS)
CAP_LANE = CAP_HRLN * @token_capfacnum@
CAP_TOTAL = CAP_LANE * LANES_@token_period@
CAP_TOTAL = CAP_LANE * LANES
CAP_TOTFAC = CAP_TOTAL

/*
;F&P added if statement to only use speed lookup if inside Marin (Marin=1) and not a freeway (FT<>2)
IF (COUNTY = 'Marin' & FT <> 1) ; non-freeway in Marin County
LOOKUP NAME= Spd,LOOKUP[2]=1,RESULT=3,
FILE = %BASE_SCRIPTS%\block\SPDCAP_LOOKUP.DAT
SPEED = Spd(2,CAPCLASS)
FFS = SPEED
ELSE
SPEED = FFS
ENDIF
*/

if (FFS > 0)
FFT = (60.0 / 5280.0) * FEET / FFS ; (60 minutes / 1 hour) * (1 mile / 5280 feet) * (feet) * (miles / hour) => minutes
else
Expand Down Expand Up @@ -545,9 +497,6 @@ loop period = 1,2
; hwyParam.bock contains variables used in the remainder of the script, particularly in the generalized cost expressions
read file = @hwy_block_param@

; read in the speed/capacity table
;read file = @speed_cap_block_param@ - removed by F&P

; set the working variables

phase = linkread
Expand All @@ -574,10 +523,6 @@ loop period = 1,2
; TOLLBOOTH set to distinguish value tolls from bridge tolls
lw.tollclass = li.TOLLBOOTH

; the speed/capacity table and the computation of the volume/delay function parameter (see FreeFlowSpeed.block) uses the capacity class code
; which is area type * 15 + facility type - modified by F&P
;lw.capclass = li.CAPCLASS - removed by F&P

; free-flow speed is used in the volume/delay functions
ffs = li.FFS

Expand All @@ -587,16 +532,11 @@ loop period = 1,2
; free flow time
fft = li.FFT

; link capacity is a function of the number of lanes
;lanes = li.LANES_@token_period@

read file = @free_flow_block_param@

; set the generalized cost, which is the combination of three tokens

lw.gencost_da = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_DA)
;lw.gencost_s2 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S2 / sr2costShare) + @token_hov_xfer_pen@
;lw.gencost_s3 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S3 / sr3costShare) + @token_hov_xfer_pen@
lw.gencost_s2 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S2 / sr2costShare)
lw.gencost_s3 = lw.time + (0.6 / vot) * (lw.dist * autoOpCost + li.TOLL@token_period@_S3 / sr3costShare)
lw.gencost_vsm = lw.time + (0.6 / truckVot) * (lw.dist * truckOpCost + li.TOLL@token_period@_VSM)
Expand All @@ -608,13 +548,13 @@ loop period = 1,2
; the USE variable defines what type of vehicles can use the roadway

; Group 23 defines HOV 2 and 3+ facilities
if (li.USECLASS_@token_period@ = 2,3) addtogroup = 23
if (li.USECLASS = 2,3) addtogroup = 23

; Group 3 defines HOV 3+ facilities
if (li.USECLASS_@token_period@ = 3) addtogroup = 3
if (li.USECLASS = 3) addtogroup = 3

; Group 4 defines facilities not available to trucks
if (li.USECLASS_@token_period@ = 2,3,4) addtogroup = 4
if (li.USECLASS = 2,3,4) addtogroup = 4

; Group 11 defines the value toll links the non-value-toll-paying users are prohibited from using
if (lw.tollclass >= firstvalue && li.TOLL@token_period@_DA > 0) addtogroup = 11
Expand Down Expand Up @@ -780,21 +720,9 @@ loop period = 1,5
LOOKUP NAME= Cap,LOOKUP[1]=1,RESULT=2,
FILE = %BASE_SCRIPTS%\block\SPDCAP_LOOKUP.DAT
CAP_HRLN = Cap(1,CAPCLASS)
CAP_LANE = CAP_HRLN * @token_capfacnum@
CAP_TOTAL = CAP_LANE * LANES_@token_period@
CAP_TOTFAC = CAP_TOTAL

/*
;F&P added if statement to only use speed lookup if inside Marin (Marin=1) and not a freeway (FT<>2)
IF (COUNTY = 'Marin' & FT <> 1) ; non-freeway in Marin County
LOOKUP NAME= Spd,LOOKUP[2]=1,RESULT=3,
FILE = %BASE_SCRIPTS%\block\SPDCAP_LOOKUP.DAT
SPEED = Spd(2,CAPCLASS)
FFS = SPEED
ELSE
SPEED = FFS
ENDIF
*/
CAP_LANE = CAP_HRLN * @token_capfacnum@
CAP_TOTAL = CAP_LANE * LANES
CAP_TOTFAC = CAP_TOTAL

if (FFS > 0)
FFT = (60.0 / 5280.0) * FEET / FFS ; (60 minutes / 1 hour) * (1 mile / 5280 feet) * (feet) * (miles / hour) => minutes
Expand Down Expand Up @@ -846,6 +774,5 @@ loop period = 1,5
*DEL hwy\avgload@token_period@_taz_temp3.net

endloop ; time period loop



Loading