Modelling Transport - Cube Guidebook
Modelling Transport - Cube Guidebook
Examples based on the book Modelling Transport, 4th edition by Ortuzar/Willumsen ( 2011 John Wiley & Sons, Ltd) Citilabs 2011
Main Menu
About Cube : a brief intro to the modelling system and its modules About the tutorial : The Guide and Book in tandem Click on the app boxes below to get to the examples
3: 4: 5: 6: 8: 10 11 12 14
Data and Storage Trip Generation Modelling Trip Distribution Modelling Modal Split and Direct Demand Models Specification and Estimation of Discrete Choice Models : Assignment : Equilibrium and Dynamic Assignment : Simplified Transport Demand Models : Activity Based Models
Modeling Extensions for ArcGIS modeling and analysis tools for non-modelers
Click to edit Master text s Second level Third level Specialized Fourth level Cube Cluster: reduces run-times by allocating calculations over multiple processors and machines Fifth level
Overview
Easy to use environment to create, test, manage and analyze scenarios. Menus to prompt user for inputs and parameters of test Integrated report and charting generators to assist in the analysis
Overview
Famous for its flow-charting environment for designing and building transportation models
Modules are accessed through pull-down menus Dropped into a flow chart Data inputs and outputs linked by drag-and-drop
Overview
Only modeling system that comes with a complete transportation GIS built on ESRIs marketing leading GIS technology. Store all data directly in ESRIs geodatabase format. No need to convert data back and forth between the GIS department and the modeling team ArcGIS Extension for network editing (Sugar)
Overview
Cube GIS
Click-drag-drop
functionality for all typical modelling tasks Cube integrates GIS powered by ESRI Uses ESRI geodatabase technology Supports other formats; Shape, CAD, Raster
Flow-chart system for model design, coding and documentation Visual creation of the model macro Gives direct access to data and scripts
Highlights key model parameters and data for easy creation and testing of scenarios Creates customised run menu for defining and running scenarios Provides easy links to main output data for viewing and comparing
Cube Reports
Charts and Tables integrated in model View and compare scenario specific statistics
Open system
Seamless links to other software Microsoft Office (Access, Excel) User programs
This system of Cube modelling tutorials is based on Modelling Transport 4th Edition (the 'book') The book has been used since its first edition in 1990 by transport modellers around the world to find and select appropriate methods to their modelling tasks and for understanding the theoretic base behind these methods The book includes a wealth of examples of how to model, in terms of approach and mathematics, the various aspects of transport. This guide provides a set of applications showing the examples of the book coded up in Cube scripts, grouped according to the book's chapters.
find and study the appropriate method in the book study the relevant example in the book see how this example is coded in Cube use the script as a base for your model and its data
read the relevant chapter/model type and its modelling methods in the book study the examples see how these example are coded in Cube
About the 'book' : About the MT Cube Guide : Modelling Transport 4th Edition, 2011 John Wiley & Sons, Version 1.0 September 2011 Authors : Citilabs professionals Ltd Authors : Juan de Dios Ortuzar Citilabs 2011 Luis G. Willumsen
Modelling Transport" 4th Edition, John Wiley & Sons Available from http:// eu.wiley.com/WileyCDA/WileyTitle/productCd-0470760397.html Also available from www.Amazon.com and www.Amazon.co.uk Available as hard copy and electronic book for Kindle, iPad and other tablets The authors have been involved with transport modelling research for over 40 years Juan de Dios Ortuzar Luis (Pilo) Willumsen
Present
Professor of Transport Engineering at Pontificia Universidad Catlica de Chile Advisor to governments and international agencies
Present
Past
Director of Luis Willumsen Consultancy Visiting Professor at University College London Researcher at Leeds University and University College London Board Director at Steer Davies Gleave
This guide will make it easier for modellers to put the lessons learned in the book to practical use in models The main purpose of this guide is to promote sound modeling practices based on established methods described and discussed in the book This guide is also meant to encourage the modelling community to keep up to date on modeling methods and principles; the book is an ideal starting point
The main page with links to the apps with examples from each chapter of the book
BACK
BACK
RUN PGM=MATRIX PRNFILE="C4MAT00B.PRN" MSG='Example 4.1 - Future Year - Growth-factor method' FILEI DBI[3] = "C:\Modelling Transport_CG\Output\Chapter4\Results_4_1_BaseYear.DBF", SORT=Z FILEI DBI[2] = "C:\Modelling Transport_CG\Input\Chapter4\SocioEconData_4_1_FY.dbf", SORT=Z FILEO RECO[1] = "C:\Modelling Transport_CG\Output\Chapter4\Results_4_1_FutureYear.DBF", FIELDS=Z GEN FILEI DBI[1] = "C:\Modelling Transport_CG\Input\Chapter4\SocioEconData_4_1_BY.dbf"
BACK
RUN PGM=MATRIX PRNFILE="CHAPTER4\C4MAT00C.PRN" MSG='Example 4.1 - Future Year - Applying Trip Rates' FILEO RECO[1] = "C:\Modelling Transport_CG\Output\Chapter4\Results_4_1_FutureYear_TR.DBF", FIELDS=Z, GEN FILEI DBI[1] = "C:\Modelling Transport_CG\Input\Chapter4\SocioEconData_4_1_FY.dbf"
BACK
BACK
NEXT
BACK
BACK
NEXT
NEXT
BACK
zi.1.HH3 + 1.778 * zi.1.HH4) zi.1.HH3 + 0.500 * zi.1.HH4) zi.1.HH3 + 1.524 * zi.1.HH4) + 0.5 * zi.1.OTHER + 0.9 * zi.1.HOUSEHOLDS + 0.5 * zi.1.OTHER + 0.9 * zi.1.HOUSEHOLDS
BACK
BACK
MW[1]=MI.1.1*{tau} ENDRUN
BACK
BACK
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5MAT02B.PRN, MSG='Example 5.2 - Expanded origin-constrained growth trip table' FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter5\Base_year_trip_matrix_5_1.dbf", PATTERN=IJ:V FIELDS=O D TRIPS FILEO MATO[1] = "C:\Modelling Transport_CG\Output\Chapter5\Future_estimated_trip_matrix_5_2.MAT", MO=1 DEC=1*5 NAME="Future matrix" FILEI LOOKUPI[2] = "C:\Modelling Transport_CG\Input\Chapter5\Target_Oi_future_year_5_2.dbf" FILEI LOOKUPI[1] = "C:\Modelling Transport_CG\Output\Chapter5\Total_number_of_trips_generated_Base_year_5_2.DBF" LOOKUP LOOKUPI=1, NAME=Base, LOOKUP[1]=ZONE, RESULT=SUM_J, FAIL[3]=0 LOOKUP LOOKUPI=2, NAME=Future, LOOKUP[1]=ZONE, RESULT=OI, FAIL[3]=0 ;Set parameters and array PAR ZONES=4 ARRAY TAU=4 ;read tij MW[1]=MI.1.1 ; calculate (tau)I : (tau)i=Ti/ti ; Future(1,I)=Ti totals generated per zone in future matrix; Base(1,I)=Ti totals generated per zone in base year TAU[I]=Future(1,I)/Base(1,I) ;multiply each origin-destination value per origin values (same value per each row in the matrix) MW[1]=MW[1]*TAU[I] ENDRUN
BACK
BACK
RUN PGM=FRATAR PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5FRA02A.PRN, MSG='Example 5.2 - alternative way using FRATAR' FILEI LOOKUPI[2] = "C:\Modelling Transport_CG\Output\Chapter5\Total_number_of_trips_generated_Base_year_5_2.DBF" FILEI MATI[1] = {MATI.Q}, PATTERN=IJ:V FIELDS=O D TRIPS FILEI LOOKUPI[1] = {LOOKUPI.Q} FILEO MATO[1] = {MATO.Q}, MO=1,NAME=FACTOREDMAT, DEC=1*D
BACK
BACK
BACK
Ch5-TDM: Ex5.3 Doubly constrained distribution template system This example uses Cubes
BACK
This is a script generated by a template The FILEI, FILEO and parameter settings come from the dialog on the previous slide
BACK
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5MAT03B.PRN, MSG='Example 5.3 - step (2)' FILEO PRINTO[1] = "C:\Modelling Transport_CG\Output\Chapter5\ai_and_bj_values_5_3.txt", APPEND=T FILEI LOOKUPI[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5LOO03A.DBF" FILEI MATI[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5LOO03A.MAT", PATTERN=IJ:V FIELDS=O D TRIPS FILEO MATO[1] = "C:\Modelling Transport_CG\Output\Chapter5\Future_estimated_trip_matrix_5_3_1.MAT", MO=1 DEC=1*6 NAME="Step 2" FILEI LOOKUPI[2] = "C:\Modelling Transport_CG\Input\Chapter5\Target_Oi_Dj_future_year_5_3.dbf" LOOKUP LOOKUPI=1, NAME=Base, LOOKUP[1]=ZONE, RESULT=SUM_J, FAIL[3]=0 LOOKUP LOOKUPI=2, NAME=Future, LOOKUP[1]=ZONE, RESULT=OI, FAIL[3]=0 ;calculate (tau)i (as example 5.2) ;set parameters and array PAR ZONES=4 ARRAY TAU=4 ;base matrix MW[1]=MI.1.1 ;(tau)i=Ti/ti TAU[I]=Future(1,I)/Base(1,I) ;multiply base matrix per (tau)i MW[1]=MW[1]*TAU[I] PRINT PRINTO=1 LIST='Iteration: ', @IDLOOP@(L) ' Zone ', I(L), ' ai= ' ENDRUN
TAU[I](10.5)
BACK
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5MAT03C.PRN" MSG='Example 5.3 - step(3)' FILEO PRINTO[1] = "C:\Modelling Transport_CG\Output\Chapter5\ai_and_bj_values_5_3.txt", APPEND=T FILEI LOOKUPI[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5MAT03B.DBF" FILEI MATI[1] = "C:\Modelling Transport_CG\Output\Chapter5\Future_estimated_trip_matrix_5_3_1.MAT" FILEO MATO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E5MAT03C.MAT", MO=1 DEC=1*6 NAME="Step 2" FILEI LOOKUPI[2] = "C:\Modelling Transport_CG\Input\Chapter5\Target_Oi_Dj_future_year_5_3.dbf" LOOKUP LOOKUPI=1, NAME=Base, LOOKUP[1]=ZONE, RESULT=SUM_I, FAIL[3]=0 LOOKUP LOOKUPI=2, NAME=Future, LOOKUP[1]=ZONE, RESULT=DJ, FAIL[3]=0 ;calculate (tau)j (as example 5.2 but with a transposed matrix, since we have to work on destinations) ;set parameters and array PAR ZONES=4 ARRAY TAU=4 ;base matrix MW[1]=MI.1.1.T ;this is the transposed matrix ;(tau)j=Tj/tj TAU[I]=Future(1,I)/Base(1,I) ;multiply base matrix per (tau)j MW[1]=MW[1]*TAU[I] PRINT PRINTO=1 LIST='Iteration: ', @IDLOOP@(L) ' Zone ', I(L), ' bj= ' ENDRUN TAU[I](10.5)
BACK
BACK
Ch5-TDM: Ex5.4 - Properties of the Gravity Model script file boxes below to see the scripts Click on the
Only first two program boxes and their scripts are shown
BACK
BACK
BACK
This is a script generated by a template The FILEI, FILEO and parameter settings come from the dialog on the previous slide
BACK
BACK
BACK
Ch5-TDM: Ex5.5 Bi-proportional Fitting, step 2 uses Cubes template system This example
BACK
This is a script generated by a template The FILEI, FILEO and parameter settings come from the dialog on the previous slide
BACK
Ch5-TDM: Ex5.5 Bi-proportional Fitting, step 3 uses Cubes template system This example
BACK
This is a script generated by a template The FILEI, FILEO and parameter settings come from the dialog on the previous slide
BACK
Ch5-TDM: Ex5.6 A Tri-proportional Click on the script Problem file boxes below to see the scripts
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E6MAT06A.PRN, MSG='Example 5.6 - costs and delta_ijm' FILEO MATO[2] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E6MAT06H.MAT", MO=2 NAME='Delta mij' FILEI MATI[2] = "C:\Modelling Transport_CG\Output\Chapter5\Base_year_trip_matrix_5_3_A.MAT" FILEO RECO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E6MAT06A.DBF", FIELDS=TOTAL_E(18.10) TOTAL_F(18.10) TAU(18.10) FILEI DBI[1] = "C:\Modelling Transport_CG\Input\Chapter5\Target_TLD_future_year_5_6.dbf",SORT=RANGE_MIN RANGE_MAX FILEO RECO[2] = "C:\Modelling Transport_CG\Output\Chapter5\Delta_ijm.DBF", FIELDS=M I J DELTA FILEI ZDATI[1] = "C:\Modelling Transport_CG\Input\Chapter5\Target_Oi_Dj_future_year_5_3.dbf", Z=ZONE FILEO MATO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER5\E6MAT06A.MAT", MO=3 DEC=1*5 NAME="Base Matrix" FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter5\Cost_matrix_base_year_5_4.dbf", PATTERN=IJ:V FIELDS=O D TIME ;set parameters and array PAR ZONES=4 ARRAY CLASS_MIN =6 ;minimum in the n class ARRAY CLASS_MAX =6 ;maximum in the n class ;read ranges per each class IF(I=1) LOOP K=1,DBI.1.NUMRECORDS C=DBIReadRecord(1,K) MCLASS=DI.1.M RMIN =DI.1.RANGE_MIN RMAX =DI.1.RANGE_MAX CLASS_MIN[MCLASS]=RMIN CLASS_MAX[MCLASS]=RMAX ENDLOOP ENDIF ; script continues on NEXT page
NEXT
NEXT
NEXT
BACK
NEXT
BACK
BACK
BACK
LOOKUP LOOKUPI=1, NAME=Base, LOOKUP[1]=ZONE, RESULT=SUM_I, FAIL[3]=0 LOOKUP LOOKUPI=2, NAME=Future, LOOKUP[1]=ZONE, RESULT=DJ, FAIL[3]=0 ;calculate bj (as example 5.2 but with a transposed matrix, since we have to work on destinations) ;set parameters and array PAR ZONES=4 ARRAY TAU=4 ;base matrix MW[1]=MI.1.1.T ;this is the transposed matrix ;bj=Tj/tj TAU[I]=Future(1,I)/Base(1,I) ;multiply base matrix per bj MW[1]=MW[1]*TAU[I] PRINT PRINTO=1 LIST='Iteration: ', @IDLOOP@(L) ' Zone ', I(L), ' bj= ' TAU[I](10.7) ENDRUN
BACK
NEXT
BACK
JLOOP ;calculate the future demand based on the formulation: ; Tij=ai*bj*(Sum)m*Fm*(delta)ijm MW[3]=MW[1]*DetFunction(1,MW[2]) ENDJLOOP ENDRUN
BACK
BACK
BACK
NEXT
BACK
BACK
Chapter 6: Modal Split and Direct Demand Click on the boxes below to select the various examples Models
BACK
BACK
XCHOICE, ALTERNATIVES=car, bus, ; list choices DEMANDMW = 3, ; input total demand COSTSMW= 1, 2, ; input costs ODEMANDMW= 4, 5, ; forecasted probabilities SPLIT= Total {beta6} car bus, ; Model structure SPLITCOMP= 6, ; Forecast composite cost STARTMW= 10 ; working matrices ;Note on SPLITCOMP : composite cost by mode ; Cij = - 1/beta*log(exp(-beta*CCar)+exp(-beta*CBus)) ENDRUN
BACK
BACK
XCHOICE, ALTERNATIVES=car, bbus, rbus, ; list choices DEMANDMW = 4, ; input total demand COSTSMW= 1, 2, 3, ; input costs ODEMANDMW= 5, 6, 7, ; Forecasted probabilities SPLIT= Total {beta6} car bbus rbus, ; Model structure SPLITCOMP= 8, ; Forecast composite cost STARTMW= 10 ; working matrices ;Note on SPLITCOMP : composite cost by mode ; Cij = - 1/beta*log(exp(-beta*CCar)+exp(-beta*CBus)) ENDRUN
BACK
Ch6-MSM: Ex6.3 Hierarchical Multinomial Splitthe script file boxes below to see the scripts Click on
BACK
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER6\E6MAT03D.PRN, MSG='Example 6.3 - Hierarchich Multimodal-split model using XCHOICE' FILEI MATI[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER6\E6MAT03C.MAT" FILEO MATO[1] = "C:\Modelling Transport_CG\Output\Chapter6\Probabilities_6_3.MAT", MO=5-9 Name='Car prob 'Blue Bus prob' 'Red Bus prob' 'Composite cost top level' 'Composite cost PT level' ;costs MW[1]=MI.1.1 ;car MW[2]=MI.1.2 ;blue bus MW[3]=MI.1.3 ;red bus ;demand JLOOP IF(I=1&&J=2) MW[4]=1 ;demand (just to calculate probabilities the demand is defined equal 1) ENDJLOOP XCHOICE, ALTERNATIVES=car, bbus, rbus, DEMANDMW = 4, COSTSMW= 1, 2, 3, ODEMANDMW= 5, 6, 7, ; Model structure SPLIT= Total {lambda1} car pt, SPLITCOMP= 8, SPLIT = PT {lambda2} bbus rbus, SPLITCOMP= 9, STARTMW= 10 ;list choices top level ;input total demand ;input costs ;Forecasted probabilities ;Top lebel nest ;Forecast composite cost top level ;PT nest ;Forecast composite cost PT level ;working matrices
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER6\E6MAT03A.PRN, MSG='Example 6.3 - Summary Table - see page 216' FILEI LOOKUPI[1] = "C:\Modelling Transport_CG\Input\Chapter6\Lambda1_values_6_3.dbf" FILEO PRINTO[1] = "C:\Modelling Transport_CG\Output\Chapter6\Probability_car_6_3.DAT", APPEND=T FILEI MATI[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER6\E6MAT03C.MAT" FILEO MATO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER6\E6MAT03A.MAT", MO=5-9 Name='Car prob' 'Blue Bus prob' 'Red Bus prob' 'Composite cost top level 'Composite cost PT level' LOOKUP LOOKUPI=1, NAME=Lambda1, LOOKUP[1]=ITER, RESULT=LAMBDA1, FAIL[3]=0 ; example of use: v=Lambda1_values_(1,25) ; look for 25 in the ITER field and returns the LAMBDA1 value ;costs MW[1]=MI.1.1 MW[2]=MI.1.2 MW[3]=MI.1.3 ;car ;blue bus ;red bus
Value=Lambda1(1,@IDLOOP@) ;demand JLOOP IF(I=1&&J=2) MW[4]=1 ;demand (just to calculate probabilities the demand is defined equal 1) ENDJLOOP ; script continues on NEXT page
NEXT
;Note on SPLITCOMP : composite cost by mode ; CB = CBB - 1/(lambda2)*log2 JLOOP IF(I=1&&J=2) PRINT PRINTO=1 CSV=F LIST='Lambda1: ', Value(5.3L), ' Car Probability: ',MW[5](5.3L) ENDJLOOP ENDRUN
BACK
Ch6-MSM: Ex6.4 Calibration of Binary Logit script file boxes below to see the scripts Click on the
BACK
;log[P1/(1-P1)]=log[P1/P2] depended variable ;C2 - C1 indipendent variable ;lambda - slope of the line ;lambda+delta - intercept Axis_x = C2-C1 Axis_y=LN(P1/(100-P1)) WRITE RECO=1 ENDRUN
BACK
NEXT
BACK
BACK
BACK
BACK
BACK
BACK
BACK
BACK
BACK
BACK
BACK
Headway[LEVEL][1]=RI.Headway Headway[LEVEL][2]=RI.Score + Headway[LEVEL][2] _MEAN=Headway[1][1] IF(I=0) LOOP K=1,3 RO.LEVEL=K RO.Headway=Headway[K][1] RO.DIFFERENCES=Headway[K][1]-Headway[K-1][1] RO.Rating=Headway[K][2]/3 RO.DifRating=(Headway[K][2]-Headway[K-1][2])/3 RO.RatingperP=(Headway[K][2]-Headway[K-1][2])/((Headway[K][1]-Headway[K-1][1])*3) WRITE RECO=1 ENDLOOP ENDIF ENDRUN
BACK
BACK
Ch10-AS: Ex10.2 All or Nothing Assignmentboxes below to see the scripts Click on the script file
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER10\E2HWY01A.PRN, MSG='Example 10.2 - All or Nothing assignment' FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter10\ODMAT_10_2.MAT" FILEO PATHO[1] = "C:\Modelling Transport_CG\Output\Chapter10\Paths_10_2.PTH" FILEO NETO = "C:\Modelling Transport_CG\Output\Chapter10\Output.mdb\LoadedNet_10_2" FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter10\Input.mdb\ExampleNet_10_2"
BACK
BACK
BACK
Ch10-AS: Ex10.6 Method of Successive Averages file box below to see the script (only full process (left box) Click on the script
included here) Refer to the Cube catalog to see scripts for step by step process
BACK
BACK
BACK
NEXT
IF (RGAP=0) BALANCE=1 PRINT LIST='ITERATION:', ITERATION(5.0), ' TOT_COST=0 ENDPROCESS ENDRUN TOTAL EXPENDITURE:', TOT_COST(10.0) PRINTO=1
BACK
BACK
NEXT
BACK
NEXT
IF (RGAP=0) BALANCE=1 PRINT LIST='ITERATION:', ITERATION(5.0), ' TOT_COST=0 ENDPROCESS ENDRUN TOTAL EXPENDITURE:', TOT_COST(10.0) PRINTO=1
BACK
Ch11-DA: Ex11.3 Equilibrium and Feedback file boxes below to see the scripts Click on the script
BACK
BACK
RUN PGM=PUBLIC TRANSPORT PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3PTR01A.PRN, MSG='Example 11.3 - Initial PT Costs' FILEO REPORTO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3PTR01B.PRN" FILEO ROUTEO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3PTR01A.RTE" FILEO MATO[1] = "C:\Modelling Transport_CG\Output\Chapter11\PTInitCosts_11_3.MAT", MO=1 DEC=9 NAME=PT_INIT_GCOSTS FILEI FACTORI[1] = "C:\Modelling Transport_CG\Input\Chapter11\FactorFile_11_3.FAC" FILEI SYSTEMI = "C:\Modelling Transport_CG\Input\Chapter11\SystemFile_11_3.PTS" FILEI LINEI[1] = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NETPT_11_3" FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NET_11_3" PARAMETERS TRANTIME = LW.TRANTIME ;PROCESS PHASE=NODEREAD ; loops over all nodes computes node based scalar and array variables (Optional) ;ENDPROCESS PROCESS PHASE=LINKREAD ; loops over all links Computes link based scalar and array variables (Optional) LW.TRANTIME=LI.T0 ENDPROCESS ; script continues on NEXT page
NEXT
ENDPROCESS PROCESS PHASE=SKIMIJ ; saves and manipulates skims for zone pairs, IJ (Optional - Required for Skimming) MW[1]=COMPCOST(0) ; composite cost ENDPROCESS ENDRUN
BACK
BACK
BACK
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3HWY01C.PRN, MSG='Example 11.3 - Current HW Costs' FILEO MATO[1] = "C:\Modelling Transport_CG\Applications\Chapter11\HWCosts_11_3.MAT", MO=1 DEC=9 NAME=HW_COST FILEI NETI = "C:\Modelling Transport_CG\Output\Chapter11\Loaded_11_3.NET"
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3MAT01B.PRN" MSG='Example 11.3 Compare matrix at k and k-1 loop' FILEO RECO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3MAT01A.DBF", FIELDS=DIFF P_DIFF(15.10) FILEO MATO[1] = "C:\Modelling Transport_CG\Applications\Chapter11\PreviousIterTrips_11_3.MAT", MO=3-4, DEC=2*9 NAME=PREVITER_HW PREVITER_PT FILEI MATI[2] = "C:\Modelling Transport_CG\Applications\Chapter11\TripsByMode_11_3.MAT" FILEI MATI[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3LOO01C.MAT" mw[1]=mi.1.2 ; previous transit trips mw[2]=mi.2.2 ; current transit trips mw[3]=mi.2.1 ; current auto trips output to become previous for next feedback iteration mw[4]=mw[2] ; current transit trips output to become previous for next feedback iteration MW[5]=mw[2]+mw[3] TOT_1=TOT_1+ROWSUM(1) TOT_2=TOT_2+ROWSUM(2) TOTAL=TOTAL+ROWSUM(5) DIFF=TOT_2-TOT_1 P_DIFF=DIFF/TOTAL LOG PREFIX=CONV VAR=P_DIFF LOG PREFIX=CONV VAR=DIFF IF(I=_ZONES) WRITE RECO=1 ENDIF ENDRUN
BACK
RUN PGM=MATRIX PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3MAT01C.PRN, MSG='Example 11.3 - Convergence report' FILEI RECI = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E3MAT01A.DBF" FILEO PRINTO[1] = "C:\Modelling Transport_CG\Output\Chapter11\Convergence_11_3.dat", APPEND=T
IF (ABS(P_DIFF)<=0 & @AMLoop_1@>1) Converged=1 ELSE Converged=0 ENDIF LOG VAR=Converged ENDRUN
BACK
BACK
Ch11-DA: Ex11.4 The Dynamic Nature of Traffic script file boxes below to see the scripts Click on the
BACK
Ch11-DA: Ex11.4 The Dynamic Nature of Traffic uses Cubes template system This example
BACK
This is a script generated by a template The FILEI, FILEO and parameter settings come from the dialog on the previous slide
BACK
IF (A<=2 || B<=2) STORAGE=9999 CLASS=1 ELSE STORAGE=DISTANCE*1000*LANES/5.75 ; 5.75 meters used as Average Length of a vehicle in a queue CLASS=2 ENDIF ENDPROCESS ENDRUN
BACK
BACK
RUN PGM=AVENUE PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E4AVN01A.PRN" MSG='Example 11.4 - DTA' FILEO PACKETLOG = "C:\Modelling Transport_CG\Output\Chapter11\PacketLog_11_4.LOG" FILEO NETO = "C:\Modelling Transport_CG\Output\Chapter11\Avenue_11_4.NET", EXCLUDE=LANES FILEI NETI = "C:\Modelling Transport_CG\Applications\Chapter11\Net_11_4.NET" FILEI MATI[1] = "C:\Modelling Transport_CG\Applications\Chapter11\MATRIX_11_4.MAT"
NEXT
BACK
Ch11-DA: Ex11.5 Equilibrium and Simulation boxes below to see the scripts Click on the script file
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01A.PRN, MSG='Example 11.5 - Prioity Junction' FILEO TURNPENO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01A.DAT" FILEO TURNVOLO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01A.TRN" FILEO JUNCTIONO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01A.INT" FILEO NETO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01A.NET" FILEI JUNCTIONI = "C:\Modelling Transport_CG\Input\Chapter11\JunctionFile1_11_5.ind", SET=1 PERIOD=60 FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NET_11_5" FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter11\ODMat_11_1.MAT" PARAMETERS COMBINE=EQUI PROCESS PHASE=LINKREAD T0=LI.T0 C=LI.CAPACITY ENDPROCESS PROCESS PHASE=ILOOP PATHLOAD PATH=TIME VOL[1]=MI.1.1 PENI=1 ENDPROCESS PROCESS PHASE=ADJUST FUNCTION TC=T0 ENDPROCESS PROCESS PHASE=CONVERGE IF (RGAP=0) BALANCE=1 ENDPROCESS ENDRUN MAXITERS=50 EQUITURNCOSTFAC=1
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01B.PRN, MSG='Example 11.5 - Roundabout' FILEO TURNPENO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01B.DAT" FILEO TURNVOLO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01B.TRN" FILEO JUNCTIONO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01B.INT" FILEO NETO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\E1HWY01B.NET" FILEI JUNCTIONI = "C:\Modelling Transport_CG\Input\Chapter11\JunctionFile2_11_5.ind", SET=1 PERIOD=60 FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NET_11_5" FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter11\ODMat_11_1.MAT" PARAMETERS COMBINE=EQUI EQUITURNCOSTFAC=1 MAXITERS=50 PROCESS PHASE=LINKREAD T0=LI.T0 C=LI.CAPACITY ENDPROCESS PROCESS PHASE=ILOOP PATHLOAD PATH=TIME VOL[1]=MI.1.1 PENI=1 ENDPROCESS PROCESS PHASE=ADJUST FUNCTION TC=T0 ENDPROCESS PROCESS PHASE=CONVERGE IF (RGAP=0) BALANCE=1 ENDPROCESS ENDRUN
BACK
Ch11-DA: Additional Examples (convergence) Frank-Wolfe and 2) Route Based Assignment As Example 11.1 using ... 1)
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01A.PRN, MSG='Frank-Wolfe Algorithm' FILEO PRINTO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01B.PRN" FILEO NETO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01A.NET" FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NET_11_1" FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter11\ODMat_11_1.MAT" PAR COMBINE=EQUI RELATIVEGAP=0 MAXITERS=10 ;The Frank-Wolfe algorithm has invoked using COMBINE=EQUI PROCESS PHASE=LINKREAD C=LI.CAPACITY LINKCLASS=LI.CLASS ENDPROCESS PROCESS PHASE=ILOOP PATHLOAD PATH=TIME VOL[1]=MI.1.1 ENDPROCESS PROCESS PHASE=ADJUST FUNCTION { TC[1]=T0 TC[2]=T0 + 0.02*V TC[3]=T0 + 0.005*V } IF (ITERATION>1) TOT_COST=TOT_COST+V*TIME ENDIF ENDPROCESS PROCESS PHASE=CONVERGE IF (RGAP=0) BALANCE=1 PRINT LIST='ITERATION:', ITERATION(5.0), ' TOTAL EXPENDITURE:', TOT_COST(10.0) PRINTO=1 TOT_COST=0 ENDPROCESS ENDRUN
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01C.PRN, MSG='Route-Based Assignment' FILEO PRINTO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01D.PRN" FILEO NETO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01B.NET" FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NET_11_1" FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter11\ODMat_11_1.MAT" PAR COMBINE=PATH RELATIVEGAP=0 MAXITERS=10 ; The Route Based Assignment algorithm has invoked using COMBINE=PATH PROCESS PHASE=LINKREAD C=LI.CAPACITY LINKCLASS=LI.CLASS ENDPROCESS PROCESS PHASE=ILOOP PATHLOAD PATH=TIME VOL[1]=MI.1.1 ENDPROCESS PROCESS PHASE=ADJUST FUNCTION { TC[1]=T0 TC[2]=T0 + 0.02*V TC[3]=T0 + 0.005*V } IF (ITERATION>1) TOT_COST=TOT_COST+V*TIME ENDIF ENDPROCESS PROCESS PHASE=CONVERGE IF (RGAP=0) BALANCE=1 PRINT LIST='ITERATION:', ITERATION(5.0), ' TOTAL EXPENDITURE:', TOT_COST(10.0) PRINTO=1 TOT_COST=0 ENDPROCESS ENDRUN
BACK
RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01E.PRN, MSG='Burrell Assignment' FILEO PRINTO[1] = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01F.PRN" FILEO NETO = "C:\Modelling Transport_CG\APPLICATIONS\CHAPTER11\AEHWY01C.NET" FILEI NETI = "C:\Modelling Transport_CG\Input\Chapter11\Input.mdb\NET_11_1" FILEI MATI[1] = "C:\Modelling Transport_CG\Input\Chapter11\ODMat_11_1.MAT" RELATIVEGAP=0 MAXITERS=10 ; The Burrell Assignment algorithm has invoked ; using COMBINE=PROBIT and adding few keywords on the PATH statement
PROCESS PHASE=LINKREAD C=LI.CAPACITY LINKCLASS=LI.CLASS ENDPROCESS PROCESS PHASE=ILOOP PATHLOAD PATH=TIME SPREADMAX=5 SPREADPERC=100 VOL[1]=MI.1.1 ;for burrell two more keywords SPREADMAX/SPREADPERC ENDPROCESS PROCESS PHASE=ADJUST FUNCTION { TC[1]=T0 TC[2]=T0 + 0.02*V TC[3]=T0 + 0.005*V } IF (ITERATION>1) TOT_COST=TOT_COST+V*TIME ENDIF ENDPROCESS PROCESS PHASE=CONVERGE IF (RGAP=0) BALANCE=1 PRINT LIST='ITERATION:', ITERATION(5.0), ' TOTAL EXPENDITURE:', TOT_COST(10.0) PRINTO=1 TOT_COST=0 ENDPROCESS ENDRUN
BACK
BACK
;Using T-T0=Es*T0*(S-S0)/S0 S =S0*(1+0.025) ;fare increases by 2.5% T=T0+ES*T0*(S-S0)/S0 DeltaT=T-T0 WRITE RECO=1 ENDRUN
BACK
BACK
NEXT
BACK
Ch12-SDM: Ex12.3 Matrix Estimation (w/ Analyst) file boxes below to see the scripts Click on the script
BACK
NEXT
NEXT
BACK
BACK
;;<<PROCESS TEMPLATE>><<HIGHWAY>><<Demand Model>><<Assignment>><<Highway>><<Static>>;; ;{Title,note,12,"Single Matrix Equilibrium Traffic using Time"}>>> ;{note2,note,10,"Input / Output Specification"}>>> ;Input Highway Network: {neti,filename,"Input Highway Network File",x,"C:\Modelling Transport_CG\Input\Chapter12\NET_12_3.NET","Network File (*.net)|*.net"} ;Input OD Matrix: {mati,filename,"Input OD Matrix File",x,"C:\Modelling Transport_CG\Output\Chapter14\ODMAT_12_3.MAT","Matrix File (*.mat)|*.mat"} ;Output Highway Network: {neto,filename,"Output Highway Network File",x,"C:\Modelling Transport_CG\Applications\Chapter12\E2HWY03A.NET","Network File (*.net)|*.net"} ;{note3,note,10,"Cost Function"} Highway Assignment>>> ;Cost function:{cost_fun,editbox,"Cost Function e.g. TIME*1+LI.DISTANCE*0.3",T,"TIME*1"} ;Number of paths:{NPATH,editbox,"Number of paths to be generated",N,"1"} ;;<<End Parameters>>;; RUN PGM=HIGHWAY PRNFILE="C:\Modelling Transport_CG\Applications\Chapter12\E2HWY03A.PRN" MSG='Example 12.3' FILEO ESTMICPO="C:\Modelling Transport_CG\Applications\Chapter12\E2HWY03A.ICP",COUNTVAR=LI.COUNT,DEFAULTCONF=100 FILEO ESTMDATO = "C:\Modelling Transport_CG\Applications\Chapter12\E2HWY03A.DAT" FILEI NETI = {NETI.Q} FILEI MATI[1] = {MATI.Q} FILEO NETO = {NETO.Q} PAR MAXITERS={NPATH} PROCESS PHASE=ILOOP PATHLOAD PATH=TIME, VOL[1]=MI.1.1 ESTMO=1 ALLJ=T ; load trips ENDPROCESS ENDRUN
This is a script generated by a template The FILEI, FILEO and parameter settings come from the dialog on the previous slide
BACK
This example uses Cubes control file editor for Analyst Click on Choose Option and Set Parameters in the menu below to continue
BACK
options menu Options are selected by ticking the relevant boxes Click on Parameters or OK to go back to previous menu
BACK
parameters menu Parameters are set by ticking the relevant items and entering the values downn left Click on Options or OK to go back to previous menu
BACK
Ch12-SDM: Ex12.4 Matrix Estimation (w/ Analyst) the complexity of Analysts matrix estimation This example shows
Each step inside an Analyst run is completed with Voyager programs For more information please see the full setup and scripts in the live version of the guide
BACK
Ch12-SDM: Ex12.5 Matrix Estimation (w/ Analyst) how Voyagers programs are used to prepare data for This example shows
estimation For more information please see the full setup and scripts in the live version of the guide
BACK
BACK