; Script for program PUBLIC TRANSPORT in file "D:\JOB\D3\MODEL\NEW\APPLICATIONS\TPPTR00A.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\TPPTR00A.PRN" MSG='Build peak access connectors'
FILEI NETI = "{SCENARIO_DIR}\output\HWYLOAD2_{Alt}{Year}.NET"
FILEO NETO = "{SCENARIO_DIR}\output\NTLEGPK.NET"
FILEO NTLEGO = "{SCENARIO_DIR}\output\NTLEGPK_{year}{alt}.TEM"
FILEO REPORTO = "{SCENARIO_DIR}\output\TPPTR00B.PRN"
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 OF RUN
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[27]=LI.M27TIMEPK

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

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

PROCESS PHASE=DATAPREP

  ; 1 - Generate Walk Access Connectors
  GENERATE, COST=(LW.WALKDISTANCE),EXTRACTCOST=(LW.WALKTIME),MAXCOST=200*{WALKACC},LIST=T,EXCLUDELINK=(LI.FACILITY_TYPE=10-19,69,70-99),
            NTLEGMODE=1,MAXNTLEGS=200*{MAXWLKACCLNKS},DIRECTION=3,ONEWAY=F,FROMNODE=1-{ZONESA},TONODE={NODEMIN}-99999

 ; 4 - Generate All-Walk Connectors
  GENERATE, COST=(LW.WALKDISTANCE),EXTRACTCOST=(LW.WALKTIME),MAXCOST=200*7,LIST=T,EXCLUDELINK=(LI.FACILITY_TYPE=10-19,69,70-99),
            NTLEGMODE=4,MAXNTLEGS=200*{MAXWLKACCLNKS},DIRECTION=3,ONEWAY=F,FROMNODE=1-{ZONESA},TONODE=1-{ZONESA}

  ; 11 - If micro-coding exists, generate Fixed-guideway to bus transfer connectors
   IF ({isMicroCode} <> 0)
   GENERATE, COST=(LW.DISTANCE),EXTRACTCOST=(LI.WALKTIME),MAXCOST=200*{WALKACC},LIST=T,INCLUDELINK=(LI.FACILITY_TYPE=59),
            NTLEGMODE=11,MAXNTLEGS=200*{MAXWLKACCLNKS},DIRECTION=3,ONEWAY=F,FROMNODE={NODEMIN}-99999,TONODE={NODEMIN}-99999
  endif

  ; 12 - Generate CBD sidewalk connectors
   READ, FILE = "{SCENARIO_DIR}\OUTPUT\CBDXFER_TMP.DAT"
ENDPROCESS

ENDRUN


