LOOP LegLink = 1, 2, 1

; PILOT Script



if (LegLink=1)
ReadLoop1=' '
ReadLoop2=';' 
else
ReadLoop1=';'
ReadLoop2=' '
endif
; End of PILOT Script

; Script for program MATRIX in file "D:\JOB\D3\Model\A\APPLICATIONS\TSMAT00A.S"

; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="D:\JOB\D3\Model\A\APPLICATIONS\TSMAT00A.PRN" MSG='Combine trips'
FILEI MATI[1] = "{SCENARIO_DIR}\output\TRANSITTAB_{alt}{year}.MAT"
FILEO MATO[1] = "{SCENARIO_DIR}\output\tloadam_{alt}{year}.mat",
  MO=1-2,NAME=WalkTran,AutoTran

ZONEMSG=100

FILLMW MW[11]=MI.1.1,2,3

COMP total = ROWADD(1,11)
COMP total = ROWADD(2,12,13)

ENDRUN


; Script for program PUBLIC TRANSPORT in file "D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00A.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00A.PRN" MSG='Assignment - WalkBus'
FILEO NETO = "{SCENARIO_DIR}\output\TLOADPK1_{alt}{year}.NET"
FILEO LINKO = "{SCENARIO_DIR}\output\TLINKPK1_{alt}{year}.DBF",
@ReadLoop2@       NTLEGS=T,ONOFFS=T
@ReadLoop1@       ONELINKREC=T,NTBYLINK=T

FILEI NETI = "{SCENARIO_DIR}\output\PKWalk.NET"
FILEI ROUTEI[1] = "{SCENARIO_DIR}\Output\TPATHAM1_{alt}{year}.RTE"
FILEI MATI[1] = "{SCENARIO_DIR}\output\tloadam_{alt}{year}.mat"
FILEO REPORTO = "{SCENARIO_DIR}\output\TLOADPK1_{alt}{year}.RPT"

; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1, NOROUTEERRS=999999, NOROUTEMSGS=999999,
                HDWAYPERIOD=1,
                TRIPSIJ[1]=MI.1.WalkTran
                            
REPORT LINES=T, LINEVOLS=T, STOPSONLY=T

ENDRUN


; Script for program PUBLIC TRANSPORT in file "D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00I.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00F.PRN" MSG='Assignment - AutoBus'
FILEI ROUTEI[1] = "{SCENARIO_DIR}\Output\TPATHAM3_{alt}{year}.RTE"
FILEI MATI[1] = "{SCENARIO_DIR}\output\tloadam_{alt}{year}.mat"
FILEO NETO = "{SCENARIO_DIR}\output\TLOADPK3_{alt}{year}.NET"
FILEO LINKO = "{SCENARIO_DIR}\output\TLINKPK3_{alt}{year}.DBF",
 @ReadLoop2@       NTLEGS=T,ONOFFS=T
   @ReadLoop1@       ONELINKREC=T,NTBYLINK=T

FILEI NETI = "{SCENARIO_DIR}\output\PKAuto.NET"
FILEO REPORTO = "{SCENARIO_DIR}\output\TLOADPK3_{alt}{year}.RPT"
FILEO STOP2STOPO = "{SCENARIO_DIR}\output\STATIONPK2_{alt}{year}.DBF",
  ACCUMULATE=FIRSTLAST, NODES=1-99999
; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1, NOROUTEERRS=999999, NOROUTEMSGS=999999,
                HDWAYPERIOD=1,
              
                TRIPSIJ[1]=MI.1.AutoTran
           
REPORT LINES=T, LINEVOLS=T, STOPSONLY=T

ENDRUN


; Script for program MATRIX in file "D:\JOB\D3\Model\A\APPLICATIONS\TSMAT00C.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="D:\JOB\D3\Model\A\APPLICATIONS\TSMAT00C.PRN" MSG='Combine trips'
FILEI MATI[1] = "{SCENARIO_DIR}\output\TRANSITTAB_{alt}{year}.MAT"
FILEO MATO[1] = "{SCENARIO_DIR}\output\tloadmd_{alt}{year}.mat",
  MO=1-2,NAME=WalkTran,AutoTran

DistributeINTRAStep ProcessID="FSUTMSDist" ProcessList=1-4

ZONEMSG=100

FILLMW MW[21] =MI.1.4,5,6
COMP total = ROWADD(1,21)
COMP total = ROWADD(2,22,23)

ENDRUN


; Script for program PUBLIC TRANSPORT in file "D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00C.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00E.PRN" MSG='Assignment - WalkBus'
FILEI MATI[1] = "{SCENARIO_DIR}\output\tloadmd_{alt}{year}.mat"
FILEO NETO = "{SCENARIO_DIR}\output\TLOADOP1_{alt}{year}.NET"
FILEO LINKO = "{SCENARIO_DIR}\output\TLINKOP1_{alt}{year}.DBF",
 @ReadLoop2@       NTLEGS=T,ONOFFS=T
   @ReadLoop1@       ONELINKREC=T,NTBYLINK=T


FILEI NETI = "{SCENARIO_DIR}\output\OPWalk.NET"
FILEI ROUTEI[1] = "{SCENARIO_DIR}\Output\TPATHMD1_{alt}{year}.RTE"
FILEO REPORTO = "{SCENARIO_DIR}\output\TLOADOP1_{alt}{year}.RPT"

; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1, NOROUTEERRS=999999, NOROUTEMSGS=999999,
                HDWAYPERIOD=2,
                TRIPSIJ[1]=MI.1.WalkTran
                             
REPORT LINES=T, LINEVOLS=T, STOPSONLY=T

ENDRUN


; Script for program PUBLIC TRANSPORT in file "D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00K.S"
; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=PUBLIC TRANSPORT PRNFILE="D:\JOB\D3\Model\A\APPLICATIONS\TSPTR00N.PRN" MSG='Assignment - AutoBus'
FILEI ROUTEI[1] = "{SCENARIO_DIR}\Output\TPATHMD3_{alt}{year}.RTE"
FILEI MATI[1] = "{SCENARIO_DIR}\output\tloadmd_{alt}{year}.mat"
FILEO NETO = "{SCENARIO_DIR}\output\TLOADOP3_{alt}{year}.NET"
FILEO LINKO = "{SCENARIO_DIR}\output\TLINKOP3_{alt}{year}.DBF",
 @ReadLoop2@       NTLEGS=T,ONOFFS=T
   @ReadLoop1@       ONELINKREC=T,NTBYLINK=T

FILEI NETI = "{SCENARIO_DIR}\output\OPAuto.NET"
FILEO REPORTO = "{SCENARIO_DIR}\output\TLOADOP3_{alt}{year}.RPT"
FILEO STOP2STOPO = "{SCENARIO_DIR}\output\STATIONOP2_{alt}{year}.DBF",
  ACCUMULATE=FIRSTLAST, NODES=1-99999
; OVERALL PARAMETERS
PARAMETERS USERCLASSES=1, NOROUTEERRS=999999, NOROUTEMSGS=999999,
                HDWAYPERIOD=2,

                TRIPSIJ[1]=MI.1.AutoTran

REPORT LINES=T, LINEVOLS=T, STOPSONLY=T

ENDRUN


ENDLOOP

