; PILOT Script

DistributeMultiStep ProcessID="FSUTMSdist" ProcessNum=1

; End of PILOT Script

; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\TRPTR00A.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="C:\d3\N\APPLICATIONS\TRPTR00A.PRN" MSG='Walk-Access Paths/Skims - peak'
FILEI NTLEGI[2] = "{Scenario_Dir}\Output\NTLEG2PK_{ALT}{Year}.NTL"
FILEI NETI = "{SCENARIO_DIR}\output\HWYLOAD2_{Alt}{Year}.NET"
FILEI NTLEGI[4] = "{SCENARIO_DIR}\output\NTLEG12PK_{alt}{year}.NTL"
FILEI NTLEGI[3] = "{SCENARIO_DIR}\output\NTLEG11PK_{alt}{year}.NTL"
FILEI NTLEGI[1] = "{SCENARIO_DIR}\output\NTLEG1PK_{alt}{year}.NTL"
FILEO MATO[1] = "{SCENARIO_DIR}\output\TSKIMAM1_{alt}{year}.MAT",
  MO=1-15, NAME=WALKTIME,AutoTIME,SidewalkTIME,BUSTIME,PBUSTIME,CIRCTIME,RAILTIME,COMRLTIME,OTHTIME,PRJTIME,XFER,IWAIT,XWAIT,FARE,TOTTIME
FILEO LINEO = "{SCENARIO_DIR}\output\pkwalk.lin"
FILEO NTLEGO = "{SCENARIO_DIR}\output\pkwalk.ntl"
FILEO ROUTEO[1] = "{SCENARIO_DIR}\output\TPATHAM1_{alt}{year}.RTE",
  REPORTI={FromNode}, REPORTJ={ToNode}, TRACEI={FromNode}, TRACEJ={ToNode}
FILEO REPORTO = "{SCENARIO_DIR}\output\pkwalk.rpt"
FILEO NETO = "{SCENARIO_DIR}\output\PKWalk.NET"
FILEI FACTORI[1] = "{SCENARIO_DIR}\output\WalkTransit.FAC"
FILEI FAREI = "{Scenario_Dir}\Input\TFARES_{Year}{ALT}.FAR"
FILEI SYSTEMI = "{CATALOG_DIR}\parameters\TSYSD.PTS"
FILEI LINEI[1] = "{SCENARIO_DIR}\INPUT\TROUTE_{YEAR}{ALT}.LIN"

;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************
;PAR ZONE={ZONESA}
; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1,FARE=N, MAPSCALE={Units}, HDWAYPERIOD=1,
           NOROUTEERRS=999999, NOROUTEMSGS=999999,
           TRANTIME=LW.TRANTIME,
           TRANTIME[21]=LI.M21TIMEPK,
           ;TRANTIME[22]=LI.M22TIMEPK,
           ;TRANTIME[23]=LI.M23TIMEPK,
           ;TRANTIME[24]=LI.M24TIMEPK,
           ;TRANTIME[25]=LI.M25TIMEPK
           ;TRANTIME[26]=LI.M26TIMEPK,
           TRANTIME[27]=LI.M27TIMEPK
           ;TRANTIME[31]=LI.M31TIMEPK,
           ;TRANTIME[32]=LI.M32TIMEPK,
           ;TRANTIME[33]=LI.M33TIMEPK,
           ;TRANTIME[34]=LI.M34TIMEPK,
           ;TRANTIME[35]=LI.M35TIMEPK
           ;TRANTIME[36]=LI.M36TIMEPK,
           ;TRANTIME[37]=LI.M37TIMEPK

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=LINKREAD
           LW.TRANTIME=LI.M21TIMEPK
           LW.WALKTIME=LI.WALKTIME
           LW.WALKDISTANCE=LI.DISTANCE
           LW.DISTANCE=LI.DISTANCE
ENDPROCESS

PROCESS PHASE=DATAPREP

          ; Generate walk-access links
          GENERATE READNTLEGI=1
          ; Generate station-access links
          READ, FILE = "{SCENARIO_DIR}\OUTPUT\STATIONCONN_{ALT}{YEAR}.DAT"
          ; Generate auto-access links
          GENERATE READNTLEGI=2
          IF({isMicroCode} <> 0)
            ; Generate fixed-guideway to bus links
            GENERATE READNTLEGI=3
          ENDIF
          ; Generate CBD transfer links
          GENERATE READNTLEGI=4
ENDPROCESS
;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=SKIMIJ
  MW[1]=TIMEA(0,1)                                   ; Walk time
  MW[2]=TIMEA(0,2)                                   ; Auto time
  MW[3]=TIMEA(0,11)+TIMEA(0,12)                      ; Sidewalk time
  MW[4]=TIMEA(0,21)+TIMEA(0,31)                      ; Local bus time
  MW[5]=TIMEA(0,22)+TIMEA(0,32)                      ; Premium bus time
  MW[6]=TIMEA(0,23)+TIMEA(0,33)                      ; Circulator time
  MW[7]=TIMEA(0,24)+TIMEA(0,34)                      ; Light/Heavy Rail time
  MW[8]=TIMEA(0,25)+TIMEA(0,35)                      ; Commuter Rail time
  MW[9]=TIMEA(0,26)+TIMEA(0,36)                      ; Other mode time
  MW[10]=TIMEA(0,27)+TIMEA(0,37)                     ; Project mode time
 IF (BRDINGS(0,TMODES) > 0)
   MW[11]=BRDINGS(0,TMODES)-1                        ; Number of transfers
 ELSE
   MW[11]=0
 ENDIF
  MW[12]=IWAITA(0)                                    ; Initial wait time
  MW[13]=XWAITA(0)                                     ; Transfer wait time
  MW[14]=FAREA(0)                                    ; Fare matrix
  MW[15]=TIMEA(0,ALLMODES)                            ; Time on all modes
ENDPROCESS

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

ENDRUN


; PILOT Script

EndDistributeMultiStep

DistributeMultiStep ProcessID="FSUTMSdist" ProcessNum=2
; End of PILOT Script

; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\TRPTR00B.S"

; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="C:\d3\N\APPLICATIONS\TRPTR00D.PRN" MSG='Auto-Access Paths/Skims - peak'
FILEI NTLEGI[2] = "{Scenario_Dir}\Output\NTLEG2PK_{ALT}{Year}.NTL"
FILEI NETI = "{SCENARIO_DIR}\output\HWYLOAD2_{Alt}{Year}.NET"
FILEI NTLEGI[3] = "{SCENARIO_DIR}\output\NTLEG11PK_{alt}{year}.NTL"
FILEI NTLEGI[4] = "{SCENARIO_DIR}\output\NTLEG12PK_{alt}{year}.NTL"
FILEI NTLEGI[1] = "{SCENARIO_DIR}\output\NTLEG1PK_{alt}{year}.NTL"
FILEO MATO[1] = "{SCENARIO_DIR}\output\TSKIMAM3_{alt}{year}.MAT",
  MO=1-15, NAME=WALKTIME,AutoTIME,SidewalkTIME,BUSTIME,PBUSTIME,CIRCTIME,RAILTIME,COMRLTIME,OTHTIME,PRJTIME,XFER,IWAIT,XWAIT,FARE,TOTTIME
FILEO LINEO = "{SCENARIO_DIR}\output\pkwalk.lin"
FILEO NTLEGO = "{SCENARIO_DIR}\output\pkauto.ntl"
FILEO ROUTEO[1] = "{SCENARIO_DIR}\output\TPATHAM3_{alt}{year}.RTE",
  REPORTI={FromNode}, REPORTJ={ToNode}, TRACEI={FromNode}, TRACEJ={ToNode}
FILEO REPORTO = "{SCENARIO_DIR}\output\pkauto.rpt"
FILEO NETO = "{SCENARIO_DIR}\output\PKAuto.NET"
FILEI FACTORI[1] = "{SCENARIO_DIR}\output\AutoTransit.FAC"
FILEI FAREI = "{Scenario_Dir}\Input\TFARES_{Year}{ALT}.FAR"
FILEI SYSTEMI = "{CATALOG_DIR}\parameters\TSYSD.PTS"
FILEI LINEI[1] = "{SCENARIO_DIR}\INPUT\TROUTE_{YEAR}{ALT}.LIN"

;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1,FARE=N, MAPSCALE={Units}, HDWAYPERIOD=1,
           NOROUTEERRS=999999, NOROUTEMSGS=999999,
           TRANTIME=LW.TRANTIME,
           TRANTIME[21]=LI.M21TIMEPK,
         ;  TRANTIME[22]=LI.M22TIMEPK,
         ;  TRANTIME[23]=LI.M23TIMEPK,
         ;  TRANTIME[24]=LI.M24TIMEPK,
         ;  TRANTIME[25]=LI.M25TIMEPK
         ;  TRANTIME[26]=LI.M26TIMEPK,
           TRANTIME[27]=LI.M27TIMEPK
         ;  TRANTIME[31]=LI.M31TIMEPK,
         ;  TRANTIME[32]=LI.M32TIMEPK,
         ;  TRANTIME[33]=LI.M33TIMEPK,
         ;  TRANTIME[34]=LI.M34TIMEPK,
         ;  TRANTIME[35]=LI.M35TIMEPK
         ;  TRANTIME[36]=LI.M36TIMEPK,
         ;  TRANTIME[37]=LI.M37TIMEPK

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=LINKREAD
           LW.TRANTIME=LI.M21TIMEPK
           LW.WALKTIME=LI.WALKTIME
           LW.WALKDISTANCE=LI.DISTANCE
           LW.DISTANCE=LI.DISTANCE
ENDPROCESS

PROCESS PHASE=DATAPREP

           ; Generate walk-access links
           GENERATE READNTLEGI=1
           ; Generate station-access links
           READ, FILE = "{SCENARIO_DIR}\OUTPUT\STATIONCONN_{ALT}{YEAR}.DAT"
           ; Generate auto-access links
           GENERATE READNTLEGI=2
        IF({isMicroCode} <> 0)
           ; Generate fixed-guideway to bus links
           GENERATE READNTLEGI=3
        ENDIF
           ; Generate CBD transfer links
           GENERATE READNTLEGI=4
ENDPROCESS
;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=SKIMIJ
  MW[1]=TIMEA(0,1)                                                              ; Walk time
  MW[2]=TIMEA(0,2)                                                              ; Auto time
  MW[3]=TIMEA(0,11)+TIMEA(0,12)                                                 ; Sidewalk time
  MW[4]=TIMEA(0,21)+TIMEA(0,31)                                                              ; Local bus time
  MW[5]=TIMEA(0,22)+TIMEA(0,32)                                                             ; Premium bus time
  MW[6]=TIMEA(0,23)+TIMEA(0,33)                                                              ; Circulator time
  MW[7]=TIMEA(0,24)+TIMEA(0,34)                                                             ; Light/Heavy Rail time
  MW[8]=TIMEA(0,25)+TIMEA(0,35)                                                             ; Commuter Rail time
  MW[9]=TIMEA(0,26)+TIMEA(0,36)                                                              ; Other mode time
  MW[10]=TIMEA(0,27)+TIMEA(0,37)                                                            ; Project mode time
 IF(BRDINGS(0,TMODES) > 0)
   MW[11]=BRDINGS(0,TMODES)-1                                                   ; Number of transfers
 ELSE
   MW[11]=0
 ENDIF
  MW[12]=IWAITA(0)                                                              ; Initial wait time
  MW[13]=XWAITA(0)                                                              ; Transfer wait time
  MW[14]=FAREA(0)                                                               ; Fare matrix
  MW[15]=TIMEA(0,ALLMODES)                                                      ; Time on all modes
ENDPROCESS

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

ENDRUN


; PILOT Script
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.

EndDistributeMultiStep

DistributeMultiStep ProcessID="FSUTMSdist" ProcessNum=3
; End of PILOT Script

; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\TRPTR00C.S"

; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="C:\d3\N\APPLICATIONS\TRPTR00E.PRN" MSG='Walk-Access Paths/Skims - off-peak'
FILEI NTLEGI[2] = "{Scenario_Dir}\Output\NTLEG2OP_{ALT}{Year}.NTL"
FILEI NTLEGI[1] = "{SCENARIO_DIR}\output\NTLEG1OP_{alt}{year}.NTL"
FILEI NETI = "{SCENARIO_DIR}\output\unloaded2_{alt}{year}.net"
FILEI NTLEGI[4] = "{SCENARIO_DIR}\output\NTLEG12OP_{alt}{year}.NTL"
FILEI NTLEGI[3] = "{SCENARIO_DIR}\output\NTLEG11OP_{alt}{year}.NTL"
FILEO MATO[1] = "{SCENARIO_DIR}\output\TSKIMMD1_{alt}{year}.MAT",
  MO=1-15, NAME=WALKTIME,AutoTIME,SidewalkTIME,BUSTIME,PBUSTIME,CIRCTIME,RAILTIME,COMRLTIME,OTHTIME,PRJTIME,XFER,IWAIT,XWAIT,FARE,TOTTIME
FILEO LINEO = "{SCENARIO_DIR}\output\opwalk.lin"
FILEO NTLEGO = "{SCENARIO_DIR}\output\opwalk.ntl"
FILEO ROUTEO[1] = "{SCENARIO_DIR}\output\TPATHMD1_{alt}{year}.RTE",
  REPORTI={FromNode}, REPORTJ={ToNode}, TRACEI={FromNode}, TRACEJ={ToNode}
FILEO REPORTO = "{SCENARIO_DIR}\output\opwalk.rpt"
FILEO NETO = "{SCENARIO_DIR}\output\OPWalk.NET"
FILEI FACTORI[1] = "{SCENARIO_DIR}\output\WalkTransit.FAC"
FILEI FAREI = "{SCENARIO_DIR}\\Input\TFARES_{Year}{ALT}.FAR"
FILEI SYSTEMI = "{CATALOG_DIR}\parameters\TSYSD.PTS"
FILEI LINEI[1] = "{SCENARIO_DIR}\INPUT\TROUTE_{YEAR}{ALT}.LIN"

;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1,FARE=N, MAPSCALE={Units}, HDWAYPERIOD=2,
           NOROUTEERRS=999999, NOROUTEMSGS=999999,
           TRANTIME=LW.TRANTIME,
           TRANTIME[21]=LI.M21TIMEOP,
           ;TRANTIME[22]=LI.M22TIMEOP,
           ;TRANTIME[23]=LI.M23TIMEOP,
           ;TRANTIME[24]=LI.M24TIMEOP,
           ;TRANTIME[25]=LI.M25TIMEOP
           ;TRANTIME[26]=LI.M26TIMEOP,
           TRANTIME[27]=LI.M27TIMEOP
          ; TRANTIME[31]=LI.M31TIMEOP,
          ; TRANTIME[32]=LI.M32TIMEOP,
          ; TRANTIME[33]=LI.M33TIMEOP,
          ; TRANTIME[34]=LI.M34TIMEOP,
          ; TRANTIME[35]=LI.M35TIMEOP
          ; TRANTIME[36]=LI.M36TIMEOP,
          ; TRANTIME[37]=LI.M37TIMEOP
;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=LINKREAD
           LW.TRANTIME=LI.M21TIMEOP
           LW.WALKTIME=LI.WALKTIME
           LW.WALKDISTANCE=LI.DISTANCE
           LW.DISTANCE=LI.DISTANCE
ENDPROCESS

PROCESS PHASE=DATAPREP

           ; Generate walk-access links
           GENERATE READNTLEGI=1
           ; Generate station-access links
           READ, FILE = "{SCENARIO_DIR}\OUTPUT\STATIONCONN_{ALT}{YEAR}.DAT"
           ; Generate auto-access links
          GENERATE READNTLEGI=2
        IF({isMicroCode} <> 0)
           ; Generate fixed-guideway to bus links
           GENERATE READNTLEGI=3
        ENDIF
           ; Generate CBD transfer links
           GENERATE READNTLEGI=4

ENDPROCESS
;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=SKIMIJ
  MW[1]=TIMEA(0,1)                                                              ; Walk time
  MW[2]=TIMEA(0,2)                                                              ; Auto time
  MW[3]=TIMEA(0,11)+TIMEA(0,12)                                                 ; Sidewalk time
  MW[4]=TIMEA(0,21)+TIMEA(0,31)                                                               ; Local bus time
  MW[5]=TIMEA(0,22)+TIMEA(0,32)                                                             ; Premium bus time
  MW[6]=TIMEA(0,23)+TIMEA(0,33)                                                               ; Circulator time
  MW[7]=TIMEA(0,24)+TIMEA(0,34)                                                               ; Light/Heavy Rail time
  MW[8]=TIMEA(0,25)+TIMEA(0,35)                                                               ; Commuter Rail time
  MW[9]=TIMEA(0,26)+TIMEA(0,36)                                                             ; Other mode time
  MW[10]=TIMEA(0,27)+TIMEA(0,37)                                                              ; Project mode time
 IF (BRDINGS(0,TMODES) > 0)
   MW[11]=BRDINGS(0,TMODES)-1                                                   ; Number of transfers
 ELSE
   MW[11]=0
 ENDIF
  MW[12]=IWAITA(0)                                                              ; Initial wait time
  MW[13]=XWAITA(0)                                                              ; Transfer wait time
  MW[14]=FAREA(0)                                                               ; Fare matrix
  MW[15]=TIMEA(0,ALLMODES)                                                      ; Time on all modes
ENDPROCESS

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

ENDRUN


; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\TRPTR00D.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="C:\d3\N\APPLICATIONS\TRPTR00G.PRN" MSG='Auto-Access Paths/Skims - off-peak'
FILEI NTLEGI[2] = "{Scenario_Dir}\Output\NTLEG2OP_{ALT}{Year}.NTL"
FILEI NTLEGI[1] = "{SCENARIO_DIR}\output\NTLEG1OP_{alt}{year}.NTL"
FILEI NETI = "{SCENARIO_DIR}\output\unloaded2_{alt}{year}.net"
FILEI NTLEGI[4] = "{SCENARIO_DIR}\output\NTLEG12OP_{alt}{year}.NTL"
FILEI NTLEGI[3] = "{SCENARIO_DIR}\output\NTLEG11OP_{alt}{year}.NTL"
FILEO MATO[1] = "{SCENARIO_DIR}\output\TSKIMMD3_{alt}{year}.MAT",
  MO=1-15, NAME=WALKTIME,AutoTIME,SidewalkTIME,BUSTIME,PBUSTIME,CIRCTIME,RAILTIME,COMRLTIME,OTHTIME,PRJTIME,XFER,IWAIT,XWAIT,FARE,TOTTIME
FILEO LINEO = "{SCENARIO_DIR}\output\OPAuto.lin"
FILEO NTLEGO = "{SCENARIO_DIR}\output\OPAuto.ntl"
FILEO ROUTEO[1] = "{SCENARIO_DIR}\output\TPATHMD3_{alt}{year}.RTE",
  REPORTI={FromNode}, REPORTJ={ToNode}, TRACEI={FromNode}, TRACEJ={ToNode}
FILEO REPORTO = "{SCENARIO_DIR}\output\OPAuto.rpt"
FILEO NETO = "{SCENARIO_DIR}\output\OPAuto.NET"
FILEI FACTORI[1] = "{SCENARIO_DIR}\output\AutoTransit.FAC"
FILEI FAREI = "{Scenario_Dir}\Input\TFARES_{Year}{ALT}.FAR"
FILEI SYSTEMI = "{CATALOG_DIR}\parameters\TSYSD.PTS"
FILEI LINEI[1] = "{SCENARIO_DIR}\INPUT\TROUTE_{YEAR}{ALT}.LIN"

;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1,FARE=N, MAPSCALE={Units}, HDWAYPERIOD=2,
           NOROUTEERRS=999999, NOROUTEMSGS=999999,
           TRANTIME=LW.TRANTIME,
           TRANTIME[21]=LI.M21TIMEOP,
        ;   TRANTIME[22]=LI.M22TIMEOP,
        ;   TRANTIME[23]=LI.M23TIMEOP,
        ;   TRANTIME[24]=LI.M24TIMEOP,
        ;   TRANTIME[25]=LI.M25TIMEOP
        ;   TRANTIME[26]=LI.M26TIMEOP,
           TRANTIME[27]=LI.M27TIMEOP
        ;   TRANTIME[31]=LI.M31TIMEOP,
         ;  TRANTIME[32]=LI.M32TIMEOP,
         ;  TRANTIME[33]=LI.M33TIMEOP,
         ;  TRANTIME[34]=LI.M34TIMEOP,
         ;  TRANTIME[35]=LI.M35TIMEOP
         ;  TRANTIME[36]=LI.M36TIMEOP,
         ;  TRANTIME[37]=LI.M37TIMEOP

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=LINKREAD
           LW.TRANTIME=LI.M21TIMEOP
           LW.WALKTIME=LI.WALKTIME
           LW.WALKDISTANCE=LI.DISTANCE
           LW.DISTANCE=LI.DISTANCE
ENDPROCESS

PROCESS PHASE=DATAPREP

           ; Generate walk-access links
           GENERATE READNTLEGI=1
           ; Generate station-access links
           READ, FILE = "{SCENARIO_DIR}\OUTPUT\STATIONCONN_{ALT}{YEAR}.DAT"
           ; Generate auto-access links
           GENERATE READNTLEGI=2
           IF({isMicroCode} <> 0)
             ; Generate fixed-guideway to bus links
             GENERATE READNTLEGI=3
           ENDIF
           ; Generate CBD transfer links
           GENERATE READNTLEGI=4

ENDPROCESS
;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

PROCESS PHASE=SKIMIJ
  MW[1]=TIMEA(0,1)                                                              ; Walk time
  MW[2]=TIMEA(0,2)                                                              ; Auto time
  MW[3]=TIMEA(0,11)+TIMEA(0,12)                                                 ; Sidewalk time
  MW[4]=TIMEA(0,21)+TIMEA(0,31)                                                               ; Local bus time
  MW[5]=TIMEA(0,22)+TIMEA(0,32)                                                                ; Premium bus time
  MW[6]=TIMEA(0,23)+TIMEA(0,33)                                                                ; Circulator time
  MW[7]=TIMEA(0,24)+TIMEA(0,34)                                                               ; Light/Heavy Rail time
  MW[8]=TIMEA(0,25)+TIMEA(0,35)                                                                ; Commuter Rail time
  MW[9]=TIMEA(0,26)+TIMEA(0,36)                                                                ; Other mode time
  MW[10]=TIMEA(0,27)+TIMEA(0,37)                                                              ; Project mode time
 IF (BRDINGS(0,TMODES) > 0)
   MW[11]=BRDINGS(0,TMODES)-1                                                   ; Number of transfers
 ELSE
   MW[11]=0
 ENDIF
  MW[12]=IWAITA(0)                                                              ; Initial wait time
  MW[13]=XWAITA(0)                                                              ; Transfer wait time
  MW[14]=FAREA(0)                                                               ; Fare matrix
  MW[15]=TIMEA(0,ALLMODES)                                                      ; Time on all modes
ENDPROCESS



;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

ENDRUN


; PILOT Script
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.

EndDistributeMultiStep

DistributeMultiStep ProcessID="FSUTMSdist" ProcessNum=4
; End of PILOT Script

; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\TRPTR00E.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="C:\d3\N\APPLICATIONS\TRPTR00I.PRN" MSG='All-walk paths'
FILEI NETI = "{SCENARIO_DIR}\output\unloaded2_{alt}{year}.net"
FILEI NTLEGI[1] = "{SCENARIO_DIR}\output\NTLEG4PK_{alt}{year}.NTL"
FILEO MATO[1] = "{SCENARIO_DIR}\output\AllWalk_{alt}{year}.MAT",
  MO=1, DEC=D,NAME=ALLWALK
FILEO ROUTEO[1] = "{SCENARIO_DIR}\output\AllWalk_{alt}{year}.RTE",
  REPORTI={FromNode}, REPORTJ={ToNode}, TRACEI={FromNode}, TRACEJ={ToNode}
FILEO REPORTO = "{SCENARIO_DIR}\output\AllWalk.rpt"
FILEO NETO = "{SCENARIO_DIR}\output\AllWalk.net"
FILEI FACTORI[1] = "{CATALOG_DIR}\parameters\AllWalk.FAC"
FILEI FAREI = "{Scenario_Dir}\Input\TFARES_{Year}{ALT}.FAR"
FILEI SYSTEMI = "{CATALOG_DIR}\parameters\TSYSD.PTS"
FILEI LINEI[1] = "{SCENARIO_DIR}\INPUT\TROUTE_{YEAR}{ALT}.LIN"

; OVERALL PARAMETERS OF RUN
PARAMETERS USERCLASSES=1,FARE=N, MAPSCALE={UNITS}, HDWAYPERIOD=2,
           NOROUTEERRS=999999, NOROUTEMSGS=999999, 
           TRANTIME=LW.TRANTIME

PROCESS PHASE=LINKREAD
           LW.TRANTIME=LI.M21TIMEOP
           LW.DISTANCE=LI.DISTANCE
ENDPROCESS

PROCESS PHASE=DATAPREP
           ; Generate all-walk links
           GENERATE READNTLEGI=1
ENDPROCESS

PROCESS PHASE=SKIMIJ
           MW[1]=TIMEA(0,4)                                         ; All Walk time
ENDPROCESS

ENDRUN


; PILOT Script
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.

EndDistributeMultiStep

Wait4Files Files=FSUTMSdist1.script.end, FSUTMSdist2.script.end, FSUTMSdist3.script.end, FSUTMSdist4.script.end, PrintFiles=SAVE
; End of PILOT Script

; Script for program MATRIX in file "C:\d3\N\APPLICATIONS\TRMAT00D.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="C:\d3\N\APPLICATIONS\TRMAT00C.PRN" MSG='Path-Conditioning Walk'
FILEO MATO[3] = "{SCENARIO_DIR}\output\TSKIMOP1.{alt}{year}",
 MO=61-75,  NAME=WalkTime,AutoTime,SideWalkTime,BusTime,PBusTime,CircTime,RailTime,CommRailTime,OthTime,PRJTime,XFERs,IWAIT,XWAIT,FARE,TOTTIME
FILEO MATO[1] = "{SCENARIO_DIR}\output\TSKIMPK1.{alt}{year}",
MO=21-35, NAME=WalkTime,AutoTime,SideWalkTime,BusTime,PBusTime,CircTime,RailTime,CommRailTime,OthTime,PRJTime,XFERs,IWAIT,XWAIT,FARE,TOTTIME
FILEI MATI[4] = "{SCENARIO_DIR}\output\TSKIMMD1_{alt}{year}.MAT"
FILEI MATI[2] = "{SCENARIO_DIR}\output\TSKIMAM1_{alt}{year}.MAT"
FILEI MATI[1] = "{SCENARIO_DIR}\output\AllWalk_{alt}{year}.MAT"
FILEI LOOKUPI[1] = "{CATALOG_DIR}\parameters\TRN_COEFFICIENTS.DBF"

; Check skims to see if they are better than the all-walk path & if they have required IVT

DistributeINTRAStep ProcessID="FSUTMSDist" ProcessList=1-4

ZONEMSG=100

LOOKUP NAME=COEFF, LOOKUP[1]=1, RESULT=3,
FAIL=0,0,0,LIST=Y,INTERPOLATE=N,LOOKUPI=1

_ovtam =COEFF(1,3)/COEFF(1,1)     ; out-of-vehicle time factor (OVT time and Wait factor)
valtime   =0.6*COEFF(1,1)/COEFF(1,4) ; value of time (in $/hr)
aatfactor =COEFF(1,5)/COEFF(1,1)     ; drive access to transit time factor
_xferpen=COEFF(1,6)/COEFF(1,1)     ; transfer penalty
_boardingpen = 2.0

; Apply OVT factor to all-walk skims

FILLMW MW[11]=MI.1.1
FILLMW MW[21]=MI.2.1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
FILLMW MW[61]=MI.4.1,2,3,4,5,6,7,8,9,10,11,12,13,14,15


LOOP x=1,6
  LOOP y=1,15
    _idx=20 + 20*(x-1) + y
    if ((_idx%20)=14)
      COMP total = ROWFAC(_idx,100.0)
    endif
  ENDLOOP
ENDLOOP

; Apply OVT factor to all-walk skims
COMP total = ROWFAC(11,_ovtam)

JLOOP

  IF (I=={FromNode} && J=={ToNode}) LIST="Trace ",I(5.0),"-",J(5.0)
  IF (I=={FromNode} && J=={ToNode}) LIST="            ","       IVT","      Path","      wOVT","      wTOT"
  IF (I=={FromNode} && J=={ToNode}) LIST="All-Walk    ","          ","          ",MW[11](10.2),MW[11](10.2)

; Check skims to see if they are better than the all-walk path & if they have required IVT
  ; Walk-bus - peak (20 series)
    _ivt = MW[24] + MW[25] + MW[26] + MW[27] + MW[28] + MW[29] + MW[30]
    _pth = MW[24] + MW[26]
    _ovt = MW[22] + _ovtam * (MW[21] + MW[23] + MW[32] + MW[33]) + _boardingpen*(mw[31]+1) + _xferpen * MW[31]
    _tot = _ivt + _ovt
  IF (I=={FromNode} && J=={ToNode}) LIST="Walk-Bus  pk",_ivt(10.2),_pth(10.2),_ovt(10.2),_tot(10.2)
  IF (((MW[11]>0) && (MW[11]<_tot))||(_ivt==0))
    MW[21]=0, MW[22]=0, MW[23]=0, MW[24]=0, MW[25]=0
    MW[26]=0, MW[27]=0, MW[28]=0, MW[29]=0, MW[30]=0
    MW[31]=0,  MW[32]=0, MW[33]=0, MW[34]=0, MW[35]=0
  ENDIF
  
    ; Walk-bus - off-peak (60 series)
    _ivt = MW[64] + MW[65] + MW[66] + MW[67] + MW[68] + MW[69] + MW[70]
    _pth = MW[64] + MW[66]
    _ovt = MW[62] + _ovtam * (MW[61] + MW[63] + MW[72] + MW[73])  + _boardingpen*(mw[71]+1) + _xferpen * MW[71]
    _tot = _ivt + _ovt
  IF (I=={FromNode} && J=={ToNode}) LIST="Walk-Bus  op",_ivt(10.2),_pth(10.2),_ovt(10.2),_tot(10.2)
  IF (((MW[11]>0) && (MW[11]<_tot)) || (_ivt==0))
    MW[61]=0, MW[62]=0, MW[63]=0, MW[64]=0, MW[65]=0
    MW[66]=0, MW[67]=0, MW[68]=0, MW[69]=0, MW[70]=0
    MW[71]=0,MW[72]=0, MW[73]=0, MW[74]=0, MW[75]=0
  ENDIF
   
ENDJLOOP
ENDRUN


; Script for program MATRIX in file "C:\d3\N\APPLICATIONS\TRMAT00G.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="C:\d3\N\APPLICATIONS\TRMAT00F.PRN" MSG='Path-Conditioning Auto'
FILEO MATO[2] = "{SCENARIO_DIR}\output\TSKIMOP3.{alt}{year}",
MO=61-75
FILEO MATO[1] = "{SCENARIO_DIR}\output\TSKIMPK3.{alt}{year}",
MO=21-35
FILEI LOOKUPI[1] = "{CATALOG_DIR}\parameters\TRN_COEFFICIENTS.DBF"
FILEI MATI[2] = "{SCENARIO_DIR}\output\TSKIMMD3_{alt}{year}.MAT"
FILEI MATI[1] = "{SCENARIO_DIR}\output\TSKIMAM3_{alt}{year}.MAT"
DistributeINTRAStep ProcessID="FSUTMSDist" ProcessList=1-4

 ZONEMSG=100

 ; Check skims to see if they have required IVT

 LOOKUP NAME=COEFF,
     LOOKUP[1]=1,
     RESULT=3,
     FAIL=0,0,0,
     LIST=Y,
     INTERPOLATE=N,
     LOOKUPI=1

 _ovtam =COEFF(1,3)/COEFF(1,1)     ; out-of-vehicle time factor (OVT time and Wait factor)
 valtime   =0.6*COEFF(1,1)/COEFF(1,4) ; value of time (in $/hr)
 aatfactor =COEFF(1,5)/COEFF(1,1)     ; drive access to transit time factor
 _xferpen=COEFF(1,6)/COEFF(1,1)     ; transfer penalty
 _boardingpen = 2.0

 ; Check skims to see if they are better than the all-walk path & if they have required IVT
 FILLMW MW[21]=MI.1.1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 FILLMW MW[61]=MI.2.1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 
 LOOP x=1,4
  LOOP y=1,15
      _idx=20 + 20*(x-1) + y
   IF((_idx%20)=14)
      COMP total = ROWFAC(_idx,100.0)
   ENDIF
  ENDLOOP
 ENDLOOP

 JLOOP

  IF (I=={FromNode} && J=={ToNode}) LIST="Trace ",I(5.0),"-",J(5.0)
  IF (I=={FromNode} && J=={ToNode}) LIST="            ","       IVT","      Path","      wOVT","      wTOT"

    ; Auto-bus - peak (20 series)
    _ivt = MW[24] + MW[25] + MW[26] + MW[27] + MW[28] + MW[29] + MW[30]
    _pth = MW[24] + MW[26]
    _ovt = MW[22] + _ovtam * (MW[21] + MW[23] + MW[32] + MW[33])
    _tot = _ivt + _ovt
  IF (I=={FromNode} && J=={ToNode}) LIST="Auto-Bus  pk",_ivt(10.2),_pth(10.2),_ovt(10.2),_tot(10.2)
  IF (_ivt==0)
    MW[21]=0, MW[22]=0, MW[23]=0, MW[24]=0, MW[25]=0
    MW[26]=0, MW[27]=0, MW[28]=0, MW[29]=0, MW[30]=0
    MW[31]=0, MW[32]=0, MW[33]=0, MW[34]=0, MW[35]=0
  ENDIF
    
    _ivt = MW[23] + MW[24] + MW[25] + MW[26] + MW[27]
    _pth = MW[23]
    _ovt = MW[22] + _ovtam * (MW[21] + MW[29] + MW[30])
    _tot = _ivt + _ovt
  IF(I=={FromNode} && J=={ToNode}) LIST="            ",_ivt(10.2),_pth(10.2),_ovt(10.2),_tot(10.2)

   ; Auto-bus - off-peak (60 series)
    _ivt = MW[64] + MW[65] + MW[66] + MW[67] + MW[68] + MW[69] + MW[70]
    _pth = MW[64] + MW[66]
    _ovt = MW[62] + _ovtam * (MW[61] + MW[63] + MW[72] + MW[73])
    _tot = _ivt + _ovt
  IF (I=={FromNode} && J=={ToNode}) LIST="Auto-Bus  op",_ivt(10.2),_pth(10.2),_ovt(10.2),_tot(10.2)
  IF (_ivt==0)
    MW[61]=0, MW[62]=0, MW[63]=0, MW[64]=0, MW[65]=0
    MW[66]=0, MW[67]=0, MW[68]=0, MW[69]=0, MW[70]=0
    MW[71]=0,  MW[72]=0, MW[73]=0, MW[74]=0, MW[75]=0
  ENDIF
   
    _ivt = MW[63] + MW[64] + MW[65] + MW[66] + MW[67]
    _pth = MW[63]
    _ovt = MW[62] + _ovtam * (MW[61] + MW[69] + MW[70])
    _tot = _ivt + _ovt
  IF(I=={FromNode} && J=={ToNode}) LIST="            ",_ivt(10.2),_pth(10.2),_ovt(10.2),_tot(10.2)
   
 ENDJLOOP

ENDRUN


; PILOT Script





*echo Transit Paths/Skims                               = %date%  %time% >>{SCENARIO_DIR}\Output\runtime.prn
; End of PILOT Script

; PILOT Script

DistributeMULTISTEP ProcessID="FSUTMSDist", ProcessNum=1

; End of PILOT Script

; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\STPTR00K.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="{SCENARIO_DIR}\output\STPTR00I2.PRN" MSG='pnr-bus stop to stop file'
FILEI ROUTEI[1] = "{SCENARIO_DIR}\output\TPATHAM3_{Alt}{year}.RTE"
FILEI NETI = "{SCENARIO_DIR}\output\PKauto.NET"
FILEO REPORTO = "{SCENARIO_DIR}\output\STPTR00J2.PRN"
FILEO STOP2STOPO = "{SCENARIO_DIR}\output\ST2STPK3_{alt}{year}.DBF",
     ACCUMULATE=firstlast, MODES=21,23, N={NODEMIN}-99999

PARAMETERS NOROUTEERRS=99999999, NOROUTEMSGS=99999999,USERCLASSES=1,HDWAYPERIOD=1,
           TRIPSIJ[1]=10

ENDRUN


; Script for program MATRIX in file "C:\d3\N\APPLICATIONS\STMAT00A.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\STMAT00A.PRN" MSG='Write out station zone, parking cost and terminal time to matrix'
FILEO MATO[1] = "{SCENARIO_DIR}\output\ST2STPK_bus_{alt}{year}.MAT",
 MO=1,21-24,
 NAME=FromStation_pnrb,StationTAZ_pnrb,PKParkCost_pnrb,termtimpnr,termtimknr
FILEI LOOKUPI[1] = "{SCENARIO_DIR}\output\STATION_{alt}{year}.DAT"
FILEI MATI[1] = "{SCENARIO_DIR}\output\ST2STPK3_{alt}{year}.DBF",
 PATTERN=IJM:V FIELDS=I,J,0,FROMNODE

PAR ZONES={ZONESA} zonemsg=100

;STATION PARKING COST INTO A LOOKUP TABLE - station, statnumber, spaces,pnrterm,knrterm,nearestzone(distance),nearestzone(statdata input),ampnrcost,mdpnrcost

LOOKUP LOOKUPI=1, 
  NAME=STATIONS,
  LOOKUP[1]=2, RESULT=3,; STATION ZONE
  LOOKUP[2]=2, RESULT=6,; Peak Period Pakring Cost
  LOOKUP[3]=2,result=8,
  LOOKUP[4]=2,result=9,
  FAIL=0

  MW[1]=MI.1.1 

JLOOP
 ;FIRST FIGURE OUT THE STATION EQUIVALENT FOR EACH CELL, 0 IF NO MATCH
 ;NEXT, ASSIGN THE STATION EQUIVALENT FOR EACH CELL TO A WORK MATRIX
  STATZONE1=STATIONS(1,MW[1][J],0)
  PARKINGCOST1=STATIONS(2,MW[1][J],0)
  termtimpnr=stations(3,MW[1][j],0)
  termtimknr=stations(4,MW[1][j],0)
  MW[21][J]=STATZONE1
  MW[22][J]=PARKINGCOST1
  MW[23][j]=termtimpnr
  MW[24][j]=termtimknr

; If no station for a zone, write 0 as the station
 IF(MW[21][J] == 0) MW[1][J]=0

ENDJLOOP

ENDRUN


; Script for program PUBLIC TRANSPORT in file "C:\d3\N\APPLICATIONS\STPTR00O.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="{SCENARIO_DIR}\output\STPTR00Q2.PRN" MSG='pnr-bus stop to stop file'
FILEI ROUTEI[1] = "{SCENARIO_DIR}\output\TPATHMD3_{Alt}{year}.RTE"
FILEI NETI = "{SCENARIO_DIR}\output\OPauto.NET"
FILEO REPORTO = "{SCENARIO_DIR}\output\STPTR00R2.PRN"
FILEO STOP2STOPO = "{SCENARIO_DIR}\output\ST2STOP3_{alt}{year}.DBF",
     ACCUMULATE=firstlast, MODES=21,23, N={NODEMIN}-99999

PARAMETERS NOROUTEERRS=99999999, NOROUTEMSGS=99999999,USERCLASSES=1,HDWAYPERIOD=2,
           TRIPSIJ[1]=10

ENDRUN


; Script for program MATRIX in file "C:\d3\N\APPLICATIONS\STMAT00D.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\STMAT00C.PRN" MSG='Write out station zone, parking cost and terminal time to matrix'
FILEI LOOKUPI[1] = "{SCENARIO_DIR}\output\STATION_{alt}{year}.DAT"
FILEI MATI[1] = "{SCENARIO_DIR}\output\ST2STOP3_{alt}{year}.DBF",
 PATTERN=IJM:V FIELDS=I,J,0,FROMNODE
FILEO MATO[1] = "{SCENARIO_DIR}\output\ST2STOP_bus_{alt}{year}.MAT",
 MO=1,21-24,
 NAME=FromStation_pnrb,StationTAZ_pnrb,OPParkCost_pnrb,termtimpnr,termtimknr
    
PAR ZONES={ZONESA} zonemsg=100

; STATION PARKING COST INTO A LOOKUP TABLE
;station, statnumber, spaces,pnrterm,knrterm,nearestzone(distance),nearestzone(statdata input),ampnrcost,mdpnrcost

LOOKUP LOOKUPI=1, 
  NAME=STATIONS,
  LOOKUP[1]=2, RESULT=3,; STATION ZONE
  LOOKUP[2]=2, RESULT=7,
  LOOKUP[3]=2,result=8,
  LOOKUP[4]=2,result=9,; Off-Peak Period Pakring Cost
  FAIL=0

  MW[1]=MI.1.1

JLOOP
 ;FIRST FIGURE OUT THE STATION EQUIVALENT FOR EACH CELL, 0 IF NO MATCH
 ;NEXT, ASSIGN THE STATION EQUIVALENT FOR EACH CELL TO A WORK MATRIX
  STATZONE1=STATIONS(1,MW[1][J],0)
  PARKINGCOST1=STATIONS(2,MW[1][J],0)
  termtimpnr=stations(3,MW[1][j],0)
  termtimknr=stations(4,MW[1][j],0)

  MW[21][J]=STATZONE1
  MW[22][J]=PARKINGCOST1
  MW[23][j]=termtimpnr
  MW[24][j]=termtimknr

  ; If no station for a zone, write 0 as the station
  IF(MW[21][J] == 0) MW[1][J]=0

ENDJLOOP

ENDRUN


; Script for program MATRIX in file "C:\d3\N\APPLICATIONS\STMAT00G.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\STMAT00E.PRN" MSG='STATION TO STATION MATRIX'
FILEO MATO[1] = "{SCENARIO_DIR}\output\ST2ST_{alt}{year}.MAT",
 MO=1-8,NAME=PKStationTAZ_pnrb,PKParkCost_pnrb,termtimpnr,termtimknr,             
              OPStationTAZ_pnrb,OPParkCost_pnrb,termtimpnr,termtimknr
              

FILEI MATI[3] = "{SCENARIO_DIR}\output\ST2STOP_bus_{alt}{year}.MAT"
FILEI MATI[1] = "{SCENARIO_DIR}\output\ST2STPK_bus_{alt}{year}.MAT"

zonemsg=100

; pull out only station zone number
FILLMW MW[1] =MI.1.2   ; pk pnr-transit    Station TAZ
FILLMW MW[2] =MI.1.3   ;                   Parking Cost
FILLMW MW[3] =MI.1.4   ;                  PNR Terminal Time
FILLMW MW[4] =MI.1.5   ;                   KNR Terminal Time
FILLMW MW[5] =MI.3.2   ; op pnr-transit
FILLMW MW[6] =MI.3.3
FILLMW MW[7] =MI.3.4
FILLMW MW[8] =MI.3.5

ENDRUN


; PILOT Script



EndDistributeMULTISTEP
; End of PILOT Script

