Professional Documents
Culture Documents
Agenda
Overview of Citilabs and Cube
Getting Started with Cube
Introduction to Cube
– Working with Cube Graphics - Inputs
– Working with Cube Graphics - Outputs
– Working with CubeGIS
– Working with Application Manager Cube Base
– Working with Scenario Manager
Cube Base
2
Citilabs & its clients
Citilabs was created in 2001 via merger of Urban
Analysis Group (USA) and software division of
MVA (UK)
Offices:
– San Francisco California (Oakland)
Cube Base
– Annapolis Maryland
– Washington DC (Arlington)
– London England (Woking)
– Milan Italy
– Philadelphia Pennsylvania (Doylestown)
– Beijing, China
3
Product Line
Principal product: CUBE
modular system for transportation planning with embedded
ArcGIS Engine:
– Cube Voyager: urban, regional and long distance travel forecasting of all
modes of travel
– Cube Dynasim: multimodal microsimulation
– Cube Avenue: Dynamic Traffic Assignment Cube with Cube Reports
– Cube Cluster: Parallel and Distributed Processing
– Cube Cargo: commodity-based freight forecasting
– Cube Analyst (ME) : statistical optimization of trip matrices
– Cube Polar : mobile source air quality forecasting
– Cube Land : land use forecasting (coming soon)
Cube
4
A comprehensive transportation
planning system TP+
TRIPS
TRANPLAN
Cube Base:
product
5
Key Qualities of Cube: Recognition of
model developers and appliers
Cube provides two explicit working
environments:
6
Key Qualities of Cube: An integrated
transportation planning environment
Cube has a series of Cube Extensions working
within one integrated software environment
using one data source. These extensions
provide capabilities for:
– Passenger forecasting
– Freight forecasting
– Traffic microsimulation
– Traffic mesoscopic simulation
– Trip matrix optimization
7
Cube Base: build, edit, run,
A common user interface for all
present Citilabs libraries. Learn this once
and you can use all existing and
future libraries
Graphics provides unlimited
layering, signing, intersection
coding and analysis, unmatched
network editing and analysis,
charting, links to digital media
Flow-Chart provides extremely
easy to use model interface for
building, running and
documentation
Scenario Manager makes creating,
managing, running and reporting
ArcGIS on scenarios very easy to do
Cube Base
ArcGIS integration for industry standard GIS, internet
and reporting
8
The GIS Window
GIS
Toolbar
View
Switcher
Editing
Toolbar
Table of
Contents
Data
View
Pointer
Coordinates
9
The Layout View
Ink Pen
Drawing
Tools
Layout
Navigation
Tools
Focus Data
Frame
Control
10
Example Maps
11
Getting Started with Cube
Starting Cube
- Welcome Screen
- File Center
- License and Version Info.
12
Introduction to Cube Base
Working with Cube Graphics
Data Preparation
Exercises
Network Editing
– Add/modify links
– Save a log of edits
– Automatic intersections
– Adding attributes and calculations
– Working with polygons
– Viewing data with Link/Node displays
– Automatic Link updating
14
Data Structures & the VPR file
Highway Networks
– Link and Node databases
– Unlimited link and node attributes
– Supported Data Structures: MDB, Citilabs Binary, DBF,
CSV,TXT
Transit Networks
– Multi-user class transit networks composed of Highway
network and Transit Line, Link, Node, System, Factor and
Fare data.
– Maintained in both loaded and unloaded formats.
Matrices
– Zone to Zone data tables
– 255 tables or matrices on a binary file
– Supported Data Structures: Citilabs Binary, DBF, CSV, TXT
(note non-binary data must be in I-zone sort order)
15
Data Structures & the VPR file
Zonal Data
– Unlimited zonal data
– Supported data structures: MDB, DBF, CSV, TXT
Intersection Data
– HCM intersection definitions
– Allows coding of all HCM stop controls
– Supported data Structures: Citilabs ascii formats
– Uses Intersection Node & Approach Node Hierarchy
Visual Project File – VPR/MXD
– Stores all graphically display settings in the current view
– Stores associated layers and layer settings for supported files
– Allows for 1 HWY and 1 TRN layer and unlimited DRW, IMG
and SHP layers
– Global VPRs, Application VPRs and VPR associations
16
The Network Window
Displays a network
and other layers
– Transit
– Boundary
– Line shape
– Point Shape
– Drawing
– Image
Menu commands
and toolbar
buttons configure
display
Settings are stored
in a VPR file
(Visual Project)
Navigating the View
Provides summary
statistics about
layer attributes
(e.g. nodes and
links)
Helpful for getting
a quick summary
of a variable’s
range
Copy to Clipboard
function can be
used with to paste
into a spreasheet
View > Layer Control
22
Network Editing: Add Links
Right click on link 1003-1018 and
select delete
Add link 1003-1018 again using Copy
and Paste
Copy from link 733-1013
When you select Paste the cross-hair
will appear.
Position cross-hair over node 1003.
Click, drag and release over node
1018. New Link is Pasted.
Hit the ESC key and select the new
link to view/edit its attributes
23
Network Editing: Save Log
Select File, Save Log File from the Main
Menu
Save log file as Project1.log
Quit network without saving
Open network and View Center on Node
1003 with Scale ~21000
Select File, Play Log File and Select
Project1.log
Stored edits are “played” into the network
24
Network Editing: Automatic
Intersections
Select Node, Automatic Node
Numbering from the Main Menu
Select Link, Automatic Intersection
from the main Menu.
Copy link 733-1013 and Paste from
1003 to the middle of link 717-988.
Intersections at crossing links are
automatically created and numbered.
25
Network Editing: Adding
Attributes and Calculations
Select Link, Attribute, Add from the Main
Menu
Type is Numeric
26
Network Editing: Adding
Attributes and Calculations
In computation area Right Click and
select Insert
Enter equation TEST=CAP*1.1 and select
OK
Accept other defaults and select Apply
Browse link attributes to verify
computations
Computation Sets
27
Network Editing: Adding
Attributes and Calculations
Using Conditions with Calculations
Select Link, Compute again
Double click your equation to edit
and set TEST=0
Right click in the blank Condition
box and set up a condition to apply
the calculation only for Centroids
(FUNC_CLASS=10)
Select Apply
Browse link attributes to verify
computations
28
Network Editing: Polygons
Select Polygon, New from the Main Menu
and draw a Polygon by point-and-click.
Select Polygon, Save, 1= from the Menu
and name this Polygon ‘Area 51’
Add link attributes ORIGCAP and DIFF
Compute ORIGCAP=CAP
Subtract 700 from CAP for all links within
the polygon
Check and validate that it has worked:
Compute DIFF=CAPACITY-ORIGCAP
Post DIFF
29
Network Editing: Polygons
30
Network Editing: Viewing Data
31
Network Editing: Viewing Data
32
Network Editing: Viewing Data
33
Network Editing: Link Updating
Automatic link attribute updating with point-
and-click
Select Link, Compute
Select an unused Set Number
NAME=SETCLASS3
Insert 3 expressions: FUNC_CLASS=3,
NUMLANES=2, CAP=1800
Applies To = When items changed
Check Auto Calculation On and Apply
Select Link Update
Update a CLASS 5 corridor to CLASS 3 by point
& click with the Update pointer
Save file as Project Def 1.net
34
Network Coding:
Creating a new Network
Close Current view. Create a new
network
c:\CitiTrainingData\Work\SF.net
Set Max Zones=25
Set X and Y Coordinate Range=0-2640
Set Coordinate Scale=5280
35
Network Coding:
Creating a new Network
Use Layer Control to add an image layer.
Browse to
c:\CitiTrainingData\lessons\Develop a
Highway Network\SF_MAP.gif
Base Point: X=0, Y=0
Scale: X=4.26, Y=4.26
36
Network Coding:
Creating a new Network
Use network editing tools you have learned to add
attributes to the network and code links for Market Street
Suggested Attributes:
Speed, FacilityType,
AreaType, Lanes,
Distance
37
Network from Shape
Start Cube by double-clicking the Cube icon
When Cube opens, you see the Cube start-up
dialog on top of the application window.
click the Cancel option on the Welcome Dialog.
Select File, select Open.
Navigate to:
c:\CitiTrainingData\lessons\develop a highway
network. Click Highway_Network.shp and click
Open.
38
Network from Shape
Highway_Network.shp is now the “active”
layer
39
Network from Shape
Highlight the layer, by clicking on the file.
Click on Layer Properties.
Under Link, check the box next to Color.
Click on the Change… button to the
immediate right.
Click on Insert once.
Select Div-orange-blue on the color palette
pull-down menu.
Select dark blue from the palette.
40
Network from Shape
Click All Done. Layer is redrawn based on
saved layer color specification
From the main menu, select GIS Tools,
select Build Network from Shape.
In the Save in box browse to
C:\CitiTrainingData\work and in the File
name box, type example.net, and select
Save.
41
Network from Shape
A highway network in Cube uses traditional node-based
techniques. Cube requires that the shape file have
either two fields with pre-existing node numbers, or two
fields where it can create numbers. In the current
shape file, we have already created two fields called A
and B and have node numbers. If we wanted to number
(or re-number) the nodes, we would check the box ‘clear
all values in the A-Node and B-Node fields first’. In the
current exercise we will not check this box.
42
Network from Shape
Use the following values in the build
network from shape dialog
Node Field Names= A, B
Use Indicator field=ONEWAY_TWO
Distance Options=Add Distance Field,
Scale=1.0
Node Grouping Limit=1.0
Starting new Node Number=100
Highest Zone Number= 25
Select Build to build the network
43
Network from Shape
Open the Layer Control Dialog and double
click the Highway Layer
Browse and select the network we just
created entitled Example.net
Review - Set up a color specification for
the Highway layer that is different from
the Shape Layer
44
Network from Shape
Click on GIS Tools, True Shape Display.
Click on ‘On’. Click OK on the resulting
dialog.
The network takes the form of the shape
file. We have now converted shape source
data to a network for use in modeling and
linked it to the source shape file so that it
takes the form of the shapes.
Use the Layer pull down bar to toggle
between HWY and LIN layers. Select a
common roadway segment in both layers
and compare their attributes.
45
Centroids and Connectors
On the menu, click on the Layer control
icon. The Layer dialog opens.
46
Centroids and Connectors
Click on Node
Click on Automatic Add Centroids.
In the Select an Item dialog select TAZ and
Select OK
An Information dialog appears saying that 16
centroids have been added. Cube has placed
the centroids in the geographic center of the
boundaries (zone boundaries) and used the
numbering from the zone boundary shape
file.
47
Centroids and Connectors
Select Node
Select Automatic Add Centroid
Connectors. The Automatic Centroid
Connectors Generation dialog appears.
Change the Maximum Distance for
Connections to 2600 (feet)
Right click in last conditional box and
select FUNC_CLASS. Set this equal to 1-2
Select OK
48
Boundary Layer Settings
Boundary Layer Settings
The “node color” button doubles as an “area
fill color” tool for boundary files
Simple expressions can be combined to create
useful thematic maps
“Links” are equivalent to polygon shape border
lines for boundary layers
Apply Zonal Layer Fill Setting
1. Select BDY as top
layer from control
2. Click on
Node/Point/Area
Color button
3. Click ‘Insert’ three
times to create 3
new rows
4. Select ‘Color/Style’
and specify criteria
5. Name group
6. Click ‘Close’
Apply Zonal Layer Boundary
Setting
1. Click on
Link/Line/Bounda
ry color button
2. Select dashed
style in light grey
3. No criteria
required—will
apply to all zones
4. Name group
5. Click ‘Close’
Transit Display Settings
Color
Color Palette
53
Representing Intersections
Close the current network and open
c:\CitiTrainingData\lessons\representing
intersections\ Example.Net
On the menu, click on the Layer control
icon. The Layer dialog opens.
Turn on the Image and Boundary layers
Click All Done. The air photo located in
the study area should be visible.
Cube can have as many image layers as
you want. In this example the air photo
will help us to code the intersection
data, but it is not required to do this.
54
Representing Intersections
Click on the ‘zoom to node’ icon and
Enter 744. When prompted for the
Window Width, enter 1000
Click OK. The view is zoomed to the
intersection.
From the Intersection Menu Click
Open/Create Input Intersection Data File
Navigate to the ‘..\Work’ folder
Enter the file name example.ind and Click
Open
When prompted to create a new file, click
OK
55
Representing Intersections
Click on the node in the center of the screen.
The node dialog will open.
Click on the Intersection Icon on the dialog
box. The Intersection dialog opens.
Pull down on the intersection type menu
Select Adaptive Signal, Geometric (HCM). Cube
provides two techniques for modeling capacity
at intersections, Saturation Flows and
Geometric. Geometric is also known as the HCM
methodology based on the Highway Capacity
Manual. Cube follows the HCM methods and
calculations published in the most recent
version of the HCM manual.
56
Representing Intersections
Select Feet as the Units of Measure from the
Intersection menu and the Intersection data
file settings item
Select the attribute First Arm. This
highlights what Cube believes to be the
major movement at the intersection.
Click on Phases. The dialog now changes and
provides the opportunity to represent up to 8
signal phases
Click on the arms of Phase 1 and Phase 2 and
complete the signal phasing as shown on the
next page.
57
58
Representing Intersections
Click on Lane Geometry
59
60
Representing Intersections
Now that we have coded one intersection,
we can save this intersection into the
Library of intersection types.
Click Save to Library. The Intersection
Library dialog opens.
Enter the name of this intersection as My
Example Intersection.
Cube comes with several intersection
templates. We have just added another to
the system that we can use when coding
other intersections.
61
Representing Intersections
Select OK on the intersection dialog to close
62
Coding Public Transit Systems
In this exercise, we will code a public transit
line. Cube allows you to code all types of
public transit (bus, tramway, heavy rail, etc.).
In this exercise we will code a bus line.
Start Cube. On the File Menu select Open.
Navigate to:
c:\CitiTrainingData\lessons\developing a public
transit network
Click Example.NET to open file.
63
Coding Public Transit Systems
Click on the Layer control icon .
64
Coding Public Transit Systems
Pull down on the Layer order control and
select the TRN: example.lin layer to make
the public transit line layer the active
layer.
We now have a public transit layer and it is
now on top for editing.
On the main menu, Click Transit.
Click Line Manager. The public transit line
manager dialog opens. It shows the files
that are available for editing as well as the
transit lines that are currently in the file
65
Coding Public Transit Systems
Click New on the Line Options.
A dialog box opens and prompts you for
the name of the line.
Type in Red Flash
Click OK. The dialog box closes and we
now have created a transit line.
With the Red Flash highlighted, click on
Edit. The transit line coding dialog opens.
66
Coding Public Transit Systems
Click on the ‘zoom to node’ icon and enter
node 791. Set Window Width to 25000
67
Coding Public Transit Systems
Code a line that goes from the northern portions of
the window to downtown.
Move the cross-hair cursor and click on Node 804.
The node should flash. Note the text at the bottom
of the screen. It prompts you for different ways to
code the line. We will be using Click-auto route with
stop node. Click on 798. The route of the line is
found via the minimum path. You now have coded a
transit line starting at node 804, traveling to node
789. Stops are at nodes 804 and 798.
Continue coding the line by clicking the following
nodes, 791, 784, 780, 764, 763, 754
Hit the Escape key on your keyboard. Escape takes
you out of the line coding mode
Click on the Green Check on the line coding dialog.
This accepts what you have coded.
68
Coding Public Transit Systems
Pull-down on the line coding dialog to make it
longer. You can see the nodes that make up
the route. ‘-’ is a non-stop indicator for the
transit nodes on the Line. No boardings or
alightings will be allowed at these nodes.
Scroll up to the top of the list using the slider
bar
At the top, you will see Mode.
Next to that, type in 1. By default, Cube
provides you with a dialog for adding the mode
number and the nodes that make up the route
and stops. You may also want to add other
elements to describe the line.
69
Coding Public Transit Systems
Click on the insert row icon . This opens a
dialog with a list of variables that may be
added to the line.
Scroll and Click on Headway[1]
Select OK. Headway for Modeling period 1 is
added to the line
For the Headway[1] item enter 10
Click on the Green check mark and close the
dialog. The line now is shown using a
default color and type line.
70
Coding Public Transit Systems
Select the Transit Line Manager Icon and
select Save All to save edits.
On the Main Menu select Transit.
Click on Show Stop/Non-Stop Nodes.
Click the two check boxes and accept the
default colors and sizes. Click OK.
The transit line now shows where it runs,
where it stops and where it does not stop.
71
Coding Public Transit Systems
Exercise: Using the tools you have just
learned, code another bus line named
‘Blue Dragon’ with mode=1,
headway[1]=15
72
Working with Cube Graphics
Data Presentation
Exercises
Making Visual Comparisons
Desire Lines
Node Charts
Bandwidth displays
Posting sets
Path File Display and Analysis
73
Visual Comparisons
Saving a common View
Restore a common view across multiple
networks
74
Desire Lines
Close all open files. Open
c:\cubetown423\model\Discover Cube.cat
Double click on Cube Voyager Demonstration
Model in the Applications area
Double click on the Person Trip Table
Window back to the application and Double
Click on the HW Intersections
Select Node, Link to Matrix and add the
matrix from the Available to Current Linkage
Select Post, Desire lines. Display trips from
Zone 13 to all other zones
75
Node Charts
Select Post, Clear All Postings
Select Post, Node/Point Chart and Node
Chart dialog settings as show on the next
page
Select Ok to view.
Select View, Legend to see the Link and
Node Legend
76
77
Path Building, Display &
Analysis
78
On Screen Paths
Close current views and reopen
c:\CitiTrainingData\Lessons\Develop a
Highway Network\BASE.NET
Select Path, Build from the Main menu
to open the Path Cost Calculation dialog
box
79
On Screen Paths
COST - Measure of any attribute along the path
between the origin and destination.
Cube finds the least “COST” path
Attributes can be functions of or combinations
of link attributes
– Distance
– Time
– Impacted Population
Penalties, Prohibitions and other Restrictions
are considered
80
On Screen Paths
Cube allows for interactive path
building and display with user defined
cost specifications
Cost specifications can be built using
available network attributes, Turning
restrictions or penalties, and
incremental cost values
Right click in the blank Specifications
area and select Distance
Path Building dialog opens with zone
one pre-selected
81
On Screen Paths
Set Origin to 1 and Destination to 17,
minimum distance path is built and
displayed
Check List Path Traces and click
Display
Continue to click additional
destinations for multiple paths
Select Clear and Close
82
Path File Display &
Analysis
Close current views and reopen
c:\cubetown\Model\Discover Cube.cat
From the Data panel open HW Loads
from the Outputs\Voyager\Highway
Assignment folder
From the Path menu select Use Path
file and browse to RoadPaths.PTH
From the Path File dialog box select
Selected Links, click a link on the
network and select Display tab
83
Applying the Forecasting System – An example using
the Demonstration model Cubetown
84
Working with Application Manager
The creation of a model in Cube
Overview of Application Manager (AM)
– Interactive Exercises
Required fields
– Name: TEST
– Code: AA
– Version: 00
– Type: Voyager
Return to Application Information
screen from Application>Properties
87
Setting the default configuration
All elements of your application have
some default configuration. Access
these default settings from the Settings
main menu.
Select Screen Font and set to Arial 14pt
Select Default Settings
Cube can work with alternative data
editors
Check on Generate Required Files…
Check off Apply Process Templates…
88
Adding functions (programs) to the screen
Access Cube Extensions from the Program main menu
Select Passenger Forecasting > VOYAGER > NETWORK to add the
Voyager Network Program to your Application
89
Naming data and linking to existing data
AM places the selected program on the screen
and makes data input and output boxes
available subject to the program type
Right click on a data box to access all file
naming and linking options:
– Auto Name
– Name New File
– Link to File
90
Naming data and linking to existing data
91
Branching and model flow with Sub Groups
A Sub Group is a nest in your flow chart
Create a new Sub Group from the Group menu
or use the F7 shortcut key
Sub Groups are managed in AM as separate
applications. Name this new group LOS.
Enter a Sub Group by double clicking on the
Group
Return to the previous level in AM by right
clicking in white space and selecting ‘Go to
parent’
92
Process Templates
AM can access a set of predefined templates
for modeling processes (module.tpl).
On the Settings Menu, Default Settings dialog,
check on Apply Process Templates
Navigate to the LOS sub group and from the
Program menu, find and add the Voyager
HIGHWAY program
From the Process Templates list, select
‘Estimate Matrices of Time and Distance’
Input network is Test.net, output matrix is
Test_LOS.mat
93
Linking Data Flows with Public Files
Right click on the input Network File box on
the HIGHWAY program and select Make File
Public
Right click in white space and select Go to
Parent
Drag and drop the Network File output from
step #1 to the input Network File box of step
#2
94
Visualizing your application
95
Running an Application in AM
From the Application menu select Run
Application or use F2 short cut
AM creates a single Voyager script by
concatenating individual scripts from
all active steps in the application
AM creates a Task Run File for Task
Monitor
Application can be run from Task
Monitor or as a single script from
Voyager
Can also run by Sub Group
96
Running from Task Monitor
97
Running from Voyager
98
Working with Scenario Manager
Applying a Model in Cube
100
Creating a Catalog and Overview of SM tools
Close imported model and reopen TEST00.APP
from File menu > Recent Applications
From the File menu select New then Catalog
and create MyModel.cat
Right click in white space in the Application
and select Add Application to Catalog
Select the Application in the Applications panel
of SM to make it active
101
Overview of SM tools
SM has four main panels
– Scenarios: Define nested scenario structure, define scenario
specific Key values, run individual scenarios
– Data: Link data to data panel, access linked data, define folder
structure for linked data, organize linked data, create reports
with Cube Reports, view reports, organize reports
102
Adding Keys to the Catalog
Right Click in white space in the
Keys panel and select Add
– Name: LINKS
– Prompt: Please Provide Link File
– Type: File Name
– Control: Edit Box
Add another key for NODES
103
Defining Scenario Values for Keys
Double click on the Base scenario in the
Scenario panel to display the model appliers
menu
Browse and select Base.link.dbf and
Base.node.dbf as the inputs for the Base
Scenario
Select OK
104
Linking the Catalog Keys to the Application
105
Linking the Catalog Keys to the Application
Right click on the Link/Net. 1 file box
and select Link to… and then Link to
Catalog Key…
Double Click on LINKS from the Keys
list on the dialog to link the Key to the
file box
Repeat for the Node File 1 box
From the View menu select Legend
Key values are passed to AM from SM
when the current Scenario is run
106
Scenario Specific Data
Right Click on key output files in the
Application and select Make File Scenario
Specific
Right Click on input and output file and select
Add to Catalog Data Section
107
Adding New Scenarios in SM
In the Scenarios panel, right click on the Base
scenario and select Add Child
Add new scenario Proj2020 and accept defaults
Scenario Manager automatically populates all
key values for the child scenario with the
values of its Parent
It is up to the model applier to make the
needed key value changes specific to the new
scenario
108
Modifying the Catalog Properties
Right click on the MyModel.cat tab near the top
of SM to access the catalog properties dialog
109
Running Scenarios from SM
Scenarios can be run individually by
double clicking the desired scenario,
setting key values for the scenario
and selecting Run
Multiple scenarios can be run in
batch mode by selecting the
Scenario menu and then Run Catalog
Define the selected scenarios set by
using the buttons.
Selected scenarios are run when OK
is selected
110
Exercise: Demographic Growth
Scenario
Create and run a scenario reflecting the
transport impacts of demographic growth
Steps:
1. Open C:\Trainingmodel\Training.cat
2. Create new “child” scenario
3. Copy zonal data and open for editing
4. Change socio-economic assumptions
5. Save and run scenario
Step 1: Add Child Scenario Right-click on the
“Base” scenario and
select “Add Child”
from the context
menu
Confirm copy of
TAZ.dbf and provide
new name
135
PILOT: An 8th Special Module
Controls Model Flow
Used for feedback looping and process control
– User sets either fixed number of iterations
– Or, sets a criteria (model result) to stop or continue
Commands:
– *command, BREAK, COMP, CONTINUE, COPY…ENDCOPY, EXIT,
GOTO…:LABEL, IF…ELSE…ELSEIF, LOOP…ENDLOOP, PROMPT,
REPORT, RUN
136
Laying out the Modules and Data
Input-Output
Organization of the modules
is done with Cube Base
Data input and output is also
done with Cube Base
137
Scripting Basics
The General Rules of Voyager Scripting
General Syntax:
– COMMAND keyword=value
138
Scripting Basics
The General Rules of Voyager Scripting (2)
To continue lines of CPS:
– Line must finish in an operator:
• + - / * , = | &
Example:
PATH=COST,
MW[3]=MI.1.TRIPS,
SELECTLINK=(L=1000-1001 && L=2000-2001),
SELECTGROUP=1-3,5,
SELECTLINKGROUP=((GRP[1]=1 && GRP[2]=2) || (GRP[3]=1))
139
Scripting Basics
The General Rules of Voyager Scripting (3)
140
Scripting Basics
Example Script
RUN PGM=NETWORK
FILEI NETI=MY2000.ALT.NET
FILEO NETO=TOTVOL.ALT.NET
141
Scripting Basics
Making Computation in the Script
Simple expressions
– Speed = Distance / Time
– Address = Street + ',' + City + ',' + State + ' ' + ZipCode
NOTE: user must be aware of illogical operations (i.e. divided by 0)
142
Scripting Basics
Making Computation in the Script
Numeric Functions
ABS(x) MAX(x,y,...)
ARCSIN(x) MIN(x,y,...)
ARCOS(x) POW(x,y)
ARCTAN(x) SIN(x)
CmpNumRetNum(V1,OP,V2,R1,R2) SQRT(x)
COS(x) RAND()
EXP(x) RANDOM(n)
INT(x) RANDSEED(n)
INLIST(n,str) ROUND(x)
LN(x) TAN(x)
LOG(x)
143
Scripting Basics
Making Computation in the Script
Character Functions
FORMAT(x,w,d,str) SUBSTR(str,b,n)
TRIM(str) STRPOS(str,str2)
LTRIM(str) STRLEN(str)
DUPSTR(str,n) STRUPPER(str)
VAL(str) STRLOWER(str)
STR(v,w,d)
144
Scripting Basics
Making Computation in the Script
Example:
– If (i=1-10,20,30 & j=100-200,301,310)
– If (area > 3 | (CapClass * 50 * Lanes) < 3000)
145
Scripting Basics
Making Computation in the Script
146
Scripting Basics
Recommended Practices
147
NETWORK: Building, Comparing and
Manipulating Highway Networks
Module Basics
– Inputs: Up to 10 Link Files and 10 Nodes Files or 10 Networks (MDB, Voyager, TP+,
MINUTP, TRANPLAN, TRIPS, text, dbf, binary)
– Outputs: 1 Network (MDB, Citilabs Binary); 1 Link and 1 Node (MDB, text, dbf)
– Phases: INPUT, NODEMERGE, LINKMERGE, SUMMARY
– Variables: Unlimited Link & Node, 15 character limit, referencing=LI.#.name or
NI.#.name, working variable=_varname
Examples
– _vmt=_vmt+li.1.dist*li.1.vol
– Limits: zone=32,000, links=999,999, nodes=999,999
148
NETWORK: Building, Comparing and
Manipulating Highway Networks
Module Structure – Linkloop/Nodeloop/Phases
– INPUT: Read ASCII and DBF files, re-code values from any
input files specifically designated.
– NODEMERGE: Read all node data and organize it
– LINKMERGE: Read all link data and process it (main phase)
– SUMMARY: Report results of LINKMERGE phase
Examples
– Merge multiple networks,
– Merge link/node data,
– Break a network into subarea networks,
– Flexible network reporting
149
MATRIX: Demand Modeling and Matrix Manipulation
Module Basics
– Inputs:
• Up to 20 matrix files (w/ 255 tables each)
• Up to 10 zonal data files
• Up to 10 Database files (DBI Processing)
• 1 record data file of ascii/dbf data (Record Processing)
– Outputs:
• Up to 20 trip matrix files (w/ 255 tables each)
• Up to 20 record data files (dbf format)
150
MATRIX: Demand Modeling and Matrix Manipulation
Functionality:
– Computation of new matrix values.
– Trip distribution (called by DISTRIBUTION).
– Trip generation (called by GENERATION).
– Converting and merging matrices between various formats.
– Reporting values from matrices and zonal data.
• Selected rows.
• Marginal summaries (trip ends, etc.)
• Frequency distributions.
• User formatted files.
– Transposing matrices.
– Generating matrices.
– Renumbering, aggregating, and disaggregating matrices.
– Implementation of Discrete choice Logit Models
• Absolute Logit Model
• Hierarchical Absolute Logit Model
• Incremental Logit Model
• Destination Choice
• Mode and Destination Choice
151
MATRIX: ILOOP/JLOOP Processing
J
I
V11 V12 . . . . . . . . . . . . . V1j . . . . . . . . . . V1z
. . .
. . .
MW[#] = Vi1 Vi2 . . . . . . . . . . . . . .Vij . . . . . . . . . . . Viz
. . .
. . .
. . .
Vz1 Vz2 . . . . . . . . . . . . . Vzj . . . . . . . . . . Vzz
152
GENERATION: Trip Generation
Module Basics
– Inputs:
• Up to 10 zonal data files
– Outputs:
• Up to 10 production and attraction files with up to 20 purposes per file
Methods:
– User specified linear or non-linear functional forms
– Typically implements linear trip production and attraction
equations
153
GENERATION: Trip Generation
Module Structure – ILOOP/Phases
– ILOOP: loop from zone 1 across all zones
– ADJUST: set to balance the final P’s and A’s.
Functionality
– Calculate External P’s and A’s
154
DISTRIBUTION: Trip Distribution
Module Basics
– Inputs:
• Up to 20 matrix files (w/ 255 tables per file)
• Friction Factors (MDB, text, dbf)
• Up to 10 production and attraction files (MDB, text, dbf)
– Outputs:
• Up to 20 trip matrix files (w/ 255 tables per file)
155
FRATAR: Matrix Growth Factoring
Module Basics
– Inputs:
• Up to 20 matrix files
• Up to 10 production and attraction files
• 1 text data file of data
– Outputs:
• Up to 20 trip matrix files
156
HIGHWAY: Pathbuilding, Skimming and Assignment of
Highway Networks Basics
Module Basics
– Inputs:
• Up to 20 binary (Citilabs) Matrix files (w/ 255 tables)
• 1 Highway Network (MDB, Voyager/TP+ binary)
• 1 Turn Penalty File (ascii)
• 1 Intersection File (ascii)
• 10 Zonal Data File (MDB, dbf, ascii)
• 1 SubArea Network (Polygon SubArea Extraction in Cube)
– Outputs:
• 20 binary (Voyager/TP+/MINUTP) LOS Matrix files (w/255 tables)
• 1 SubArea Matrix (SubArea assignment w/255 tables)
• 1 Assigned Network (Citilabs binary)
• 1 Turn volume file (binary)
• 1 Intersection Data file (binary)
• 1 intercept file for Cube Analyst (binary)
• 1 screen line file for Cube Analyst (ascii)
• 10 Path files for path display in Cube
• 1 turn penalty file with final movement delays
157
HIGHWAY: Pathbuilding, Skimming and
Assignment of Highway Networks
Methods
– Multi-user class equilibrium, average or weighted assignment,
– incremental assignment, all-or-nothing,
– multi-user class link and intersection constrained equilibrium assignment,
– user defined…
158
PT: All Public Transport Functions
Module Basics
– Inputs:
• 1 Highway Network
• 10 Trip Matrices
• 1 System Data File
• 10 Factor Files
• 32 Line Files (7 in AM)
• 32 NTLEG Files (7 in AM)
• 10 Route Files
• 1 Fare System File
• 99 Fare Matrices
• 1 Junction data file
• 1 Turn penalty file
159
PT: All Public Transport Functions
Module Basics
– Outputs:
• 1 Line File
• 1 Network
• 1 DBF link file
• 10 Matrices
• 1 NTLEG File
• 1 Report File
• 10 Route Files
• 1 DBF Stop to Stop file
160
PT: Network Building, Path Building, Skimming and
Assignment of Transit Networks
Module Structure - Phases
– NODEREAD: loops over all nodes computes node based scalar and array variables (Optional)
– LINKREAD: loops over all links Computes link based scalar and array variables (Optional);
– DATAPREP: generates/reads non-transit legs (Optional - Required for PT Network Development)
– MATI: manipulates input and work matrices prior to processing each Origin zone, I (Optional)
– SELECTIJ: allows finer selection of zone pairs, IJ, for Route Evaluation, and the setting or revising of
trips for Loading (Optional)
– SKIMIJ: saves and manipulates skims for zone pairs, IJ (Optional - Required for Skimming)
– MATO: allows processing of work matrices prior to them being written to the MATO files at the end of
each Origin zone (Optional)
161
PILOT: Model Flow Control-
Loop Control in CUBE
Module Basics
– Inputs:
• 1 file containing values put into an array:
• Each record from the file contains two fields: a
variable name, and its value.
– Functionality:
• Store and compute values to system variable file
• Run system commands from the command line
• Execute flow control commands
162
PILOT: System Variables and Tokens
FACTOR=0.08 ;Pilot script creates system variable
RUN PGM=MATRIX
MATI=DEMAND.MAT
MATO=PKDEMAND.MAT MO=1
163
Summary of the Basics
164
Summary of the Basics
Add a module in Cube Base
Set a file name for the script file and for all data inputs and
outputs—note automatic file naming
Open the script file and code the script
NOTE: Cube Base codes the ‘basic’ FILEO and FILEI commands (file control), BUT there also may be
additional keywords following these.
EXAMPLE
– NETO=DEMOMINU.DAT, FORMAT=MINUTP, EXCLUDE=TEMP1
– MATO=MYTABLE.MAT, MO=1-2, NAME=TIME,DISTANCE
165
Voyager Scripting Exercises
Examples using Templates
Exercise - Building a Model System
Create a new application Final tests saved as
..\Work\finaltest.app
Create a project with 3 sub-groups : COSTS, DEMAND, ASSIGN
Use F7 key to Insert a New Subgroup
167
Exercise - Building a Model System
168
Highway Costs
169
Highway Costs
170
Transit Costs
171
Transit Costs
172
Transit Costs
173
Transit Costs
174
Transit Costs
175
Costs Summary
176
Demand - Generation
Select Passenger
Forecasting>Voyager
>Generation from the Program
menu. 3
177
Demand - Generation
178
Demand - Distribution
179
Demand - Distribution
180
Demand – Mode Choice
181
Demand – Mode Choice
182
Demand – Summary
183
Assign – Matrix Balancing
185
Assign – Equilibrium
186
Assign – Equilibrium
187
Assign – Public Transport
188
Assign – Public Transport
189
Assign – Summary
190
Application – Summary
191
Exercise - Building a Model System
Save Application
Create a new catalog Demo.CAT and add in finaltest.app as the
application.
Close the finaltest.app and open from SM
Create new key: ZONAL DATA (File Type and Edit Box Control)
Link ZONAL DATA key to zonal data files in the application using Right
Click + Link to Catalog Key
Create new key: NETWORK (File Type and Edit Box Control)
Link NETWORK key to input network files in the application Right Click +
Link to Catalog Key
Provide value for Base Scenario and run
Save All
192
Exercise – Applying the Model
Add child alternatives for
YR2002, YR2010, YR2020,
YR2030
Run each scenario and select
the appropriate zonal data file
by year from
C:\CitiTrainingData\MyVoyager
DemoModel.
Batch running your scenarios
from Scenario run menu
193