; Script for program MATRIX in file "D:\JOB\D3\Model\A\APPLICATIONS\TDMAT00A.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="{Scenario_Dir}\OUTPUT\TDMAT00A.PRN" MSG='Creat K factors'
FILEO MATO[1] = "{Scenario_Dir}\OUTPUT\KFACTOR.MAT",
MO=1-7, DEC=1*S, NAME=KFACTOR1,KFACTOR2,KFACTOR3,KFACTOR4,KFACTOR5,KFACTOR6,KFACTOR7
PAR ZONES={ZONESA} ZONEMSG=100

MW[1]=1
MW[2]=1
MW[3]=1
MW[4]=1
MW[5]=1
MW[6]=1
MW[7]=1

JLOOP
;Purpose1
IF (I=1001-1600 & J=1-1000)   MW[1]=0.16
IF (I=1-1000 & J=1001-1600)   MW[1]=0.16
;IF (I=1601-1713 & J=1-1000)   MW[1]=0.16
;IF (I=1-1000 & J=1601-1713)   MW[1]=0.16
IF(I=1-1000 & J=2001-2200) MW[1]=0.2
IF(I=2001-2200 & J=1-1000)  MW[1]=0.2
;IF(I=1-1000 & J=2001-2200) MW[1]=0.06
;IF(I=2001-2200 & J=1-1000)  MW[1]=0.06
;Purpose2
IF (I=1001-1600 & J=1-1000)   MW[2]=0.06
IF (I=1-1000 & J=1001-1600)   MW[2]=0.06
;IF (I=1601-1713 & J=1-1000)   MW[2]=0.06
;IF (I=1-1000 & J=1601-1713)   MW[2]=0.06
IF(I=1-1000 & J=2001-2200) MW[2]=0.06
IF(I=2001-2200 & J=1-1000)  MW[2]=0.06

;Purpose3
IF (I=1001-1600 & J=1-1000)   MW[3]=0.034
IF (I=1-1000 & J=1001-1600)   MW[3]=0.034
;IF (I=1601-1713 & J=1-1000)   MW[3]=0.034
;IF (I=1-1000 & J=1601-1713)   MW[3]=0.034
IF(I=1-1000 & J=2001-2200) MW[3]=0.34
IF(I=2001-2200 & J=1-1000)  MW[3]=034
;Purpose4
IF (I=1001-1600 & J=1-1000)   MW[4]=0.07
IF (I=1-1000 & J=1001-1600)   MW[4]=0.07
;IF (I=1601-1713 & J=1-1000)   MW[4]=0.07
;IF (I=1-1000 & J=1601-1713)   MW[4]=0.07
IF(I=1-1000 & J=2001-2200) MW[4]=0.07
IF(I=2001-2200 & J=1-1000)  MW[4]=0.07


ENDJLOOP

/*
~ reduce travel anna maria to bradenton
GK, 1, 1001-1600, 1-1000, 0.16
GK, 1, 1-1000, 1001-1600, 0.16
GK, 1, 1601-1713, 1-1000, 0.16
GK, 1, 1-1000, 1601-1713, 0.16
GK, 2, 1001-1600, 1-1000, 0.06
GK, 2, 1-1000, 1001-1600, 0.06
GK, 2, 1601-1713, 1-1000, 0.06
GK, 2, 1-1000, 1601-1713, 0.06
GK, 3, 1001-1600, 1-1000, 0.034
GK, 3, 1-1000, 1001-1600, 0.034
GK, 3, 1601-1713, 1-1000, 0.034
GK, 3, 1-1000, 1601-1713, 0.034
GK, 4, 1001-1600, 1-1000, 0.07
GK, 4, 1-1000, 1001-1600, 0.07
GK, 4, 1601-1713, 1-1000, 0.07
GK, 4, 1-1000, 1601-1713, 0.07
*/
; The MATRIX module does not have any explicit phases.  The module does run within an implied ILOOP
; where I is the origin zones.  All user statements in the module are processed once for each origin.
; Matrix computation (MW[#]=) are solved for all values of J for each I.  Thus for a given origin zone I
; the values for all destination zones J are automatically computed.  The user can control the computations
; at each J by using a JLOOP.

ENDRUN


; Script for program DISTRIBUTION in file "D:\JOB\D3\Model\A\APPLICATIONS\TDDST00A.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=DISTRIBUTION PRNFILE="{Scenario_Dir}\OUTPUT\TDDST00A.PRN"
FILEI MATI[2] = "{Scenario_Dir}\OUTPUT\KFACTOR.MAT"
FILEI MATI[1] = "{SCENARIO_DIR}\OUTPUT\FREESKIM_{ALT}{Year}.MAT"
FILEO MATO[1] = "{Scenario_Dir}\OUTPUT\PSNTRIPS_TEMP_{ALT}{YEAR}.MAT",
MO=1-7,DEC=7*S, NAME=HBW,HBSH,HBSR,HBO,NHB,TRKTAXI,IE
FILEI LOOKUPI[1] = "{Catalog_Dir}\Parameters\FF.DBF"
FILEI ZDATI[1] = "{Scenario_Dir}\OUTPUT\PANDA_{ALT}{Year}.DBF"
;FILEI MATI[2] = "{Scenario_Dir}\OUTPUT\KFACTOR.MAT"

PAR MAXITERS={TDistIters},MAXRMSE=10.0, ZONEMSG=100

    LOOKUP, LOOKUPI=1,
        INTERPOLATE=Y, NAME=FF,
        LOOKUP[1]=1,RESULT=2,
        LOOKUP[2]=1,RESULT=3,
        LOOKUP[3]=1,RESULT=4,
        LOOKUP[4]=1,RESULT=5,
        LOOKUP[5]=1,RESULT=6,
        LOOKUP[6]=1,RESULT=7,
        LOOKUP[7]=1,RESULT=8

;   ----- SETUP THE WORKING P'S AND A'S
;HBWKP,HBWKA,HBSHP,HBSHA,HBSRP,HBSRA,HBOTP,HBOTA,NHBSP,NHBSA,LTRKP,LTRKA,
;MTRKP,MTRKA,HTRKP,HTRKA,SOIEP,SOIEA,HOIEP,HOIEA,LDIEP,LDIEA,HDIEP,HDIEA

    SETPA P[1]=P1  A[1]=A1;HBWKA;*ATRFAC(1,I)
    SETPA P[2]=P2  A[2]=A2;HBSHA;*ATRFAC(2,I)
    SETPA P[3]=P3  A[3]=A3;HBSRA;*ATRFAC(3,I)
    SETPA P[4]=P4  A[4]=A4;HBOTA;*ATRFAC(4,I)
    SETPA P[5]=P5  A[5]=A5;NHBSA;*ATRFAC(5,I)
    SETPA P[6]=P6  A[6]=A6;LTRKA;*ATRFAC(6,I)
    SETPA P[7]=P7  A[7]=A7;MTRKA;*ATRFAC(7,I)

;   ----- DO 12 GRAVITY MODELS
    MW[20]=MI.1.STIME+MI.1.STERMINALTIME
    GRAVITY PURPOSE=1, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.1
    GRAVITY PURPOSE=2, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.2
    GRAVITY PURPOSE=3, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.3
    GRAVITY PURPOSE=4, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.4
    GRAVITY PURPOSE=5, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.5
    GRAVITY PURPOSE=6, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.6
    GRAVITY PURPOSE=7, LOS=MW[20], FFACTORS=FF, KFACTORS=MI.2.7

;   ----- GENERATE FREQUENCY DISTRIBUTION REPORTS
FREQUENCY VALUEMW=1  BASEMW=20,  RANGE=1-100, TITLE='HBW TRIP LENGTH FREQUENCY {descr,EditBox-CHARACTER,"Model Description","Base Model"}'
FREQUENCY VALUEMW=2  BASEMW=20,  RANGE=1-100, TITLE='HBSH TRIP LENGTH FREQUENCY {descr}'
FREQUENCY VALUEMW=3  BASEMW=20,  RANGE=1-100, TITLE='HBSR TRIP LENGTH FREQUENCY {descr}'
FREQUENCY VALUEMW=4  BASEMW=20,  RANGE=1-100, TITLE='HBO TRIP LENGTH FREQUENCY {descr}'
FREQUENCY VALUEMW=5  BASEMW=20,  RANGE=1-100, TITLE='NHB TRIP LENGTH FREQUENCY {descr}'
FREQUENCY VALUEMW=6  BASEMW=20,  RANGE=1-100, TITLE='LTRK TRIP LENGTH FREQUENCY {descr}'
FREQUENCY VALUEMW=7  BASEMW=20,  RANGE=1-100, TITLE='MTRK TRIP LENGTH FREQUENCY {descr}'

;IF (ITERATION=1)
;  PRINT FORM=9.0, LIST=I,ZI.1.HBWKP[I],
;        FILE = "C:\FSUTMS\DISTRICT2\NERPM\CUBE\IPFME.ROW"
;  PRINT FORM=9.0, LIST=I,ZI.1.HBWKA[I],
;        FILE = "C:\FSUTMS\DISTRICT2\NERPM\CUBE\IPFME.COL"
;  JLOOP
;      PRINT FORM=9.0, LIST=I,J,MW[2],
;        FILE = "C:\FSUTMS\DISTRICT2\NERPM\CUBE\IPFME.SED"
;  ENDJLOOP
;ENDIF


mw[31]=mw[1]*mw[20]/60
mw[32]=mw[2]*mw[20]/60
mw[33]=mw[3]*mw[20]/60
mw[34]=mw[4]*mw[20]/60
mw[35]=mw[5]*mw[20]/60
mw[36]=mw[6]*mw[20]/60
mw[37]=mw[7]*mw[20]/60

; The DISTRIBUTION module does not have any explicit phases.  The module does run within an implied ILOOP
; where I is the origin zones.  The module has a built in GRAVITY statement for implementing this commonly
; used distribution method.  User defined distribution process can also be defined.

ENDRUN


; Script for program MATRIX in file "D:\JOB\D3\Model\A\APPLICATIONS\TDMAT00B.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="{Scenario_Dir}\OUTPUT\TDMAT00B.PRN" MSG='Prepare Vehicle Trip Table for Preassignment'
FILEO MATO[1] = "{Scenario_Dir}\OUTPUT\VEHTRIPS_PREASSIGN.MAT",
MO=1,NAME=PRELOADVEH
FILEI MATI[2] = "{Scenario_Dir}\OUTPUT\EETRIPS_{ALT}{Year}.MAT"
FILEI MATI[1] = "{Scenario_Dir}\OUTPUT\PSNTRIPS_TEMP_{ALT}{YEAR}.MAT"
PAR ZONEMSG=100

;P1=HBW,P2=HBS,P3=HBSR,P4=HBO,P5=NHB,P6=TT,P7=IE,P8=EE
MW[1]=(MI.1.HBW+MI.1.HBW.T)*0.5*{AOFAC_HBW}+
      (MI.1.HBSH+MI.1.HBSH.T)*0.5*{AOFAC_HBSH}+
      (MI.1.HBSR+MI.1.HBSR.T)*0.5*{AOFAC_HBSR}+
      (MI.1.HBO+MI.1.HBO.T)*0.5*{AOFAC_HBO}+
      (MI.1.NHB+MI.1.NHB.T)*0.5*{AOFAC_NHB}+
      (MI.1.TRKTAXI+MI.1.TRKTAXI.T)*0.5+
      (MI.1.IE+MI.1.IE.T)*0.5+
       MI.2.M1
;[2]=MW[1]*0.5

; The MATRIX module does not have any explicit phases.  The module does run within an implied ILOOP
; where I is the origin zones.  All user statements in the module are processed once for each origin.
; Matrix computation (MW[#]=) are solved for all values of J for each I.  Thus for a given origin zone I
; the values for all destination zones J are automatically computed.  The user can control the computations
; at each J by using a JLOOP.

ENDRUN


; Script for program HIGHWAY in file "D:\JOB\D3\Model\A\APPLICATIONS\TDHWY00A.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=HIGHWAY PRNFILE="{Scenario_Dir}\OUTPUT\TDHWY00A.PRN" MSG='Preassignment'
FILEI TURNPENI = "{SCENARIO_DIR}\Input\TURN_{Year}{ALT}.PEN"
FILEO NETO = "{SCENARIO_DIR}\OUTPUT\PREASSIGN_{ALT}{Year}.NET"
;FILEI TURNPENI = "{SCENARIO_DIR}\Input\TURN_{Year}{ALT}.PEN"
FILEI NETI = "{Scenario_Dir}\OUTPUT\UNLOADED_{ALT}{Year}.NET"
FILEI MATI[1] = "{Scenario_Dir}\OUTPUT\VEHTRIPS_PREASSIGN.MAT"

PAR ZONEMSG=100 MAXITERS={AssignIters}
ZONES={ZONESA}
LOOKUP,
INTERPOLATE=Y,LIST=Y,NAME=DECEL,
LOOKUP[1]=1,RESULT=2,
R='30 4',
  '70 6.2'


PROCESS PHASE=LINKREAD
; Use this phase to obtain initial values from the input network (LI.varname) and compute 
; link values (LW.varname) that can be used in other 
  T0=li.TIME
  LW.FFTIME=LI.TIME ; USE FOR PRELOAD PURPOSES (FFTIME)
  C=LI.CAPACITY*LI.NUM_LANES*LI.UROADFACTOR/LI.CONFAC

  IF (LI.{PATHGROUP}) ADDTOGROUP=7 
      LINKCLASS=1 ; no toll
      if (li.tolltype=1) 
       LINKCLASS=2 ; with toll
       T0=({CTOLL}*LI.CARTOLL)*60 + LI.SVCMINUTES + LI.SVCSECONDS/60
       if (iteration=0)
          LW.ARRIVR=(V/LI.UROADFACTOR)*LI.CONFAC/LI.PLZALNSMAX  ; hourly volume per toll lane ie. arrival rate in vehicles per hour
        LW.SERVT=LI.SVCMINUTES+(LI.SVCSECONDS/60)           ; Plaza lane service time in minutes per vehicle
        LW.SERVR=(1/LW.SERVT)*60                            ; Plaza lane service rate in vehicle per hour
        PRINT LIST='ARRIVR= ',LW.ARRIVR
        PRINT LIST='SERVT= ',LW.SERVT
        PRINT LIST='SERVR= ',LW.SERVR
        if (LW.ARRIVR>=LW.SERVR) LW.ARRIVR=0.99*LW.SERVR    ; prevent infinite or negative queue 
       endif
      endif
; classify links based on presence/absence of Open Road Toll
      if (li.tolltype=2) 
       LINKCLASS=3 ; with ORT
       T0=({CTOLL}*LI.CARTOLL)*60
       endif
       if (li.TOLL_ACC>0) 
       LINKCLASS=4 ; Toll Plaza Acceleration link
       T0= T0 + (LI.SPEED/2.5)/60
      endif
      if (li.TOLL_DEC>0) 
       LINKCLASS=5 ; Toll Plaza Deceleration link
       T0 = T0 + (LI.SPEED/DECEL(1,LI.SPEED))/60
      endif
ENDPROCESS

PROCESS PHASE=ILOOP
; This phase performs a zonal loop (I=1,Zones).  This phase is required and must contain
; at least 1 PATHLOAD statement.  Almost all MATRIX operation are available in this phase
; and the PATHLOAD statement can be used to build and load paths for assignment
MW[1]=MI.1.PRELOADVEH
;MW[2]=MI.1.TEST
PATHLOAD PATH=TIME, VOL[1]=MW[1]
;PATHLOAD PATH=TIME, PENI=1, VOL[2]=MW[2]
IF (I=ZONES)
  LINKLOOP
    LW.PREVTIME=TIME
  ENDLINKLOOP
ENDIF


ENDPROCESS


PROCESS PHASE=ADJUST
; This phase is automatically run after the ILOOP phase.  The volume-delay functions (TC) are
; automatically recomputed in this phase to update the link congested travel times based 
; on the volumes from the ILOOP phase.  User defined link computations (LW.varname) that 
; need to be updated based on the new congested travel times should be coded in this phase.
IF(TIME>0) LW.CGSTSPEED=(LW.DISTANCE/TIME)*60
IF(LI.TOLLTYPE=1)
 LW.ARRIVR=(V/LI.UROADFACTOR)*LI.CONFAC/LI.PLZALNSMAX  ; hourly volume per toll lane ie. arrival rate in vehicles per hour
 LW.SERVT=LI.SVCMINUTES+(LI.SVCSECONDS/60)           ; Plaza lane service time in minutes per vehicle
 LW.SERVR=(1/LW.SERVT)*60                            ; Plaza lane service rate in vehicle per hour
IF(LW.ARRIVR>=LW.SERVR) LW.ARRIVR=0.99*LW.SERVR; prevent infinite or negative queue 
;PRINT LIST='ARRIVR= ',LW.ARRIVR
;PRINT LIST='SERVT= ',LW.SERVT
;PRINT LIST='SERVR= ',LW.SERVR
;PRINT LIST='TOLLTIME= ',TIME
ENDIF
FUNCTION V=VOL[1]
;FUNCTION TC[1]={DAMPINGFACTOR}*LW.PREVTIME+(1.0-{DAMPINGFACTOR}*LI.TIME*(1+LI.BPRCOEFFICIENT*MIN(V/C),{VCMAX}*LI.BPREXPONENT);Congested time for non-toll links
 FUNCTION TC[1]={DAMPINGFACTOR}*LW.PREVTIME+(1.0-{DAMPINGFACTOR})*LI.TIME*(1+LI.BPRCOEFFICIENT*MIN((V/C),{vcmax})^LI.BPREXPONENT)
 FUNCTION TC[2]=MIN((1/(LW.SERVR-LW.ARRIVR))*60,20)+{CTOLL}*LI.CARTOLL*60;CONGESTED TIME FOR TOLL LINKS
 FUNCTION TC[3]={CTOLL}*LI.CARTOLL*60;CONGESTED TIME FOR ORT TOLL LINKS
;FUNCTION TC[4]=LI.TIME*(1+LI.BPRCOEFFICIENT*MIN(V/C),{VCMAX})^LI.BPREXPONENT)+(LW.CGSPEED/2.5)/60;CONGESTED TIME TOLL ACCELERATION LINKS
 FUNCTION TC[4]=LI.TIME*(1+LI.BPRCOEFFICIENT*MIN((V/C),{vcmax})^LI.BPREXPONENT) + (LW.CGSTSPEED/2.5)/60
 FUNCTION TC[5]=LI.TIME*(1+LI.BPRCOEFFICIENT*MIN((V/C),{vcmax})^LI.BPREXPONENT)+(LW.CGSTSPEED/DECEL(1,LW.CGSTSPEED))/60; congested time toll deceleration links
;if (li.cartoll>0) print list="Iter:",iteration(2.0)," TOLLFM Summary, A=",A(6.0)," B=",B(6.0)," PLAZAID=",li.TOLL(3.0)," NAME=",li.PLAZADESC(24)," MAX LNS=",li.PLZALNSMAX," GCOST=",TIME(6.2),
 ;       printo=1
ENDPROCESS

ENDRUN


; Script for program HIGHWAY in file "D:\JOB\D3\Model\A\APPLICATIONS\TDHWY00B.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=HIGHWAY PRNFILE="{Scenario_Dir}\OUTPUT\TDHWY00B.PRN" MSG='Develop Congested Skims'
FILEI LOOKUPI[1] = "{Catalog_Dir}\Parameters\TTPREP.CSV"
FILEO MATO[1] = "{Scenario_Dir}\OUTPUT\CONGSKIM_{ALT}{Year}.MAT",
MO=1-9,NAME=STOLL,SDISTANCE,STIME,STERMINALTIME,STIME2,HTOLL,HDISTANCE,HTIME,HTIME2
FILEI TURNPENI = "{SCENARIO_DIR}\Input\TURN_{Year}{ALT}.PEN"
FILEI NETI = "{SCENARIO_DIR}\OUTPUT\PREASSIGN_{ALT}{Year}.NET"

PAR ZONES={ZONESA}

PAR ZONEMSG=100

 LOOKUP,NAME=TERMTIME,LOOKUP[1]=1, RESULT=2, INTERPOLATE=N, LOOKUPI=1

PROCESS PHASE=LINKREAD
; Use this phase to obtain initial values from the input network (LI.varname) and compute 
; link values (LW.varname) that can be used in other phases.
;IF (LI.FACILITY_T=80-89) ADDTOGROUP=1
;IF(LI.FACILITY_T=49,59,69) ADDTOGROUP=9
LW.TIME=LI.TIME_1
 ; IF (LI.AREA_TYPE=10-19) _ATYPE1=1
;IF (LI.AREA_TYPE=20-29) _ATYPE1=2
;IF (LI.AREA_TYPE=30-39) _ATYPE1=3
;IF (LI.AREA_TYPE=40-49) _ATYPE1=4
;IF (LI.AREA_TYPE=50-59) _ATYPE1=5
;IF (A=1-{ZONESA}) TERMTIME[A]=TERM[_ATYPE1]
ENDPROCESS


PROCESS PHASE=ILOOP
; This phase performs a zonal loop (I=1,Zones).  This phase is required and must contain
; at least 1 PATHLOAD statement.  Almost all MATRIX operation are available in this phase
; and the PATHLOAD statement can be used to build and load paths for assignment
   PATHLOAD PATH=LW.TIME, PENI=1, 
      MW[1]=PATHTRACE(LI.CARTOLL), NOACCESS=0,
      MW[2]=PATHTRACE(LI.DISTANCE), NOACCESS=0,
      MW[3]=PATHTRACE(LI.TIME_1), NOACCESS=0,
     ;MW[4]=PATHTRACE(LW.TIME), NOACCESS=0
; BUILD TERMINAL TIME MATRIX
      MW[4]=TERMTIME(1,I)+TERMTIME(1,J)
    ;  PATHLOAD PATH=LW.TIME, PENI=1, ;Pathload      
    ;  MW[1]=PATHTRACE(LW.TIME),NOACCESS=0, 
    ;  MW[2]=PATHTRACE(LI.DISTANCE),NOACCESS=0,
    ;  MW[4]=PATHTRACE(LI.CARTOLL),NOACCESS=0,
    ;  MW[5]=PATHTRACE(LW.TIME),NOACCESS=0
    ;  MW[3]=TERMTIME(1,I)+TERMTIME(1,J) ; BUILDS TERMINAL TIME MATRIX
    ;  EXCLUDEGROUP=1,9
 ; MW[1][I]=lowest(1,{IZzone})/{IZzone} ; INTRAZONAL TIME = 1/2 THE AVERAGE OF THE {IZzone} NEAREST ZONES
 ; MW[2][I]=lowest(2,{IZzone})/{IZzone} ; INTRAZONAL DISTANCE = 1/2 THE AVERAGE OF THE {IZzone} NEAREST ZONES
 ; MW[4][I]=lowest(4,{IZzone})/{IZzone} ; INTRAZONAL TOLL = 1/2 THE AVERAGE OF THE {IZzone} NEAREST ZONES
 ; MW[5][I]=lowest(5,{IZzone})/{IZzone} ; INTRAZONAL TIME2 = 1/2 THE AVERAGE OF THE {IZzone}NEAREST ZONES
AG={IZzONE};*2
loop _IZ=1,3;4
  mw[_IZ][i]=lowest(_IZ,{IZzone})/AG
endloop

MW[5]=MW[3]
MW[6]=MW[1]
MW[7]=MW[2]
MW[8]=MW[3]
MW[9]=MW[5]
;JLOOP
; IF (99999=MW[1]*2) MW[1]=99999 ;Make NOACCESS intrazonals 99999
;ENDJLOOP
ENDPROCESS


;PROCESS PHASE=ADJUST
; This phase is automatically run after the ILOOP phase.  The volume-delay functions (TC) are
; automatically recomputed in this phase to update the link congested travel times based 
; on the volumes from the ILOOP phase.  User defined link computations (LW.varname) that 
; need to be updated based on the new congested travel times should be coded in this phase.


;ENDPROCESS

ENDRUN


; Script for program MATRIX in file "D:\JOB\D3\Model\A\APPLICATIONS\TDMAT00C.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="{Scenario_Dir}\OUTPUT\TDMAT00C.PRN" MSG='Develop Transit  Congested Skims'
FILEO MATO[1] = "{Scenario_Dir}\OUTPUT\RHSKIMTT.{ALT}{Year}",
MO=1-4,NAME=COST,DISTANCE,TIME,TIME2, FORMAT=TRANPLAN
FILEI MATI[1] = "{Scenario_Dir}\OUTPUT\CONGSKIM_{ALT}{Year}.MAT"

MW[1]=MI.1.1*100
MW[2]=MI.1.2*100
MW[3]=MI.1.3*100
MW[4]=MI.1.5*100

; The MATRIX module does not have any explicit phases.  The module does run within an implied ILOOP
; where I is the origin zones.  All user statements in the module are processed once for each origin.
; Matrix computation (MW[#]=) are solved for all values of J for each I.  Thus for a given origin zone I
; the values for all destination zones J are automatically computed.  The user can control the computations
; at each J by using a JLOOP.

ENDRUN


; Script for program MATRIX in file "D:\JOB\D3\Model\A\APPLICATIONS\TDMAT00E.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="{Scenario_Dir}\OUTPUT\TDMAT00D.PRN" MSG='Build trip table for Mode choice'
FILEO MATO[1] = "{Scenario_Dir}\OUTPUT\PSNTRIPS_{ALT}{YEAR}.MAT",
MO=1-5,DEC=7*S, NAME=HBW,HBO,NHB,TRKTAXI,IE

FILEI MATI[1] = "{Scenario_Dir}\OUTPUT\PSNTRIPS_TEMP_{ALT}{YEAR}.MAT"

MW[1]=MI.1.1
MW[2]=MI.1.2+MI.1.3+MI.1.4
MW[3]=MI.1.5
MW[4]=MI.1.6
MW[5]=MI.1.7
; The MATRIX module does not have any explicit phases.  The module does run within an implied ILOOP
; where I is the origin zones.  All user statements in the module are processed once for each origin.
; Matrix computation (MW[#]=) are solved for all values of J for each I.  Thus for a given origin zone I
; the values for all destination zones J are automatically computed.  The user can control the computations
; at each J by using a JLOOP.

ENDRUN


