Voyager Scripting
Voyager Scripting
Voyager Scripting
Design concepts
Cube Voyager is designed to be an integrated modeling system for transportation
planning applications. At the heart of the Cube Voyager system is a flexible control
language referred to as a scripting language. This provides a flexible environment and
grants control over all aspects of the modeling process.
The Cube Voyager system has four main assignment programs: Netwo rk , M atrix, Highway,
and Public Transpo rt . In addition, the system offers supplementary programs for common
transportation planning tasks, such as the Generatio n program for trip generation and the
Distributio n program for trip distribution. These supplementary programs provide an easy-
to-use interface to the basic four programs. Users may implement any model formulation
desired in the scripting language.
Cube Voyager has no hard coded mechanisms; users are free to change and modify
runs as they progress. Cube Voyager is an excellent choice for model applications
which require congestion feedback mechanisms.
Typically, transportation planning software is run as a series of independent programs,
any one of which could require a relatively large amount of input control data, and
consume a considerably large amount of computer resources. Some programs could
execute for hours, and operate most efficiently with large amounts of RAM. A user may
want to use Scenario Manager in Cube to run many scenarios which could require
running a large number of programs in successive order.
Cube Voyager is a library of programs that employ a language that allows the user to
write the script to provide instructions for performing all types of typical planning
operations. The script is stored in a file and then read when the system is executed. The
individual programs are activated according to the instructions in the script. Each
program is designed to perform certain operations, but only as specified by the user. A
typical application could involve a very complicated set of instructions, or can be as
simple as computing and/or printing a number from a file. It is the user’s responsibility to
design the process that is to be run.
The binary files generated by Cube Voyager are designed to reduce disk storage
requirements and reduce the amount of time spent on input/output. They have a
proprietary format that can not be used by other software, but they can be translated to
other formats by the user.
Introduction > Program features
Program features
Advanced features of the Cube Voyager software include:
• Integration with ESRI’s ArcGIS Engine allows reading and writing of supported file
structures directly to and from a personal geodatabase
• True 32-bit system designed for operating systems such as Windows XP & Windows 7.
• Seamless file format compatibility with existing transportation planning packages such as
TRANPLAN, MINUTP, TRIPS , TP+ and others.
• Database connectivity allowing data to be stored and edited in standard dBASE format
• Flexible matrix calculator with no practical limit on the number of matrices (999 internal
working matrices and up to 255 matrices on input and output files).
• Advanced plotting capabilities to create high quality plots for on-line printing or as plot file
images that can be plotted at a later time
• All data is stored as floating point values (a proprietary data compression scheme is
employed to save disk space)
Installation
To install Cube Voyager, follow the steps outlined below:
• First, install the Citilabs license from the CD or download file.
• Once the license files are installed, Cube Voyager should automatically be selected during
the installation of Cube.
For more on installing Cube Base & licenses, see Chapter 2, “Getting Started,” in the
Cube Base Reference Guide.
Getting Started > Starting Cube Voyager
• Create a new Cube Voyager application or open an existing one. Then, with the
Application open, select R un from the H o me ribbon tab.
See Chapter 14, “Application Manager,” in the Cube Base Reference Guide for
general information on setting up an application in Application Manager. See
“Running an application in Application Manager” on page 767 of the Cube Base
Reference Guide and “Running a Cube Voyager, TP+, or TRIPS program” on
page 767 of the Cube Base Reference Guide for specific information on running a
Cube Voyager application or program from Cube.
• Create or open a Cube catalog in Scenario Manager. Then from the Ca ta lo g ribbon tab,
select R un .
When running an application or program in Cube from Application Manager,
Application Manager builds a task run file, and a full Cube Voyager script file of the
entire job, and sends the task run file to a program called Task M o nito r . Task Monitor is
also called from Scenario Manager. See Chapter 16, “Task Monitor,” in the Cube
Base Reference Guide for a detailed description of this program. Task Monitor sends
the Cube Voyager script file of the run to the Cube Voyager program to run and
monitors and display status information about the run as shown in the figure below.
Getting Started > Starting Cube Voyager > Starting Cube Voyager from Windows
The Cube Voyager run monitor window will open and prompt the user for the following
data:
• The name of the s c rip t file that is to be run
• The wo rk ing d ire c to ry where the basic application data is stored. This is defaulted to the
directory where the job script file resides when a new job script file is selected.
• A R un ID (character string) that will be printed at the top of every printed page
• The E d it Inp ut File button can be used to open the current job script file in Cube for editing or
running directly from Cube. See “Starting a model run” on page 708 of the Cube Base
Reference Guide.
• Click the H id e button to minimize this instance of Voyager to the Windows system tray
(instead of the Windows taskbar). This is useful when a script is executing, and the user
wishes to minimize window clutter.
• When this data is completed and the Start button is pressed, Cube Voyager begins
execution and the S ta rt and the Ca nc e l buttons become the P a us e and the A b o rt buttons,
respectively. The Pause button can be used to pause the execution, while the Abort button
allows for pre-mature termination of the execution.
• During execution, periodic messages will be written to the window. The window can be
minimized or left open as Cube Voyager is executing. When the application is finished, the
V ie w P rint File button can be pushed to view the resulting run print file.
• The N o tify W he n D o ne check box can be used to bring the Cube Voyager window back on
top when it’s done, if it has been minimized during execution. The default behavior is to
have the Cube Voyager window maintain its current status, minimized or maximized, after
the execution is completed.
• The Send Email When Done check box can be used to send an email to report on the run status at
the end of a run. When selected the following dialog box appears which allows the user to
provide the same information documented in the Cube Voyager SENDMAIL statement
under the Pilot program.
• The H id e S c rip t check box can be used to exclude the contents of the script from the Print
file.
• The W a it S ta rt button can be used to place this instance of Cube Voyager in wait mode for
use as a processing node for Cube Cluster. See Chapter 15, “Cube Cluster” for a detailed
description of this process.
• The A b o ut V o y a g e r button can be used to get License and maintenance information and the
version and date of all Cube Voyager programs as well as some standard machine
information as shown on the About Voyager dialog below.
Getting Started > Starting Cube Voyager > Starting Cube Voyager from the command prompt
• pppp is a prefix (or project) that is pertinent to this application. Some files will always contain
these characters (maximum 4 characters) as part of their name. Most individual programs
will allow the prefix to be substituted directly for the ? character in their file names. The
characters must be those that are acceptable as part of filenames to the operating system,
and are not a Cube Voyager operator ('",+-*/&|). The program will generate a print file and
a var file with this prefix as its first characters. If the prefix is not designated, the program
will assign one based upon the following criteria:
If there is a pppp.PRJ file in the working subdirectory: the prefix will be set to the last
prefix in the file. If there is no pppp.PRJ, it will generate a file by that name. Warning:
Be sure that any pppp.PRJ file that Cube Voyager reads is a valid Cube Voyager
PRJ file.
The program automatically associates a unique sequence number with the prefix.
The pageht, pagewdth, and runid parameters can be reset dynamically by Cube
Voyager control statements within individual Cube Voyager programs. When set
within the individual programs, their effect may be valid for only that program.
• pagehtis the height (number of print lines) for a printed page of output. This will default to 58,
if the program can not find a height from the Cube Voyager PRJ file. The maximum value is
32767.
• is the maximum length a printed line can have. It may not be less than 72, nor
pagewdth
greater than 255. If it is not specified, and a width can not be found from the Cube Voyager
PRJ file, it will default to 132. Note that pagewdth will not cause longer length lines to be
truncated or folded; they will be written with the appropriate length. The primary use of
pagewdth is to assist in formatting messages and reports.
• workdiris the subdirectory that the application is to be run from. Normally, the user will log
onto the desired subdirectory, and workdir will not need to be specified. But, in some
operating environments, it may not be possible to log on to a subdirectory before starting
the program. (Windows may cause some problems in this area.) When the program starts,
it checks if workdir is specified, and if so, changes to that subdirectory before it processes
the other arguments (excluding filename).
• runid canbe used to specify a starting ID for the application. If ID is not specified, it will try to
obtain a starting ID from the Cube Voyager PRJ file with matching prefix.
• /HideScript to exclude the contents of the script from the Print file
• /Hide to hide the run dialog box completely when starting if auto start on
• /WinLeft:xx to set the window location and width/height or to restore screen size and
position when restart from Wait Start mode
• /WinTop:xx
• /WinWidth:xx
• /WinHeight:xx
As the Cube Voyager job is executing, periodic messages will be written to the Cube
Voyager run dialog if /Hide is not on. Pressing Ctrl-Break can be normally used to
prematurely terminate the run if the run dialog has been hidden. Otherwise, the Abort
button on the Cube Voyager run dialog can be used. When the Cube Voyager job is
completed, control will return to the windows command line interpreter.
General Syntax > Introduction to Cube Voyager control statements
Exam ple
COMP a = b + c = ; invalid: = is not in proper context
COMP a = b + c + ; valid: + is logical at this point
d + e / f ; continuation of previous line
ZDATI=myfile, z=2-4, emp=21-30 pop=40- ; valid: - is logical here
48, ; valid: , is logical here
sfdus = 51-55 & ; invalid: & doesn’t fit here
mfdus= 61-65
General Syntax > Control statement syntax
• Comments
• Null blocks
• Control blocks
• Control fields
• Keywords
• Subkeywords
• Expressions
Exam ple
ijk = @ijk@ ; retrieve value from Cube Voyager
xxx = @matrix.xxx@ ; retrieve value of xxx as set by prior matrix
PRINT LIST=’ijk from Cube Voyager PILOT=’, ijk ; will be OK
General Syntax > Control statement syntax > Comments
Comments
There may be comments appended to any control statement/line. Comments must be
preceded by a semi-colon (;). There may be any number of spaces before and/or after
the semi-colon; they are ignored. If a statement is continued onto subsequent lines,
each line may have comments. A semicolon (;) as the first character of a statement sets
the entire statement as a comment.
General Syntax > Control statement syntax > Comments > Example
Exam ple
FILEI NETI=myfile.nam, ; I/P network
ZDATI=zonal.dat ; Zonal data
; this entire line is a comment
In the previous example, the FILEI control statement is continued because a comma
follows the network filename. The statement could also have been coded as:
FILEI NETI=myfile.nam, ZDATI=zonal.dat ; I/P network, Zonal data
As a program reads each control statement, it is diagnosed, and listed to the system
print file, thus providing a document for the program application. Comments are very
helpful and should be used whenever it helps to clarify the application. If the first non-
blank character of a data record is a semi-colon, the record is not processed. Blank lines
can be used for spacing purposes. Blank lines following a line with a continuation
character are ignored, and the line following the last blank line is considered as the
continuation.
General Syntax > Control statement syntax > Null blocks
Null blocks
The null block is a section of the input stream that is not processed by the program; it is
skipped over when the program reads the control statement. The block begins with /*
and ends with */, and blocks may be nested. Therefore, care must be exercised when
null blocks are used; if another /* appears before the terminating */ is read, the program
assumes that there is another null block within the current one. This nesting allows the
user to block out a section of the control stream even if a section of the stream already
contains a null block. The rule is that each /* must have a matching */. A null block can
be used to block out stream terminators and even portions of a control stream specifying
other programs to be run. If a matching */ is not found, the end of the block is set to the
end of file on the control stream. Hint: to run only the first portion of an input stream,
place an unmatched /* record after the last desired statement.
General Syntax > Control statement syntax > Null blocks > Examples
Examples
FILEI NETI=myfile.nam, /* I/P network */ ZDATI=zonal.dat ; Zonal data ; ** valid,
but not recommend **
FILEI NETI=ipfile.net /* FILEO NETO=opfile.net */
FILEI NETI=myfile.nam, ; I/P network
/* ZDATI=zonal.dat ; Zonal data */
FILEO ... ; will be an error, because FILEI is to be continued.
General Syntax > Control statement syntax > Control blocks
Control blocks
A control block can be used to block a control statement. The standard format for a
control statement requires that the first word of the statement must be a valid control
word, and must be followed by at least one key word. The statement can optionally be
continued onto subsequent lines by use of a continuation character. Alternatively, a
control block can be used. A control block begins with the control word, white space,
and the {} character. All data up to the next {} character are considered as part of the
statement. If multiple lines are used, they need not contain continuation characters. The
statement will terminate with the {} character. Care must be taken: if there is no {}, the
remainder of the input stream will be appended to the current statement. If the
terminating {} is embedded within a literal string ('.. {} ..' or ".. {} .."), or it follows a
semicolon (;) on a line, it will not be recognized. Currently a control block may be on one
line, but planned revisions will probably preclude this capability. There is no reason to
have a control block on a single line, so it is advisable to not code them that way.
FILEI {
NETI = ... ; continuation character not required.
ZDATI = ...
}
FILEI {NETI = ... MATI = ... } ; not recommended – possible future change
FILEI {NETI = ... ; input network } ; invalid: comment precedes the {}.
FILEI {NETI = ... ; input network
} ; valid: the {} is on a separate line.
General Syntax > Control statement syntax > Control fields
Control fields
A field is a number, or character string, that stands by itself on a control statement. In this
system, fields are thought of as the characters that begin a word and continue until a
field terminator, or delimiter, is detected. The field does not contain the delimiter. The
standard field delimiters are blank, comma, equals sign, dash, or any mathematical
operator (+-*/|&). When a field is followed by a blank, the next non-blank character (if it
is one of the delimiters) is considered as the field delimiter. In many cases there need
not be a specific separator; the blank will suffice. Thus, A=B is the same as A = B, which
is the same as A= B. Likewise 1 2 3 4 5 is the same as 1,2,3,4,5 or 1, 2 3, 4 5.
Because many transportation-planning programs have traditionally used a dash as a
field separator, that tradition is carried over to this system. Dashes do cause some
ambiguity, however, because they are also the same as a minus sign. A dash is
therefore used to specify ranges of values, and to specify negative values, so care must
be taken. If a field is terminated by a dash, it is the beginning of a range. If a field is
begun by a dash, it is a negative value, unless it could also be construed as a range.
The rules applied when a dash is between fields are:
• If the dash touches the first field, or it touches neither field, it is a range.
• If the dash touches the second field without touching the first field, the dash is the sign for
the second field.
• If the dash touches the second field, and there is another dash between the first field and
the dash, it is a range with the second field being negative.
E xp re s s io n Me a ning
1,-5 error!
Keywords
All control information is entered by coding a keyword followed by an equals sign (=)
and then the value(s) to be entered for the keyword. Keywords may sometimes specify
vector data (multiple values for successive entries in a curve or array). When a vector
keyword is specified, the data is entered beginning at the first location in the array.
Optionally, the vector keyword may be subscripted, so that the values are loaded into
the array beginning at a specified location. A subscript is specified by inclosing it within
square brackets []. When a keyword is subscripted, there may be no special characters
prior to the right bracket (]); the subscript must fill the space between the [].
Most keywords that are subscripted are specific to the program, and the subscript must
be an integer constant. Some programs allow certain vectored keywords to have a
variable as the subscript; this is usually only when the keyword is on a COMP (or similar
type of statement).
Some keywords allow double subscripts to indicate a matrix of rows and columns. In
such cases, there are two sets of brackets [row][column]. For example: capacity
stratified by lanes (row) and spdclass (column). The row index sets the row where the
data is to load and the column index sets where in the row the data loading is to begin. If
there is no column designation, it is assumed to be one. One is the minimum value for
rows and columns. If there is more input data than is allowed in a row, the data spills into
the next row (beginning at that row’s column 1), but it will not fill beyond the end of the
array. In certain cases, three-dimensional arrays are allowed, but they are rare, and will
be more fully defined in the specific program documentation.
General Syntax > Control statement syntax > Keywords > Examples
Exam ples
LINKI= LIINKI[3]= NOX[2][7]= NOX[3]= ; single value format
VAL=10,20,30,35,40,50 ; VAL[1]=10, VAL[2]=20, …, VAL[6]=50
VAL[55]=770, VAL[83]=1200,1250 ; VAL[83]=1200, VAL[84]=1250
VAL(2) ; invalid, the subscript must be [2]
General Syntax > Control statement syntax > Subkeywords
Subkeywords
Some keywords (internal level 2) may have further descriptive keywords (level 3)
associated with them, and each of those sub keywords may possibly have another sub
keyword (level 4) associated with them. Level 4 is the maximum. A level 2 keyword may
be used at any time, but a level 3 keyword may be used only following a level 2, 3, or 4,
keyword. A level 4 keyword may be used only following a level 3 or 4 keyword. A sub
level keyword applies only to the prior higher ranking keyword. An example is the
Network program FILEI statement. The layering is as follows:
General Syntax > Control statement syntax > Subkeywords > Example
Exam ple
(1) FILEI
(2) LINKI=
(3) EXCLUDE= ; These are same level (3), and can be
(3) VAR= ; used only if LINKI has proceeded them.
(4) TYP= ; These subkeywords
(4) BEG= ; are all at
(4) LEN= ; the same level, and
(4) MIN= ; can not be specified
(4) MAX= ; unless VAR= is
LINKI=myfile, var=a, beg=1,len=5,
var=dist, beg=14, len=3,
var=street, beg=6,len=5,typ=c,
LINKI[2]=myfile2.dbf, var=a,b,dist,name; DBF file
In this example, the comma following typ=c on the third line is not necessary, since LINKI
is a valid FILEI invoking keyword. The typ=c applies only to street. With the comma, the
four lines form a single FILEI statement. Without the comma, they form two FILEI
statements.
General Syntax > Control statement syntax > Keyword values and documentation descriptions
Other characters in the criteria list provide more information about the keyword. Possible
characters and their meanings are:
Expressions
Expressions are either numeric formulas or selection criteria. Selection expressions may
contain embedded numeric expressions.
This section discusses:
• Numeric expressions
• String expressions
• Selection expressions
General Syntax > Control statement syntax > Expressions > Numeric expressions
N umeric expressions
Numeric expressions are written as traditional formulas, and contain operands
separated by operators. Standard hierarchy rules are followed; computation is
performed from left to right, and expressions within (…) are evaluated to a single value.
The hierarchy table for operators is as follows (with importance increasing in level):
Op e ra to r S y mb o l Le v e l
Subtraction - 1
Multiplication * 2
Division / 2
Modular % 2
Exponentiation ^ 3
Operators are preceded and succeeded by operands, which may be numeric constants,
character constants, variables, functions with their associated arguments enclosed
within (...), and sub numeric expressions enclosed within (...),
Numeric constants are entered as standard floating point numbers in the “US” format:
[ddd] [.] [ddd] [fmt[sn]ddd], where:
[fmt] optional e or E
• Trig functions
• Lookup functions
General Syntax > Control statement syntax > Expressions > Numeric expressions > Numeric functions
Trig functio ns
NOTE: Trig functions are applied to values that are in degrees. To convert radians to
degrees:
Degrees=Radians*180/ð
Lo o kup functio ns
Lookup functions are defined by a LOOKUP control statement. The statement must
contain the source of the lookup data, the name to give the function, and optional
parameters to control the actual lookup of data. See “LOOKUP” on page 57 for a details
about the control statement.
Each program may have a list of functions that are unique to the specific program.
Those functions will be described with the specific program documentation. In some
cases, the user will be allowed to define specific functions for use by the program.
Functions that look up a value in an array or in a set of curves are examples of user
functions.
General Syntax > Control statement syntax > Expressions > Numeric expressions > Examples of valid expressions
String expressions
String expressions result in string values. String values are specified between single
quotes (e.g., 'abcde'). If a sting contains a single quote character, those strings should
be enclosed inside back quotes (e.g., `abc'de`). Character/ String functions can be
used in the expression.
General Syntax > Control statement syntax > Expressions > String expressions > Character/ String functions
Result:
Current Date/Time= 2013-07-23 20:07:17.72
Low Date/Time= 2013-02-03 13-2-3 04:07:09.485 4:7:9.485 377748:07:09.485
High Date/Time= 2013-11-20 13-11-20 13:27:49.485 13:27:49.485 384717:27:49.485
Low Elapse Time= 000:00:01.23
Low Elapse Time= 004:05:06.79
High Elapse Time= 098:17:56.79
General Syntax > Control statement syntax > Expressions > Selection expressions
Selection expressions
Selection expressions are used to specify criteria for selecting something. The
expression is always enclosed within (...), and, when evaluated, results in a single true
or false value. The syntax is similar to standard C language, but there are some
exceptions. The expression may contain nested and/or a series of comparisons. The
following comparison operators are used to determine the relationship between the
expressions on either side of the operator (the left expression is A, and the right
expression is B):.
E xp re s s io n D e s c rip tio n
A =B A equals B.
A == B A equals B.
A != B A is not equal to B.
With the = operator, B may be expressed as a series of values, and/or ranges. For
example: I=1-5,15,30-99,212 means if I is 15, or 212, or falls within any of the ranges.
A or B can be a numeric expression enclosed within (...). For example:
(((a+b)/3 * k) = 0.5-1.9,27.2)
Further, ranges are supported only with the = operator. To exclude certain ranges, use
the not (!) operator, such as !(I=2-16). For example, to exclude indices 2 through 16, the
following two expressions are incorrect (resulting in checking if variable not equal to
-14):
IF (variable != 2-16)
...
; Incorrect
IF (!(variable = 2-16))
...
The range equal operator also works with strings, such as Name='S','U','X'-'Z'. String
comparison is based on the ASCII code value of each character and is done from the
left to right until the right-side string is exhausted. In other words, the number of
characters compared is the string length on the right side. For example,
('abcde' = 'ab') is equivalent to ('ab' = 'ab'), which is true.
On the other hand,
('ab' = 'abcde') is false.
For a full length string comparison (exact match), compare both ways as below:
((‘abcde’=’ab’) & (‘ab’=’abcde’))
One should never use an empty or null string on the right side of a comparison
expression. It will always be true for equality comparison and false for other types of
comparisons.
Since a blank, ' ', is less than any printable character in ASCII code value, we can check
if a text field is not empty using the following expression:
(LTrim(TextFld) > ' ')
Comparisons can be logically combined with other comparisons by using the AND
operator (&&) or the OR operator (||). When logical combinations are made, it is wise to
enclose them within (...); it is not always necessary, but it helps to eliminate ambiguity. A
comparison enclosed within (...) can be preceded with the NOT operator (!) to cause the
comparison result to be inverted. For example: !(i=5-10,12) means if I is not within the 5-
10 range, nor is it equal to 12. AND and OR can currently be specified as single & and |,
but this could change in the future.
General Syntax > Control statement syntax > Expressions > Selection expressions > Example of complex selection
Case: Insensitive.
I Indicates Input
NOTE: LI.name and NI.name are used when there is only one NETI allowed in the
program (currently applies to only the Highway program).
General Syntax > Standard control statements
• COMP
• CONSOLE
• FILEI
• FILEO
• GLOBAL
• ID
• LOG
• LOOKUP
• PRINTROW
• READ
• SORT
General Syntax > Standard control statements > Control statement introduction (general syntax)
Key1 Key1 Key1 (Key2 Key2 (Key3 Key3) ) Key1 (Key2) ...
ControlWord is the statement type and must be the first keyword on each statement,
unless the statement contains “trigger” keys, and the first keyword is a trigger keyword
followed by an equals sign. See the keyword description below for details about trigger
keys, denoted by K within the |...|.
Ke y D e s c rip tio n
The parenthesis () are used only to indicate the key level; they are not coded on the
statement. A keyword must always be followed by an equals sign and appropriate
value(s).
The following example illustrates the hierarchy of control statement description:
CTLWRD
AAA BBB (CCC DDD) EEE FFF (GGG (HHH III) JJJ (KKK) )
This description indicates that AAA, BBB, EEE, and FFF are all valid keywords. They
must be followed directly by an equals sign and the associated values, and may appear
any place a keyword is allowed. CCC and DDD are valid level 2 keywords, and may
appear only following the values for either BBB, CCC, or DDD. GGG may follow the
values for FFF, GGG, HHH, III, JJJ, and KKK. HHH and III are level 3 keywords, and
may appear only following the values for GGG, HHH, or III. KKK is also a level 3
keyword and may appear only after the values for JJJ or KKK.
COMP
COMP statements are used to dynamically assign values to variables and/or matrices.
COMP statements contains one, or more, keywords with associated numerical and/or
character expressions. Each expression results in a number or a character string; its
mode is usually determined by the first term in the expression. If the first term is a
number, or numeric variable, it is a numeric expression, or if the first term is a character
function or literal character string (beginning with a quote), it is a character expression.
Every term within the expression must be known to the expression at the time the COMP
statement is to be compiled. Often a variable is defined by its presence as a keyword in
another COMP statement. If there are multiple expressions on a COMP statement, they
are solved in left to right order.
K = j + 2 ; defines K as a numeric variable.
name=' ' ; declares name as a variable that is 4 characters long.
namx=substr(name,1,3)+'abcde'+str(k,4,1) ; declares namx as a character variable
that is 12 characters long.
All numeric variables that are declared by the user in this manner are internally treated
as double precision floating point variables.
Some programs (mostly those involving zonal matrices) may allow the use of INCLUDE
and EXCLUDE keywords on the COMP statement. When the statement contains either, or
both, of these keywords, it means that the statement will be subjected to a zonal filter
before being processed. The zonal filter will refer to either I (origin zone) or J (destination
zone); the program definition will clarify which. If an INCLUDE is present, the zone number
will be checked against the zones in the INCLUDE list. If it fails the INCLUDE list
specifications, the statement is bypassed. Then, if there is an EXCLUDE, the zone is
checked with the EXCLUDE list. If it meets the EXCLUDE list specifications, the statement is
bypassed.
General Syntax > Standard control statements > CONSOLE
CONSOLE
A CONSOLE statement is used to set certain switches relative to dynamic display of
messages in the message area of the window.
S ta te me nt D e s c rip tio n
FILEI
FILEItells the program which input files to process. In most cases, if there is no FILEI
statement, the program will assume a default statement, or simulate certain required
defaults. Typical keywords on a FILEI statement are NETI, MATI, and ZDATI. When the
program accepts FILEI vectored keywords, such as MATI in various programs, the
keyword may contain [i]. If [i] is not specified, [1] is assumed. Most times the statement
may begin with the keyword itself, thus eliminating the need to code FILEI. The exact
format of the FILEI statement will vary between programs.
FILEI MATI=?01.mat, ?02.mat, ?03.mat,
NETI=??.mat
MATI[1]=?01.mat, MATI[2]=?02.mat, MATI[3]=?03.mat NETI=??.mat
; this would be the same as the above FILEI statement.
Some FILEI keywords may allow sublevel keywords that are associated with the file
keyword. In some programs, all FILEI statements must be in the beginning of the control
stream, because later control statements may reference variables that are to come
directly from the files. The documentation for each program will indicate where the FILEI
statements are valid. Generally, programs delay opening FILEI files until absolutely
necessary, but it is wise to form the habit of placing all FILEI statements first in the control
stream.
Hint: It is relatively easy to miscode FILEI statements by either omitting or including line
delimiters. For example:
FILEI MATI[1]=… ; this is single FILEI statement
MATI[2]=… ; this is a single FILEI statement
MATI[5]=…, ; this is a FILEI statement with continuation
Abc=def ; but this is probably an invalid FILEI continuation
NOTE: Application Manager automatically writes all FILEI statements to the script file
when you define input file boxes. If you use Application Manager, do not manually edit
the file path or file name elements of the FILEI statements, as both the script file and the
application’s .app file stores this information. Editing the file path or file name will result in
a mismatch between the file that the script uses when it runs and the file Application
Manager opens when you double-click an input file box. (See Chapter 14, “Application
Manager,” in the Cube Base Reference Guide.)
General Syntax > Standard control statements > FILEO
FILEO
FILEO is the counterpart to FILEI; it names the output files that the program writes. If there
is no FILEO statement, some programs will generate an appropriate statement. The exact
format of the FILEO statement varies between programs.
NOTE: Application Manager automatically writes all FILEO statements to the script file
when you define content for output file boxes. If you use Application Manager, do not
manually edit the file path or file name elements of the FILEO statements, as both the
script file and the application’s .app file stores this information. Editing the file path or file
name will result in a mismatch between the file the script writes during runs and the file
Application Manager opens when you double-click an output file box. (See Chapter 14,
“Application Manager,” in the Cube Base Reference Guide.)
General Syntax > Standard control statements > GLOBAL
GLOBAL
Alters the size of a page on the standard print media. Keywords include:
• P A GE H E IGH T
• P A GE W ID T H
The keywords are trigger keywords; you need not specify “GLOBAL.”
GLOB A L k e y wo rd s
Ke y wo rd D e s c rip tio n
If these parameters are specified, they remain in effect through subsequent programs
until revised.
General Syntax > Standard control statements > GLOBAL > Example
Exam ple
PAGEHEIGHT=32767 ; preclude insertion of page headers
General Syntax > Standard control statements > ID
ID
An ID statement is used to revise the page headings for each printed page. The length
of the ID text will be truncated to 60 characters. The ID is specified as: ID=newid string.
The ID is revised in one of two ways: with the ID statement, and (in some programs) by a
COMP ID=text expression. ID statements in Cube Voyager Pilot program are dynamic;
they cause the ID to be revised when the statement is processed in the Cube Voyager
operations stack. ID statements in the application programs cause the ID to be revised
only when the statement is encountered in the statement reading and editing phase prior
to actual program execution. This can cause the sign-on ID to be revised at a time
different than what might be expected. Because of this situation, it is suggested that ID
statements be used before a RUN statement. That way, the sign-on page for the
application program will contain the desired ID.
General Syntax > Standard control statements > ID > Example of improper ID location
In this situation, the first page (sign-on) for the Matrix application will not contain the “this
is the MATRIX ID” as its header, but the first page of the Highway section would contain
it. If the RUN and ID statements were reversed, the sign-on IDs would be correct.
When ID is specified as the destination in a COMP statement, the ID can be computed,
and it is revised at that time (but will not be reflected in the headers until a new page is
required). In the COMP statement, parts of the ID can be computed. This would most
likely be used in a Cube Voyager loop situation:
General Syntax > Standard control statements > ID > Example of Computing the ID
Exam ple
ID=This is the new Page Header
General Syntax > Standard control statements > IF ... ELSEIF ... ELSE ... ENDIF
• IF/ELSEIF expression is false — The next statement to be executed is the next associated
ELSEIF, ELSE, or ENDIF statement.
General Syntax > Standard control statements > IF ... ELSEIF ... ELSE ... ENDIF > Example
Exam ple
IF (I<0)
s1...
ELSEIF ( I>=0 & I<5 )
s2...
ELSEIF (I==8)
s3...
ELSE
s4...
ENDIF
-1 S1
3 S2
9 S3
>9 S4
If, in the example, there were no ELSE statement, then any time I is greater than 8, no
statements between the IF and the ENDIF statement would be executed.
A variation of the IF statement (sometimes referred to as a simple or short IF) is one in
which a single control statement is appended after the IF expression. In such cases, the
program automatically generates the required ENDIF. This shortcut statement is provided
to help reduce the amount of coding required. Note: if a short IF is used and the
statement appended to the statement is not acceptable in that context or is mis-
structured, the error diagnostic stated about the line may be somewhat confusing. This
is because the system can not always fully ascertain exactly what the problem is. It is
diagnosing an IF statement, but the appended statement has errors, so it doesn’t know
exactly where to place the blame because it is diagnosing the IF statement at the time.
Note that there is no corresponding short ELSEIF statement and no control statements
may directly follow ELSEIF or ELSE or ENDIF statements on the same line or they will be
ignored by the processor.
IF ( i == 1) counter=0
IF ( i == zones) print ...
IF (j==3 & k==5) k=3 ; This statement will be OK, ENDIF generated.
cnter = cnter + 1 ; and this is OK
ENDIF ; This will fail, because there is no associated IF.
IF (j==3 & k==5) k=3, ; This statement will be OK
cnter = cnter + 1 ; and this will continue it
; Generated the ENDIF here
ENDIF ; So, this will be an error.
General Syntax > Standard control statements > LOG
LOG
Writes values to the log file. Keywords include:
• P R E FIX
• VAR
Cube Voyager maintains a file called the log file; it has a filename with an extension of
.VAR. Whenever a RUN statement is encountered, Cube Voyager updates the values in
the .VAR file with the values for all the variables that Cube Voyager is maintaining plus
the values that were logged by any programs. If a program is requested to LOG any
values, the program appends values to the .VAR file, and Cube Voyager retrieves the
values when the program terminates.
The values in the .VAR file can be accessed in two different ways: 1.) in Cube Voyager,
the variable can be accessed directly; 2.) in other programs, the values can be retrieved
by the use of the @…@ token process. In the latter case, the value from the .VAR is
substituted directly into the control statement as it is read. A LOG statement is used to
have a program write values to the .VAR file. The variables in the .VAR file can be
retrieved by other Cube Voyager programs (including the Pilot program) in the same job.
Examples may help to clarify this process.
RUN PGM=MATRIX ; (Cube Voyager tests the value from MATRIX):
ZONES=5
MW[1] = 1
TOTMW1 = TOTMW1 + ROWSUM(1)
LOG VAR=TOTMW1
ENDRUN
IF (MATRIX.TOTMW1 == 0) ABORT MSG=’Nothing in MW1’
RUN PGM=HIGHWAY ; (HIGHWAY obtains a value from MATRIX):
.
X = @MATRIX.TOTMW1@
.
ENDRUN
The records that are written to the file are written as PREFIX.VAR=value. The current
version of Cube Voyager truncates .VAR string values with embedded or trailing spaces
at the first space when it reads the values. This is scheduled for revision in a
subsequent release of the system.
LOG k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
RUN PGM=MATRIX
.
LOG PREFIX=MATRIX1, VAR=TOTMW1, AVEMW
LOG VAR=GRANDTOTAL ; will be written as MATRIX1.GRANDTOTAL=#####
General Syntax > Standard control statements > LOOKUP
LOOKUP
A LOOKUP statement is used to define a lookup function and to enter data for the
function. Keywords and subkeywords include:
• FA IL
• FILE
• IN T E R P OLA T E
• LIS T
• LOOKU P I
• N A ME
m
LOOKUP
m RESULT
• NEAREST
• R
• SET UPPER
• S IZE
• T OLE R A N CE
The statements are not dynamic; they are processed at the appropriate time by the
program, prior to their actual use. Lookup functions are referenced from within numerical
expressions. When the function is referenced in an expression, the correct number of
arguments enclosed within parenthesis must follow it. The function returns a single value
to the expression solver. A lookup array is allocated and initialized with the data
referenced by the LOOKUPI, FILE or R keywords. In most cases, a lookup statement will
define a single set of lookup data, but if a LOOKUP subkeyword follows the NAME, the
function will be defined as one that requires at least two arguments (curve number and
the value to be searched for). This latter format is useful for entering friction factors for
use in the Distribution program. Data referenced by LOOKUPI or FILE keywords can be
either in DBF, MDB, or delimited ASCII format.
A new wizard feature has been added to Cube to automate the coding of a LOOKUP
function when linking a DBF file to a LOOKUPI file box in Application Manager. See
Chapter 12, “Job Script Editor Window,” in the Cube Base Reference Guide for
information about this wizard.
LOOKU P k e y wo rd s
Each data record must have at least two fields delimited by white space, or commas
or may be separate fields on a DBF file. The first field on a record is the lookup result,
and the fields following it are the lookup values. If two numbers are separated by a
dash, they form the low and high limits of a row. Numbers not separated by dashes
are entered as both the low and high limits of a row. Ranges may not overlap, but the
upper limit of a row may be equal to the lower limit of the next row. If the argument
matches a high limit of a row and the low limit of the next row, the result is obtained
from the upper row. (For example, first row limits=1-2, second row limits =2-3. The
result for 2 would be obtained from the second row.)
• Data records when LOOKUP subkeyword is not used and data source is DBF or MDB:
Only the first two fields on the DBF or MDB lookup file will be used. The first field is
the lookup result and the second field is the lookup value. The first two fields should
be numeric fields but character fields are ok as long as the content can be converted
to numerics, otherwise the program will report a lookup input error.
• Data records when LOOKUP subkeyword is used:
Each data record may have any number of fields delimited by white space, or
commas or may be separate fields on a DBF or MDB file. The data for each LOOKUP
is obtained from the record according to the field numbers or names specified for the
LOOKUP and RESULT keywords. If either field number exceeds the number of fields on
the record, there is no row generated for that curve. If both fields exist, they form a row
with the low and high limits equal to the value from the LOOKUP field.
When the lookup format designates multiple curves, special consideration is given to
blank fields. Blank fields are not treated as zeroes, but indicate there is no data point.
For example, assume the following records:
T, v1, v2, v3
1, 101, 201, 301
2, 102, 202, 302
3, 103, , 303
4, 104, 204
5, , , 305
There will be no data points for T=3,V2, T=4,V3, T=5,V1, and T=5,V2. The V1 curve
will have points for T=1-4, the V2 curve will have points for T=1-2,4, and V3 will have
points for T=1-3, 5. The result for a lookup of T=3 in V2, will depend upon the options of
the LOOKUP statement (SETUPPER, INTERPOLATE, or none).
Be aware that this situation exists only for comma delimited and dbf data; space
delimited records don’t have any way to designate null fields; the first empty field
indicates the end of the record, and no more points appear on the record. With space
delimited records, the T=3 record would appear as “3 103 303”, which would be
interpreted as points for V1 and V2; V3 would be blank.
General Syntax > Standard control statements > LOOKUP > Example: Single value function
1 1 2
2 2 1
3 3 1
4 8 1
9 10 3
23 23 1
50 50 15
The traditional format for friction factors has been one in which the first field on an input
data record is the time value, and the subsequent fields are the factors for the various
purposes that are being distributed. This example illustrates that typical process.
Because the Cube Voyager distribution process is generic, it is possible to have times
that are below the minimum time and greater than the highest time. The normal (default)
process would return a 0 for those values (from the FAIL values), but that may not be
what is expected. In most situations, users may wish to have values for times that
extend beyond the limits of the values entered.
For example: a table might have factors for times from 1 through 100, but there are
zone-to-zone times that are greater than 100 minutes. The time matrix might also have
very large values, or possibly zero, for zone-to-zone movements for which there is no
path (inaccessible). Thus, if a time of 110 is encountered, the friction factor obtained
from the lookup would be the FAIL[2] value; this may not be what was wanted. A similar
situation would occur if the time were less than 1, but greater than 0. To circumvent
these potential problems, be sure to include a record for a very low time value (say
0.01), and a record for the highest time value that you feel is reasonable. The factors of
the two first records should be the same, and the factors for the last records should also
be the same.
The lookup values can be set so that only trips within a certain item range can be
distributed. The limits of the curve would control this operation; a friction value of 0 will
preclude distribution between the zones.
LOOKUP NAME=FF, ; typical Friction Factor table
LOOKUP[1]=1, RESULT=2, ; Curve 1 lookup value is in field 1
; Result (FF) for curve 1 is in field 2
LOOKUP[2]=1, RESULT=3, ; Curve 2 lookup value is in field 1
; Result (FF) for curve 2 is in field 3
LOOKUP[3]=1, RESULT=4, ; Curve 3 lookup value is in field 1
; Result (FF) for curve 3 is in field 4
FAIL=2000,1,0, ; return 2000 if any lookup < 0.01
; return 1 if any lookup > 120
INTERPOLATE=Y, ; interpolate to obtain values
R= '0.01 1200 1000 800',
'1 1200 1000 800',
'3 300 500',
'4 100 100 100',
'5 50',
'120 50 100 100'
FFX = FF(1,3) ; RESULT = 300
FFX = FF(3,150,888) ; RESULT = 888 since 150 > highest value in field 1
FFX = FF(2,2) ; RESULT = 750
/* to find 2 in field 1, you must interpolate between 1 and 3
then interpolate on same basis between 1000 and 500 in field 3
*/
The lookup table will be represented as:
1 1 1 1200
1 3 3 300
1 4 4 100
1 5 5 50
1 120 120 50
2 1 1 1000
2 3 3 500
2 4 4 100
3 1 1 800
3 4 4 100
Exam ple: Do uble value functio n — LOOKUP with DBF LOOKUPI file
FILEI LOOKUPI[1] = "C:\CUBETOWN\TAZ\TAZ.DBF"
LOOKUP LOOKUPI=1, ;references the input DBF file
NAME=TAZ, ;name for this function
LOOKUP[1]=TAZ, RESULT=ACRES, ;lookup a value in TAZ return
;a the value from ACRES
LOOKUP[2]=TAZ, RESULT=POPULATION,
LOOKUP[3]=TAZ, RESULT=AGE_5_14,
LOOKUP[4]=TAZ, RESULT=AGE_15_17,
LOOKUP[5]=TAZ, RESULT=ENROL_ELEM,
LOOKUP[6]=TAZ, RESULT=ENROL_HS,
LOOKUP[7]=TAZ, RESULT=TOTAL_JOBS,
LOOKUP[8]=TAZ, RESULT=RET_JOBS,
LOOKUP[9]=TAZ, RESULT=SERV_JOBS,
LOOKUP[10]=TAZ, RESULT=OTH_JOBS,
INTERPOLATE=F
; example of use: v=TAZ(10,25)
; look for 25 in the TAZ field and returns the OTH_JOBS value
General Syntax > Standard control statements > LOOKUP > Example: Double value function — Using LOOKUP to get
constants and populate internal arrays with the values
Exam ple: Do uble value functio n — Using LOOKUP to get co nstants and po pulate internal arrays with
the values
FILEI ZDATI[1] = "C:\MTA_GEN\STEP1.DBF"
FILEI LOOKUPI[1] = "C:\MTA_GEN\CFACS.DAT"
cc=zi.1.cc ;cc = county code (1=LA,2=OR,3=RV,4=SB,5=VN)
; lookup county correction factors O&D Survey
LOOKUP LOOKUPI=2 LIST=Y NAME=CFAC,
LOOKUP[1]=1, RESULT=2,
LOOKUP[2]=1, RESULT=3,
LOOKUP[3]=1, RESULT=4,
LOOKUP[4]=1, RESULT=5,
LOOKUP[5]=1, RESULT=6,
INTERPOLATE =N
; dimension user arrays to 5
array c0=5 cv=5 c2=5
; fill arrays for factors by county
LOOP cc=1,5
c0[cc]=CFAC(cc,1)
cv[cc]=CFAC(cc,2)
c2[cc]=CFAC(cc,3)
ENDLOOP
/* ;external LOOKUPI file in this example
1 3.4108 3.4137 3.7070 3.4132 3.2278
2 0.6088 0.6767 0.6505 0.6389 0.6759
3 0.5665 0.6518 0.5778 0.5757 0.6642
*/
General Syntax > Standard control statements > LOOKUP > Example: Double value function — Using LOOKUP with DBF
data in a trip Distribution application
Exam ple: Do uble value functio n — Using LOOKUP with DBF data in a trip Distributio n applicatio n
RUN PGM=DISTRIBUTION PRNFILE="DISTRIBUTION.PRN"
FILEI ZDATI[1] = "TRIP ENDS.DBF"
FILEI MATI[1] = "TRAVEL TIMES.MAT"
FILEI LOOKUPI[1] = "FRICTIONFACTORS.DBF"
FILEO MATO[1] = "PERSON TRIP TABLE.MAT",
MO=1-4, NAME='Home_Based','NonHome_Based','School',’EI_Trips’
; Set a maximum number of iterations and convergence criterion
PARAMETERS MAXITERS=99, MAXRMSE=5
; Link the input production and attraction values to internal variables
SETPA P[1]=ZI.1.P1, A[1]=ZI.1.A1,
P[2]=ZI.1.P2, A[2]=ZI.1.A2,
P[3]=ZI.1.P3, A[3]=ZI.1.A3,
P[4]=ZI.1.P4, A[4]=ZI.1.A4
; Put the travel time matrix into a working matrix for distribution
MW[20]=MI.1.TIME
; Put the friction factors into a LOOKUP for distribution
LOOKUP LOOKUPI=1,
NAME=FRICTIONFACTORS,
LOOKUP[1]=TRVLTIME, RESULT=HOMEBASED,
LOOKUP[2]=TRVLTIME, RESULT=NONHOME,
LOOKUP[3]=TRVLTIME, RESULT=SCHOOL,
LOOKUP[4]=TRVLTIME, RESULT=EXT_INT,
INTERPOLATE=T
; Distribute trips using a standard gravity model formulation
GRAVITY PURPOSE=1, LOS=MW[20], FFACTORS=FRICTIONFACTORS
GRAVITY PURPOSE=2, LOS=MW[20], FFACTORS=FRICTIONFACTORS
GRAVITY PURPOSE=3, LOS=MW[20], FFACTORS=FRICTIONFACTORS
GRAVITY PURPOSE=4, LOS=MW[20], FFACTORS=FRICTIONFACTORS
ENDRUN
PRINT
Formats data items and writes them as a single line to the standard printed output, a file,
or both. Keywords and subkeywords include:
• CFOR M
• CS V
• FILE
m APPEND
m PRINT
m REWIND
• FOR M
• LIS T
• P R IN T O
m PRINT
m REWIND
The size limit of a single data item (or print field) written a PRINT statement is 50,000
characters. This facilitates transferring large amounts of data between files, for example.
Certain print modes, however, restrict the field width — see Defining a numeric print
format, and Defining a character print format.
The program prints one line for each PRINT statement. The length of the printed line is
determined by the formatting of each listed item.
P R IN T k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ples
where:
• w — Total field width. Maximum value is 30. If you specify a value greater than 30, the
program uses a width of 30.
• d — Number of digits printed after the decimal point. The program sets d to 0 if the format
begins with w and you do not specify d. Maximum value is 15. If you specify a value greater
than 15, the program uses 15 digits after the decimal point.
• E — Display numbers in scientific format. Field width must be at least 9, otherwise the
program resets the format to the default value (10.2). The smallest format is 9.1E, which
prints as +1.2E+123. If you set d to 0, the program uses the maximum decimal (w-8). If there
are more post-decimal digits than this maximum value, then the program reduces the post-
decimal digits to w-8. You may specify B or D along with E; the program ignores other
format codes when you specify E.
• L — Trim numbers on the left and print the result beginning with the left-most digit. The
result will be left justified and only as long as required.
• R — Replace a number’s trailing 0s (right side of decimal point) with spaces. The program
replaces zeros after normal formatting and removes decimal point if there is no trailing 0.
• T — Truncate numbers on the left if they cannot fit the field width. Normally, the program
formats such numbers with all asterisks.
All characters are optional. The BCDELRST characters (case insensitive) may be in
any order, but must follow w.d, if w and d are specified. The program ignores characters
other than B and D specified with E. Citilabs recommends that you use a varying length
format unless you must align reported values. The program attempts to accommodate
fixed formats: When values do not fit the specified field width, the program drops
commas, and then reduces the number of decimal places; finally, the program reformats
with scientific notation (1E+ppp), if possible, otherwise the program truncates.
If printing an unknown range of values, specify a width adequate to accommodate all
possible ranges. For delimited output, FORM=16.4LRS is probably adequate. When printing
fixed fields, do not specify L, R, and S.
General Syntax > Standard control statements > PRINT > Defining a character print format
where:
• w — Total field width. Set to 0 to indicate that the field width depends on the string length.
Specify w anywhere in the format string; any number not preceded by a period specifies w.
If a format string specifies multiple w values, the program uses the last value.
NOTE: If the format specifies L, w must be wide enough to accommodate the string.
• d — Number of leading spaces printed (or dashes, if D specified). Specify d anywhere in the
format string; any digit preceded by a period specifies d. If a format string specifies multiple
d values, the program uses the last value. Valid values range from 0 through 15. The
default value is 0.
• T — Trim leading or trailing spaces from text item. If L is specified, delete leading spaces. If
R is specified, delete trailing spaces. If both L and R are specified, delete leading and
trailing spaces and center-justify text item.
• R — Right-justify text item (truncating beginning characters if length exceeds field width).
All characters are optional. The CDBTLR characters (case insensitive) may be in any
order. Citilabs recommends using a varying length format unless you must align
reported values. The program attempts to accommodate fixed formats. When text does
not fit the specified field width, the program truncates.
General Syntax > Standard control statements > PRINTROW
PRINTROW
Formats and prints all cells or selected cells of a matrix row to the main print file.
Keywords include:
• BASE1
• FOR M
• J
• MA XP E R LIN E
• MW
• T IT LE
Ke y wo rd D e s c rip tio n
For neat-appearing reports, Citilabs suggests specifying FORM without the LD, setting
BASE1 to true, and setting M AXPERLINE to some integral of 10.
General Syntax > Standard control statements > PRINTROW > Example
Exam ple
PRINTROW mw=1-2,8 form=LRD title='form=LRD'
PRINTROW mw=1-21 form=6D base1=y maxperline=10
General Syntax > Standard control statements > READ
READ
Switches reading of control statements to a different file. Keywords include:
• FILE
• ne ws tring
• o ld s tring
R E A D k e y wo rd s
Ke y wo rd D e s c rip tio n
READ statements can be nested up to five levels. A nested READ may not point to a file
that is already in the nest. There is no specific limit to the length and number of
replacement strings. The replacement process is designed to not allow a replacement
string to replace an earlier replacement. Replacements are done in the left to right order
as specified in the READ statement.
READ statement is processed differently, depending on, if it is used in a PILOT script or
as part of a Voyager program, such as MATRIX. When the READ statement is used in a
PILOT script, Voyager checks for the existence of the read file, before starting the run. If
the file did not exist Voyager will fail. Any variables declared within the file will be set
before the start of the run. When READ statement is inside other programs such as
MATRIX, HIGHWAY, etc., the read files are checked and the statements inside the files
are read only during the run.
General Syntax > Standard control statements > READ > Example
Exam ple
READ FILE=BUSLINES, ‘MODE=5’ = ‘MODE=3’
General Syntax > Standard control statements > SORT
SORT
Sorts an array, or series of arrays. Keywords include:
• ARRAY
• N U MR E CS
S OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple 1
SORT ARRAY=A,B,C
; Sort on ascending values in A, carry B & C along with A
SORT ARRAY=-A,B,C
; same as above, but sort order for A is descending
SORT ARRAY=-A,'+B',-C,D,E
; sort on descending on A, ascending B, descending C
SORT ARRAY=-A,B,'+C'
; *** ERROR *** signed name (+C) follows unsigned (B)
General Syntax > Standard control statements > SORT > Example 2 (Matrix, Fratar, Distribution, Generation)
Co d e Me a ning
3 Terminated by user
Should you receive code 4 or greater, Citilabs recommends contacting the Support staff
if you have questions. Please visit http://www.citilabs.com/cubeoutputsupportform.html
or contact generalsupport@citilabs.com.
Pilot Program > Using Pilot program
• Process
Output files
A project file, pppp.PRJ, is maintained (generated, if necessary) in the working sub-
directory. It contains certain values that help the program to establish unique project
identifications between applications that are run at separate times, and those that might
be run simultaneously in a separate thread in a multitasking environment. Each
application run generates a print and a variable file. The file names are ppppnnnn with
extensions of PRN and VAR, respectively. The pppp portion of the name is the project
prefix obtained from the P argument on the command line. The nnnn is a sequential
number assigned in conjunction with data obtained from the project file. The variable file
will contain a list of all the variables and their values that are in the Vars array when the
program terminates. If there are no specific Vars to be written; this file will be deleted.
Otherwise, the VAR file is renamed to pppp.VAR. Consequently, there will be only one
VAR file for each prefix.
NOTE: If Cube Voyager does not seem to sign on correctly, or indicates strange
filenames or default parameters, most likely the pppp.PRJ file has been corrupted. In
such cases, the remedy is to delete the pppp.PRJ file and restart the process. Cube also
uses .PRJ files, and it is possible for the user to confuse the two and store Viper
configuration information into a Cube Voyager .PRJ, and vice versa.
Pilot Program > Using Pilot program > Process
Process
Recent changes in recommended planning analysis dictate that the simple serial
processing may become inadequate. There will need to be “recursive” applications that
are driven by intermediate results. Ideally, this process could be written into a large
program, and handled as such. But there are disadvantages to that approach (not
discussed in this document). A typical simplified highway application would require that
the following steps be run (after the network and trip end data have been compiled and
checked):
1. Build paths, and add distribution parameters (terminal and intrazonal times).
3. Adjust person trip matrices to account for non-model characteristics, peak period factors,
and auto occupancy.
After the application of a series of programs to accomplish this has been completed, you
would have to verify the results, and decide if the process needs to be rerun with
adjustments, or if the results are satisfactory. The decision process usually will include
some type of numerical analysis. If the results of the analysis are not satisfactory, the
process may be repeated with some adjustments in the input data, or parameters.
Typically, the repeat process is just that: the input data and/or parameters are modified,
and the process is resubmitted.
Cube Voyager simplifies this process by allowing the user to program the process to
adjust the data and/or parameters and automatically repeat the entire process, or just
selected portions of it. In the simple case, if the final speeds are not acceptable, the
process could be looped until speeds come into a reasonable balance, or until it is
decided that a proper balance can not be achieved. That is only a simple portion of the
capabilities of Cube Voyager. As the user learns more of its capabilities, he/she will find
that he/she can control the process in many innovative ways.
The input is comprised of computational, flow control, program, and system statements.
The program begins by reading and editing the Cube Voyager specific statements. The
non-Cube Voyager statements (system statements, and the statements that follow a
RUN statement until its terminating statement) are not edited by Cube Voyager.
When all Cube Voyager statements have been edited for basic syntax, and have been
stored in the control stack, the program builds a list of variables and their values from all
the COMP and LOOP statements and the variables found in the optional VARI file. The
list is stored in the Vars array. It then begins processing the control stack at the
beginning. Each stack statement is executed, and flow branches to the next appropriate
stack statement. When the end of the stack or an EXIT statement is reached, the
program terminates.
Stack statements fall into several categories:
• Computational statements — Cause variable values to be updated. Typical control statements are:
COMP (often invoked by simply: var = )
• — Help to determine which statement is to be performed next. Typical flow
Flow control statements
control statements are:
m
GOTO
m
:LABEL
m
ONRUNERRORGOTO
m
CLEARERROR
m
LOOP BREAK CONTINUE ENDLOOP
m
IF ELSEIF ELSE ENDIF
m
EXIT
The program provides the user with the capability to react to fatal returns from
Citilabs’ programs. When a “RUN PGM=program” statement is executed, the
program sets a return code that indicates what type of messages it issued. The return
code is either 0 (No messages), 1 (Warning messages), 2 (Fatal messages), or 3
(program aborted); this value is stored in a variable named RETURNCODE. If
RETURNCODE is greater than 1, the run is automatically terminated. However, if the
user has set the string variable named ONRUNERRORGOTO to point to a legitimate
label statement in the script, the run will continue at the labeled statement if the return
code is 2.
At the labeled statement, the user can further control what is to happen with the run.
Typically, the user will issue a message, and possibly continue the run. To continue,
the user will have to clear the internal RETURNCODE variable, or subsequent tests of
the run status may cause termination. The CLEARERROR statement is used to reset
the internal return code; it can not be cleared by setting RETURNCODE=. The
CLEARERROR statement also provides a keyword to allow the user to resume
executing script at the point following the RUN statement that caused control to be
switched to the label specified by ONRUNERRORGOTO.
• Program statements — Execute a Cube Voyager program. A program statement always begins
with:
RUN PGM=
• — Program initiates an operating-system command. A system statement is
System statements
one in which the first field begins with a *, and is at least two characters long. Typically,
system statements are used only in pure DOS applications; they will function within
Windows applications, but their use is not recommended.
Pilot Program > Using Pilot program > Process > Example
Exam ple
*COPY *.DAT d:
Warning : Do NOT use a system statement to initiate another Cube Voyager application.
With the capabilities of these statements, the user can cause the stack to be processed
in almost any order desired. With the flow control capabilities, stack segments can be
repeated until desired results are achieved. A typical example would be the repeated
application of a series of programs beginning with trip distribution and progressing
through assignment. If the adjusted speeds from the assignment program differ too
much from the speeds that were used in the distribution process, the series should be
repeated. Another example could be the repeated application of a program with a
slightly different set of parameters, or different input files. It is up to the user to control the
flow.
Pilot Program > Using Pilot program > Statement tokens (%...% and @...@)
Exam ple
MAX_LOOP = 20
LOOP loop_cnt=1,20
RUN PGM=program
ID = This is the @loop_cnt@ out of @MAX_LOOP@
ENDRUN
ENDLOOP
In this example, MAXLOOP had to be set because LOOP currently accepts only
constants for it limits. To keep it entirely generic, MAXLOOP could be set into the
environment (SET MAXLOOP=20) prior to launching Cube Voyager; then the sample
could be coded as:
LOOP loop_cnt=1,%MAXLOOP%
RUN PGM=program
ID = This is the @loop_cnt@ out of %MAXLOOP%
ENDRUN
ENDLOOP
The READ statement (see Chapter 3, “General Syntax”) also has capabilities for setting
replacement strings in control statements. READ statements are recognized in all Cube
Voyager applications.
Pilot Program > Control statements
Control statements
This section describes the control statements available in the Cube Voyager Pilot
program.
*command
A statement whose first field begins with a *, and is more than 2 characters long, is
considered as a command for the operating system. Cube Voyager will invoke the
COMSPEC processor to execute the command. The command will return a code that
will be stored in the ReturnCode variable. It is the user’s responsibility to test
ReturnCode, since Cube Voyager does not know the meaning of the return codes. It
should be noted that some system commands return 0, even if they are unsuccessful.
For example: “COPY source dest” will return a 0, even if one of the filenames is
illegitimate.
NOTE: The *command will be executed in a minimized command window. This prevents
disruption of the display, allowing other tasks to be performed more comfortably while
the script is running. If it is required that the command window appear on the display,
use the alternate **command rather than *command; for example, '**pause' rather than
'*pause'. The '**' approach will be appropriate if the command requires some interaction
with the user, or perhaps if it displays some progress which the user always wants to be
able to view.
Pilot Program > Control statements > *command > Example
Example
*DEL ABCD*.TMP
*IF EXIST OLD.NET DEL OLD.NET
Or:
**DEL ABCD*.TMP
**IF EXIST OLD.NET DEL OLD.NET
Pilot Program > Control statements > BREAK
BREAK
BREAK can be used to break out of a LOOP ENDLOOP block. It must be within a LOOP block.
When BREAK is encountered, flow immediately branches to the statement following the
appropriate ENDLOOP statement. The contents of the LOOP variable are not altered.
Pilot Program > Control statements > BREAK > Example
Exam ple
LOOP i=1,3
IF (condition)
statements
ELSE
BREAK ; get out of loop
ENDIF
ENDLOOP
Pilot Program > Control statements > CLEARERROR
CLEARERROR
Keywords include:
• COD E
• R E S U ME
Ke y wo rd D e s c rip tio n
Exam ple
ONRUNERRORGOTO = 'MYERROR'
:STEP1
RUN PGM=MATRIX
ENDRUN
;At this point control will transfer to :MYERROR
:STEP2
RUN PGM=….
ENDRUN
:STEP3
RUN PGM=
ENDRUN
:MYERROR
PRINT LIST='Special Message'
CLEARERROR CODE=0 RESUME=T
; At this point, control will return to :Step2
Pilot Program > Control statements > COMP
COMP
var=expression
ID=expression
Lambda=expression, etc.
COMP statements compute numeric values and store the value into the var on the left
side of the equals sign. Results can be either numeric or character strings (obtained
when literal text '...' or text functions are in the expression). It is not permissible to
change the mode of a variable during an application. A variable must be defined before
it can be used within an expression; it must have appeared as a var= in a statement
prior to the expression. The program is designed with this check, to ensure that an edit
can be made prior to beginning processing. It could be a big waste of time, if, in the
middle of a complicated loop, the program had to abort because it couldn’t find a variable
at that time. However, this causes a problem with using variables returned from a Cube
Voyager program invoked by the RUN PGM= statement. Cube Voyager does not know
the mode of the variable and can not edit it prior to actual application. To avoid this
problem, Cube Voyager automatically assumes any variable that contains a dot (".")
within its name as numeric.
• Varis the variable that is to have a new value computed for it. If the variable matches a
name in the Vars array, the result will be updated after the COMP is completed. If it does
not exist in the Vars array, it is added as a new variable that can be referenced in
subsequent control statements.
• ID is a special case variable that allows the user to compute a new ID. Because of the
potential conflict with the Cube Voyager system ID control statement, ID may not be the
first keyword on a COMP statement. If the result of the expression is not numeric, then the
resulting character string is copied to the system ID area. In any event, ID then becomes a
working variable.
• is a special case variable, and Lambda must also be a variable within the expression.
Lambda
When this form is specified, the program solves the expression for various values of
Lambda between 0 and 1.0 in hopes of determining a Lambda that will result in a value of
0. The logic for searching is as follows:
m
Set a min and max Lambda (0 and 1.0)
m
Divide the difference between min and max into equal intervals.
m
Solve for all the interval points between min and max.
m
Find the interval that surrounds 0; if none do, it is an error. If more than one interval
surrounds 0, the solution is ambiguous, and it is an error.
m
Reset the min and max Lambdas to the interval points that contain 0.
m
If the interval size is not within the accepted tolerance, repeat steps 2-5.
m
When the interval size is within tolerance, perform a straight line interpolation to zero.
Store the results into Lambda.
This is not a perfect solution, but if the expression is appropriate (does not contain
any transverse slopes, and crosses zero one time), a Lambda between 0 and 1 will
be found. The current process works on a bisecting principal for developing the test
ranges and uses an tolerance interval of 0.000001. For obvious reasons, an
expression that contains Lambda as an expression multiplier without any other terms,
will always result in Lambda = 0. A division by Lambda will cause program failure
when Lambda is tested for 0.
The statement need not have COMP, it may begin directly with var=.
Pilot Program > Control statements > COMP > Example
Exam ple
COMP i=matrix.time_to_cbd/100 + sqrt(loop)
i=3, j=6, k=9, ijk=1*100+j*10 + k
Lambda = 1.2 - lambda * ...
COMP ID='This is a new ID for loop' + str(loop_cntr,3,0)
Pilot Program > Control statements > CONVERTMAT
CONVERTMAT
Command for converting matrix files between the Cube native 'TPP' format and the
open matrix format 'OMX'. More information on the open matrix format can be found at
https://github.com/osPlanning/omx
CON V E R T MA T k e y wo rd s
Exam ple
CONVERTMAT FROM="C:\Cubetown\Base\PERSONTRIPS.MAT"
TO="C:\Cubetown\Base\persontrips.omx" FORMAT=OMX COMPRESSION=0
Pilot Program > Control statements > CONTINUE
CONTINUE
Jumps to the end of a loop, bypassing all intermediate statements.
When CONTINUE is processed flow immediately branches to the ENDLOOP statement in a
LOOP ENDLOOP block. It must be within a LOOP block.
Pilot Program > Control statements > CONTINUE > Example
Exam ple
LOOP i=1,3
IF (condition)
statements
ELSE
CONTINUE ; jump to ENDLOOP
ENDIF
ENDLOOP
Pilot Program > Control statements > COPY ... ENDCOPY
Ke y wo rd D e s c rip tio n
Exam ple
COPY FILE=temp1; copy lookup file for HIGHWAY
.
.
ENDCOPY
COPY FILE=temp2 ;copy with imbedded COPY
... will be copied to temp2
COPY FILE=temp3 ; " " " " "
... " " " " "
ENDCOPY " " " " "
ENDCOPY signals that the prior record was last
IF (ReturnCode==255) ...
Pilot Program > Control statements > DOWNLOAD
DOWNLOAD
Keywords include:
• CLE A R FILE O
• FILE O
• URL
Ke y wo rd D e s c rip tio n
CLEARFILEO |?| <1> is a switch to indicate if the local file should be cleared
prior to beginning the download.
If the file is cleared and the download fails for some reason
then the file will not exist on the local machine. If
CLEARFILEO=0 then the local file will be overwritten by a
successful download but if the download fails then the original
local file will remain in its original form.
FILEO |S| Local path and file name for the download.
Example:
'C:\CITIDOWNLOADS\myfile.dat'
EXIT
Terminates the program.
Pilot Program > Control statements > EXIT > Example
Exam ple
IF (expression) EXIT
Pilot Program > Control statements > FILEI
FILEI
Keywords incude:
• V A R I=filename
Specifies an input file for Pilot variable initialization. This statement is executed before
any step is run, no matter where it is specified in the script.
NOTE: See “FILEI” on page 50 for general information about FILEI and for important
limitations when using Application Manager.
FILE I k e y wo rd s
Ke y wo rd D e s c rip tio n
The statement need not contain the FILEI control word; it may begin directly with VARI.
Normally, VARI is not used; it is used only if there are many variables to be initialized.
This could be the case if the application is the continuation of a previous application. A
var output file will always be written at the termination of the application.
Pilot Program > Control statements > FILEI > Example
Exam ple
VARI=XXXX.VAR
Pilot Program > Control statements > FILEO
FILEO
Keywords include:
• P R IN T O[#]=filename
Specifies an output file for the PRINT PRINTO capability when printing from Pilot.
FILE O k e y wo rd
Ke y wo rd D e s c rip tio n
The statement need not contain the FILEO control word; it may begin directly with PRINTO.
Note, all PRINTO index numbers must be unique throughout the script. When adding a
Pilot box in Application Manager and linking a file to the PRINTO file box, you must ensure
that the index numbers used do not overlap with prior PRINTO indices from prior Pilot
steps.
NOTE: When processing the first step, the Pilot program opens all the PRINTO files
specified in any script. Therefore, statements intended to create files in folders that do
not already exist will fail.
Pilot Program > Control statements > FILEO > Example
Exam ple
FILEO PRINTO[1] = "C:\Data\My File.CSV"
IF (L1=1)
PRINT CSV=T LIST='ITER','DIFF','P_DIFF',
PRINTO=1
ELSE
PRINT CSV=T, FORM=L, LIST=L1,CONV.DIFF(8.0L),CONV.P_DIFF(6.2L),
PRINTO=1
ENDIF
IF (ABS(CONV.P_DIFF)<0.05 & L1>1) BREAK
*COPY Trips_by_Mode.mat LAST.MAT/Y
Pilot Program > Control statements > GOTO
GOTO
Jumps immediately to a named statement.
GOTO label
When GOTO is processed, flow immediately branches to the target statement, named
“:label.” Each GOTO statement must have an associated :label statement. Use care when
the :label statement is within a different IF or LOOP block. The target statement must begin
with a semicolon (:).
Pilot Program > Control statements > GOTO > Example 1
Exam ple 1
GOTO hwybuild
GOTO :hwybuild
Pilot Program > Control statements > GOTO > Example 2
Exam ple 2
GOTO hwybuild
:hwybuild
• A block of statements:
IF (expression)
ELSEIF (expression)
ELSE (expression)
ENDIF
You must predefine any expression variables in an earlier COMP VAR statement. (The
program automatically defines any variables not predefined, but with a dot (.) in their
name as numeric variables.)
You may nest but not overlap IF ... ELSEIF ... ELSE ... ENDIF blocks. They may not overlap
LOOP ... ENDLOOP blocks.
• COMP
• CONTINUE
• EXIT
• GOTO
Pilot Program > Control statements > IF ... ELSEIF ... ELSE ... ENDIF > Example
Exam ple
; Single IF examples:
; Typical IF block:
where:
• Var is the required user-specified name of the loop-control variable. The module does not
protect the value of Var during the loop; computation, program, and other LOOP statements
may alter the value of Var.
• Begin is the constant value to which the module initializes Var. You must specify a value.
• End is the constant value that the module compares Var to when processing the ENDLOOP
statement. You must specify a value.
• Incr is the constant the module adds to Var before processing the ENDLOOP statement.
If the result of the comparison is true, the program branches back to the statement
following the LOOP statement. If it is false, control is passed to the statement following
ENDLOOP.
Processing of the ENDLOOP statement depends on the value of Incr:
• If Incr is positive, when the value of Var is less than or equal to End, the module goes to
the statement following LOOP, otherwise the module goes to the statement following
ENDLOOP.
• If Incr is negative, when the value of Var is greater than or equal to End, the module goes
to the statement following LOOP otherwise the module goes to the statement following
ENDLOOP.
The module tests the ENDLOOP condition (without incrementing the variable value) when
initializing the loop-control variable. If the test fails, the module does not perform any
statements within the LOOP block.
Pilot Program > Control statements > LOOP ... ENDLOOP > Example 1
Exam ple 1
Exam ple 2
A nested loop, with the innermost loop executing twice for each value of variable xyz:
10,8,6,4,2.
LOOP xyz=10,1,-2
LOOP abc=1,2
.
.
ENDLOOP
ENDLOOP
Pilot Program > Control statements > NEWPAGE
NEWPAGE
Controls the printed output when the program invokes an external process. Keywords
include:
• a fte rp g m
• a fte rs y s
• b e fo re p g m
• b e fo re s y s
All NEWPAGE variables are Boolean items that require a true or false type of value. Once
a variable is set, it remains in force, until a new value is encountered. The ...sys
variables can help provide cleaner output when a system command is performed. The
page counter will not be adjusted for the system output. The ...sys variables are ignored
if the system command contains a redirection ”>” symbol.
N E W P A GE k e y wo rd s
Ke y wo rd D e s c rip tio n
Example:
NEWPAGE beforepgm=y afterpgm=n beforesys=y aftersys=y
Pilot Program > Control statements > ONRUNERRORGOTO
ONRUNERRORGOTO
ONRUNERRORGOTO is a string variable that can be set to point to a legitimate label
statement in the script. Use this feature to react to fatal returns from Citilabs’ programs.
When a “ RUN PGM=program” statement is executed, the program sets a return code
that indicates what type of message the program returned on closing. The codes
returned are:
Co d e D e s c rip tio n
Exam ple 1
RUN PGM=MATRIX
ENDRUN
At this point the job will terminate because there was an error in the Matrix program (no
operations).
Pilot Program > Control statements > ONRUNERRORGOTO > Example 2
Exam ple 2
ONRUNERRORGOTO = 'MYERROR'
RUN PGM=MATRIX
ENDRUN
;At this point control will transfer to :MYERROR if the MATRIX step fails
RUN PGM=….
ENDRUN
EXIT ; if program gets to this point then exit, no errors were encountered
:MYERROR
PRINT LIST='Special Message'
; Run will terminate from here with a final completion code of 2
Pilot Program > Control statements > ONRUNERRORGOTO > Example 3
Exam ple 3
ONRUNERRORGOTO = 'MYERROR
:STEP1
RUN PGM=MATRIX
ENDRUN
;At this point control will transfer to :MYERROR if the MATRIX step fails
:STEP2
RUN PGM=….
ENDRUN
:STEP3
RUN PGM=
ENDRUN
EXIT ; if program gets to this point then exit, no errors were encountered
; or all errors cleared
:MYERROR
PRINT LIST='Special Message'
CLEARERROR CODE=0
GOTO STEP3
Pilot Program > Control statements > ONRUNERRORGOTO > Example 4
Exam ple 4
ONRUNERRORGOTO = 'MYERROR'
:STEP1
RUN PGM=MATRIX
ENDRUN
;At this point control will transfer to :MYERROR if the MATRIX step fails
:STEP2
RUN PGM=….
ENDRUN
:STEP3
RUN PGM=
ENDRUN
EXIT ; if program gets to this point then exit, no errors were encountered
; or all errors cleared
:MYERROR
PRINT LIST='Special Message'
CLEARERROR CODE=0 RESUME=T
; At this point, control will return to :Step2
Pilot Program > Control statements > PARAMETERS
PARAMETERS
Specifies basic parameter values for the Pilot run. Keywords include:
• MA XS T R IN G
• V A R D E CIMA L
Ke y wo rd D e s c rip tio n
PRINT
Formats and prints a line of information.
The standard Cube Voyager PRINT statement can be used. Please see “PRINT” on
page 69.
Pilot Program > Control statements > PRINT > Example 1
Exam ple 1
LIST= ITER(6) TIMEPERIOD(6) TOTAL1, TOTAL2, TOTAL3 FILE=PRINTFIL.001
PRINT FORM=6.0CDLR LIST= ITER, TIMEPERIOD,TOTAL1,TOTAL2 FILE=PRINTFIL.002
Pilot Program > Control statements > PRINT > Example 2
Exam ple 2
PRINT PRINTO=1 FORM=6.0CDLR LIST=ITER, TIMEPERIOD, TOTAL1, TOTAL2
Pilot Program > Control statements > PROMPT
PROMPT
Keywords include:
• ANSW ER=
• QU E S T ION =
• W A IT =
Poses mid-run questions that can alter the flow of the job. When encountering a PROMPT
statement, the program lists a question (defined by the QUESTION keyword) and the
possible answers (defined by the ANSWER keyword) and waits for a response. The
response must select one of the answers. The program will not continue until a proper
selection is made. The ANSWER number is returned to Pilot in the variable named
ReturnCode, which the user can test via an IF statement.
The use of the keyword PRNFILE on the RUN statement allows the user to redirect the
print file for any job steps. When the PROMPT dialog box opens, the user can peruse the
output from any of the previous step(s) to decide how to respond to the question.
P R OMP T k e y wo rd s
Ke y wo rd D e s c rip tio n
When Pilot is launched a Windows dialog box opens, and the user responds by
selecting a button.
Pilot Program > Control statements > PROMPT > Example
Exam ple
PROMPT QUESTION=’What do you want to do?’,
ANSWER=Continue, ; 1
‘Break out of Loop’, ; 2
ABORT ; 3
IF (ReturnCode==3) abort
IF (ReturnCode==2) break
RUN PGM=MATRIX PRNFILE=myfile.txt
.
.
ENDRUN
PROMPT QUESTION=’Examine myfile.txt to determine response to’,
ANSWER=’Sum Too High’,
‘Sum Too Low’,
‘Sum Acceptable – Get Out of Loop’
IF (RETURNCODE==3) break
Pilot Program > Control statements > REPORT
REPORT
Keywords include:
• S T A CK
• T R A CE
• VARS
R E P OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
REPORT Vars=y
REPORT Trace=y ; turn stack tracing on
REPORT Trace=n ; turn stack tracing off
Pilot Program > Control statements > RUN ... ENDRUN
• MS G
• P A R A ME T E R S
• P GM=name
• P R N FILE =name
• R E D IR E CT IN
• R E D IR E CT OU T
Pilot loads and executes the program specified by PGM . Pilot attaches any control
statements between the RUN and ENDRUN command to the specified program. Only the
specified program will read and edit these statements.
ENDRUN signals the end of the RUN statement. Though optional, Citilabs recommends
always using ENDRUN. A system command (*....) or another RUN statement also signals
the end of a RUN statement.
You can disable a RUN statement by changing it to !RUN. However, a !RUN statement
requires a corresponding ENDRUN. You can also disable a RUN statement by placing the
statement in a null block (/* .... */) or by using a GOTO statement.
Pilot expects to load a Cube Voyager program; the associated DLL and TDF files must
be directly accessible. If you are running a non–Cube Voyager program, you may use
additional keywords. The program name may be a standard OS file name (path is
optional, but is recommended for non-TRIPS programs). The program may be a TRIPS
program, a Cube-related program, a client-developed program to run in accordance with
Citilabs specifications, or a standard OS executable RUN file.
R U N k e y wo rd s
Ke y wo rd D e s c rip tio n
MSG |S| Optional message that can be printed when the program
runs. For readability, Citilabs recommends 100
characters or less.
PRNFILE |F| Optional. File where the program expects to write its
standard system print output. PRNFILE will be ignored if it
is determined that a TRIPS program is being run.
If it is determined that a TRIPS program is being run (by the presence of &FILES OPRN
keyword in the CTLFILE), PRNFILE, REDIRECTIN, and REDIRECTOUT are ignored.
The RUN statement is designed to allow easy integration of non-Cube Voyager
programs directly in line with a standard run and to have the “printed” output of the
program directly incorporated into the standard Cube Voyager print file. There may be
programs whose basic operations will not allow this type of integration. In those
situations, it is possible that the use of the Pilot * statement will allow the direct running of
the command.
The RUN statement for non-Cube Voyager programs generates a system command that
is structured and executed based upon the following decision table.
• If PGM is a TRIPS program (contains &FILES OPRN=):
pgm ctlfile parameters >tprn
NOTE:
2. tprn is a temporary file which is copied to the Cube Voyager print file.
3. DRI/RDO = redirectin/redirectout
Pilot Program > Control statements > RUN ... ENDRUN > Examples
Exam ples
RUN PGM=program parameters=datain, dataout
Command: Path\program.exe datain dataout
SENDMAIL
Immediately sends an e-mail. Keywords include:
• A T T A CH ME N T S
• CC
• FR OM
• ME S S A GE
• P A S S W OR D
• P OR T
• S MT P S E R V E R
• S U B J E CT
• TO
• U S E R N A ME
Use SENDMAIL to transmit the status of a job or job step to a recipient. The keywords
SMTPSERVER, FROM , TO, and SUBJECT must be specified; the others are optional. E-mail
messages can also be sent as text messages to a cell phone.
S E N D MA IL k e y wo rd s
Ke y wo rd D e s c rip tio n
• Sprint:
{phone#}@messaging.sprintpcs.com
• Verizon: {phone#}@vtext.com
Check with his/her cell phone service provider to
verify the appropriate address.
USERNAME |S| User name for mail account, if the mail SMTP
server requires logon.
Pilot Program > Control statements > SENDMAIL > Example
Exam ple
StepName='Step 1 - Network'
RUN PGM=NETWORK
NODEI=DTWNNOD.DBF, LINKI=DTWNLNK.DBF
NETO=DTWNTPP1.NET
ZONES=24
ENDRUN
StepName='Step 2 - Network'
RUN PGM=NETWORK
NODEI=xDTWNNOD.DBF, LINKI=DTWNLNK.DBF
NETO=DTWNTPP1.NET
ENDRUN
SENDMAIL SMTPSERVER='smtp.yourname.com',
FROM='ken@yourname.com',
TO='ken@yourname.com,jill@yourname.com',
CC='The Boss<boss@yourname.com>',
Subject='Email from Voyager, Run Completed, No Error',
Message='Voyager Run Completed',
'There is no run error',
ATTACHMENTS='DTWNTPP1.NET'
Exit ; if no errors then this step gets executed and terminates the run
SENDMAIL SMTPSERVER='smtp.yourname.com',
FROM='ken@yourname.com',
TO='ken@yourname.com',
Subject='Email from Voyager, Run Error',
Message='There is a run error, returncode:',rcode,
'On Step ',StepName
; If the error happens on step 2, ignore the error, resume the run
if (StepName='Step 2 - Network')
CLEARERROR resume=t code=0
endif
Pilot Program > Control statements > SLEEP
SLEEP
Pauses program execution for a specified amount of time. Keywords include:
• T IME =duration
S LE E P k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple
SLEEP TIME = 5
• Example 2: Loop
RUN PGM=NETWORK
. data for NETWORK to build a network
ENDRUN
RUN PGM=HIGHWAY
. data for HIGHWAY to build LOS files
ENDRUN
RUN PGM=DISTRIBUTION
. data for DISTRIBUTION to distribute trip ends
ENDRUN
RUN PGM=MATRIX
. data for MATRIX to combine and factor matrices
ENDRUN
RUN PGM=HIGHWAY
. data for HIGHWAY to load trips to highway network
ENDRUN
RUN PGM=NETWORK
. data for NETWORK to analyze assignment
ENDRUN
Pilot Program > Examples and FAQ > Example 2: Loop
Example 2: Loop
This example is a little more complicated. All the RUN statements would have statements
following them (including an ENDRUN statement). They are excluded, so that process
can be presented more briefly.
LOOP iter=1,5
COMP ID='This is iteration' + str(iter,2,0)
RUN PGM=NETWORK
RUN PGM=HIGHWAY
RUN PGM=DISTTRIBUTION
RUN PGM=MATRIX
RUN PGM=HIGHWAY
RUN PGM=NETWORK
ENDRUN
IF ( NETWORK.RESULT <= 0.02) BREAK ; criteria already satisfied
ENDLOOP
Pilot Program > Examples and FAQ > Example 3: Additional logic
Using Fratar
Fratar distribution is the process of modifying a matrix of values based upon a set of
production and attraction factors for each of the zones in the matrix. The process is a
relatively simple iterative one:
In the first iteration, each row in the matrix is factored according to its production factor.
At the end of the iteration, the row totals will match the target row values, but the column
totals will most likely not match their targets.
In the second iteration each column in the modified matrix is factored according its
attraction factor. At then end of the iteration, the column totals will match the target
column values, but the row totals may not match their targets.
This process continues for some number of iterations; the row and column totals should
converge towards the target totals. When the criteria for convergence is met, the
process is complete.
A complete convergence (target row and column totals obtained for all zones) can be
obtained only if the target grand control totals for rows and columns are the same. The
program makes adjustments to guarantee that the target grand totals do match. It is
possible that the user input values and specifications can preclude obtaining matching
totals. In such cases, the program will fatally terminate.
This section discusses:
• Specifying target values
• Multiple purposes
Fratar > Using Fratar > Specifying target values
Similarly, A[]=, PGF[]=, and AGF[]= expressions are computed for corresponding
arrays. To provide the capability of mixing P and PGF for a purpose, the SETPA
statement may include the basic INCLUDE and EXCLUDE filter specifications. If either,
or both, of these filters are specified on a SETPA statement, they apply to all
expressions on that statement. To specify P and PGF for the same purpose, separate
SETPA statements are used; each would have its own zonal filter set. If the sets
overlap, the latest SETPA values replace any prior values. If the final value for a P or A
is 0, the program revises it to a growth factor of 1.0.
Fratar > Using Fratar > Specifying target values > Example 1
Exam ple 1
SETPA P[1]=ZI.1.HBWP2000, A[1]=ZI.1.HBWA2000 INCLUDE=1-500
SETPA PGF[1]=ZI.2.EXTW/2 AGF[1]=PGF[1] INCLUDE=501-550
In this example, the values for zones 1-500 would be the direct values obtained directly
from the ZI.1.HBWP2000 array, and the values for zones 501-550 would be the growth
factors obtained from the ZI.2.EXTW array (divided by 2).
In most cases the values will be obtained from ZDATI (zonal data) files, or LOOKUP
functions, but that is not an absolute requirement. Standard numerical expressions (J
being the only viable variable that could be included) are used to compute the values.
Sometimes, it is desirable to input specific values.
Fratar > Using Fratar > Specifying target values > Example 2
Exam ple 2
SETPA P[1]=5000 INCLUDE=255 ;input a specific value
SETPA A[1]=sqrt(J/2+25**3.5) ;would be possible, but weird.
A special feature of these expressions is that if the result is less than zero, it is not
stored. After all SETPA P,A,PGF, and AGF expressions are processed, the program
performs a zonal (I) loop, obtaining the matrix values for each purpose. The matrices are
obtained by solving the SETPA MW[]= expressions. Again, the INCLUDE and
EXCLUDE filters are employed, but care must be exercised, if they are specified. The
MW expressions are array notation, but applied for each I zone. Therefore the filters will
apply to both the I and J zones.
Fratar > Using Fratar > Specifying target values > Example 3
Exam ple 3
SETPA MW[1]=... INCLUDE=1-500
; will compute only the I=1-500 to J=1-500 portion of the matrix.
Fratar > Using Fratar > Controlling target totals
Sometimes only certain zones are to be modified, and the remainder of the zones are to
be kept constant. The program keeps track of the zones that are eligible for modification
by noting which zones have target values that differ from the input value by more than
one. If the letter “L” is appended to any of the CONTROL values, it indicates that the
modifications are Limited to only the zones that have change. Use of the this feature
can, in some cases, lead to a situation where a matrix grand total can not be properly
computed. If that is the case, the program will fatally terminate.
It is impossible to modify any cell, column, or row of the input matrix that has zero to
begin with. If a target value is specified for a zone that initially had no total, a warning
message is issued. Traditionally, some modelers would scale a matrix by a value
(usually 10, or 100), and then fill in all empty cells with one. This is not necessarily a
good, or bad, solution. But, because of the potential problems associated with this
approach, zero accountability is not included in this program directly. If the scaling
scheme is to be applied, a prior application of the Matrix program can be used to scale
and fill in a matrix in any desired manner. It could also be achieved by setting the
SETPA MW expression to: max(1,mi.n.n*10).
Fratar > Using Fratar > Convergence — Iteration control
Zo ne 1 2 3 T o ta l
1 57 24 19 100
2 64 106 30 200
As dictated by row factoring, the row totals are correct. But, the column totals do not
quite match the target. Another iteration is performed, and the results appear as:
A fte r Ite ra tio n 2: R MS E = 7.94
Zo ne 1 2 3 T o ta l
1 61 25 16 102
2 69 111 26 206
The column totals are now on target, but the row totals are not quite on target.
This process goes on, back and forth, until either the RMSE drops to the MAXRMSE
level, or the number of iterations reaches the MAXITERS value. In this example, the final
solution is reached after 5 iterations (MAXRMSE=0.01 and MAXITERS=10).
A fte r Ite ra tio n 5: R MS E = 0
Zo ne 1 2 3 T o ta l
1 60 25 16 102
2 70 110 26 206
All values are shown to the nearest integer and thus may not total exactly. Internally, the
values are carried with more precision.
Fratar > Using Fratar > Multiple purposes
Multiple purposes
The number of purposes is determined by the highest P, A, PGF, AGF, or MW index
found on any SETPA control statement. The program assumes that there will be
purposes from one, monotonically, through that highest index. (FRATAR allows up to 20
trip purposes.) The distribution is performed prior to entering the main Matrix program I-
loop. When the main I-loop is processed, MW[1] through MW[highest purpose] are
initialized with the final matrices from the Fratar distribution. After the factoring process is
complete, a standard Matrix program I-loop is performed.
Fratar > Control statements
Control statements
All the standard Matrix statements are valid in Fratar, and a few additional ones are
available. Fratar is a subset of the Matrix program. This section only describes the
differences between the Matrix and Fratar control statements. For descriptions of other
control statements see Chapter 9, “Matrix Program.”
Fratar statements not in Matrix:
• SETPA
• REPORT
• SETPA
Fratar > Control statements > PARAMETERS
PARAMETERS
Sets general parameters. Keywords include:
• MA T OE V E R Y
• MA XIT E R S
• MA XP U R P S
• MA XR MS E
• ZON E S
In addition to the standard Matrix parameters (see “PARAMETERS” on page 638), you
may specify the parameters described here.
P A R A ME T E R S k e y wo rd s
P a ra me te r D e s c rip tio n
REPORT
• A COMP
• P COMP
In addition to the REPORT keywords available for Matrix, the following are also available
for Fratar:
R E P OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
ACOMP=1-3,5 ;request reports for the specified purposes
Fratar > Control statements > SETPA
SETPA
Establishes base productions and attractions. Keywords include:
• A
• A GF
• CON T R OL
• E XCLU D E
• IN CLU D E
• MW
• P
• P GF
The SETPA statement is required; if it is not included, the program will fatally terminate.
These statements define how the production and attraction factors are to be obtained,
and how many purposes are to be processed. There should be a P[]= and A[]= and
MW[]= expression for every purpose beginning with 1 and continuing, monotonically,
until all purposes are defined. (FRATAR allows up to 20 trip purposes.) The highest
index encountered establishes the number of purposes.
If there are any holes in the purpose scheme, the program will issue a warning
statement.
The Ps and As are computed from the expressions that are supplied. In most cases, the
expression will simply point to a ZDATI file variable. Complex expressions are allowed,
but the use of any variables in the expression could cause unpredictable results. In a
purpose where the Ps and As are the same for each zone, it is acceptable to set the Ps,
and then set the As equal to the Ps. The SETPA expressions are computed in the order
in which they appear in the control stream, and they are computed only one time -- prior
to the first iteration. For each array, the expression is solved in a loop of J=1-Zones, and
the results are stored in the A,P,MW [n][J] cells. The keywords may not have a zone
index in the SETPA statement.
If the same purpose is referenced more than one time, the subsequent values will
replace the prior values. Duplication of purposes might be helpful if values for different
zones for a purpose are to be obtained from different sources, or if different
INCLUDE/EXCLUDE filters are to be used (different SETPA statements must be used for
different filters).
S E T P A k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
RUN PGM=FRATAR
MATI=3ZONE.MAT
MATO=3ZONEF.MAT,MO=1
LOOKUP NAME=TOT,LOOKUP[1]=1,RESULT=2,LOOKUP[2]=1,RESULT=3,
R='1 100 240',
'2 200 200',
'3 300 160'
MAXRMSE=0.01 MAXITERS=10
SETPA P[1]=TOT(1,J) A[1]=TOT(2,J) MW[1]=MI.1.1
ACOMP=1,PCOMP=1
MARGINS=1
ENDRUN
Fratar > Examples and FAQ > Frequently asked questions
• Path-based tolls
Highway introduction
The Highway program now supports junction or intersection constrained assignment as
well as the typically link based capacity constrained assignment. Junction-constrained
assignment requires the coding of the junction or intersection movements and controls.
The descriptions below refer to link based traffic assignment. Refer to Chapter 7,
“Intersection Modeling” for a detailed description of intersection modeling and the data
requirements.
The Highway program now can write the full path file from an assignment run including
full results from every iteration. This makes many forms of path based analysis directly
accessible in Cube without having to rerun the assignments with specific commands in
the scripts. See the description of PATHO in “FILEO” on page 221 and “PATHLOAD” on
page 270; also refer to “Highway path display” on page 265 of the Cube Base
Reference Guide for information about path-based analysis in Cube.
The Highway program’s primary function is to assign trips to highway network links. A
highway network, zonal matrices, zonal data, junction data and turn penalties can be
input, and a loaded network, new matrices, turning volumes, final junction delay and
reports can be output. There are basic default operations, but the user can control much
of the process
A typical assignment program builds paths based upon link costs (impedances) and
assigns trips to those paths for each origin zone. After all origin zones have been
processed, link costs are updated based upon the level of congestion on each link.
Then the entire path and assignment process is repeated. This process continues until
some criteria for termination is reached. The volumes from each iteration are combined
to form a weighted assignment. Different criteria are used to determine when enough
iterations have been performed. Almost all of the operations follow a fixed pattern, and
are driven by basic parameters. Various options are usually available to provide the user
with additional outputs. Select link analysis is a major tool for most users. This process
“traps” the trips that meet the select link criteria, and usually writes them to output
matrices.
The Highway program provides the same capabilities as a traditional assignment
program, but functions somewhat differently. There are only a few automatic operations,
and global parameters are used sparingly. The program operates by processing in
various phases. In each phase the program performs certain specific operations, and
optionally processes a stack of operations provided by the user for that phase.
In addition to phase operations, the user can enter FUNCTION statements (in the form of
numerical expressions) that are to be performed in place of default functions at certain
times by the program.
• Using the FU N CT ION control statement, the user may calculate the cost, congested time, or
volume (at the current iteration) of a link. See “FUNCTION” on page 245.
• is also ideal for modeling multiple user class assignments (such as regular vs.
FU N CT ION
HOV traffic). For more information and an example, see “Multiple user class assignment
using generalized cost functions” on page 166.
For normal processing, there must be a way of computing certain required values for
each link. If there is no automatic way for the program to determine these values, the
user must supply the process to obtain them. Normally, the values are computed directly
from the variables in the input network, but since there is no fixed format of the network,
the required variables may not be present. In that case, the LINKREAD phase can be
used and formulated to provide these values. The underlying assumption is that path
building and capacity restraint are based upon a generalized cost on each link. In most
cases, the cost is time. There are several ways to obtain the free flow time (T0), and the
initial path time (T1). The hierarchy of the processes to obtain T0 and T1 is outlined
below, in the description of the LINKREAD phase.
The best advice is that the network should contain a variable that can be used directly
for T0, or that it contains variables so that DISTANCE and SPEED information can be
easily obtained. If the variables DISTANCE, LANES, and SPDCLASS are in the
network, T0 can be computed from the DISTANCE and the values from the SPDTAB
speed table.
If the network is the result of conversion from a TRANPLAN network, it will usually
contain variables named DISTANCE, TIME1, and CAPACITY. DISTANCE and TIME1
are usually in hundredths of miles and hundredths of minutes, respectively. CAPACITY
is normally the total capacity for the link. TIME1 is the starting time for assignment, and is
not necessarily a true T0 (free flow time). If such a network is used directly, the
LINKREAD stack should contain the following statements:
DISTANCE=LI.DISTANCE/100 ; not absolutely necessary
T0 = LI.TIME1/100
C = LI.CAPACITY * CAPFAC ; factor to get on same scale with trips
In reality, it would be better to rename and scale the variables appropriately during the
network conversion process, so that it is not necessary to remember to deal with them in
the Highway program.
TRANPLAN converted networks will be in nearly the correct format, but the user should
also be aware to scale the variables to the correct values. If the network distance is
properly scaled, T0 will be computed from the DISTANCE, SPDCLASS, LANES, and
the SPEED portion of the SPDCAP tables.
The major phases in the process are:
• SET UP — Optionally, initialize basic user arrays and processes
• ADJUST — Examine iteration results, test for convergence and adjust link values for next
iteration
• — Optional phase where user can specify their own convergence rules and
CON V E R GE
stopping criteria
These phases are processed even if the user does not explicitly specify any controls for
them. However, if there is no explicit ILOOP phase, the program will terminate with an
appropriate message. The phases are specified by using PROCESS
PHASE=PhaseName statements; for simplistic purposes, most users simply use the
short form: PHASE=PhaseName without the PROCESS control word. A PHASE is
closed with either an ENDPROCESS or an ENDPHASE statement. These two
statements are interchangeable. A PHASE will also be closed if an new PROCESS
PHASE=PhaseName or PHASE=PhaseName statement is encountered prior to an
ENDPROCESS or ENDPHASE.
For more information about phases, see “Phases” on page 170.
Highway Program > Using the Highway program > Highway program control statement overview
For details about control statements, see “Control statements” on page 199.
Highway Program > Using the Highway program > Functions and built-ins
• Built-in arrays
• Built-in functions
NOTE: Thenames are not case sensitive, but capitalization may make them a bit more
meaningful.
You can also use FUNCTION statements to enter single expressions for computing certain
values. See “FUNCTION” on page 245.
Highway Program > Using the Highway program > Functions and built-ins > Built-in variables
Built-in variables
Only the variables with a * may be stored into by the user; the others are reserved.
Built-in arrays
There are arrays that can be referenced with […] to indicate a specific value from the
array. Most times, the link-oriented arrays need not be referenced with an index; the
default [linkno] is supplied by the program. The names with a * can be stored into, the
others are reserved.
Built-in functions
These built-in functions are described in “COMP” on page 202.
PROCESS PHASE=LINKREAD
IF(CheckName(‘LI.Capacity’)>0)
C = GetValue(‘LI.Capacity’)
ENDPROCESS
In many applications, only a few ILOOP statements will be required. For example, an
assignment would require only the following statements:
Highway Program > Using the Highway program > Functions and built-ins > Built-in functions available in the CONVERGE
phase > Example of most simple assignment
This script will assign the trips from MATI[1] to the paths based upon TIME. It will adjust
link times between iterations based upon the congestion levels. By default, up to 10
iterations of assignment and capacity restraint will be run; it will stop sooner if equilibrium
convergence is reached before 10 iterations.
In the following examples we will work from this same template and to keep reading to a
minimum, we will not include the RUN, NETI, MATI, NETO, and ENDRUN statements.
Thus, our illustration script would look like this:
PHASE = ILOOP
PATH=TIME, VOL[1]=mi.1.1
Examples show:
• Daily assignment
Daily assignment
Now let’s add a few complications: The trip matrix contains daily trips, and we wish to do
a daily assignment. The only thing that we need to do is to get the capacity into the
correct units (we’ll assume that daily capacity is 10 times the hourly capacity). We can
do this in one of several ways, but let’s just do the simplest, by adding a capacity factor.
PARAMETERS CAPFAC=10; factor NETI capacity by 10 to get daily capacity
PHASE = ILOOP
PATH=TIME, VOL[1]=mi.1.1
Highway Program > Using the Highway program > Getting started with assignment > Add select link loading
NOTE: VOL[1], VOL[2], etc must be used with FUNCTION V. V1, V2, etc will generate
incorrect results.
In this case, work matrix 1 (MW[1]) is computed to be only the trips from MATI whose
paths use the selected link. That matrix is then assigned to volume set 2 (VOL[2]).
Because we supplied the V function, capacity restraint will only involve VOL[1].
As a side note, when using SELECTLINK and the TURNS control statement in the same
HIGHWAY program, care must be taken. Please see “TURNS” on page 301 for more
information.
Highway Program > Using the Highway program > Getting started with assignment > Add truck assignment on same paths
Path-based tolls
This section describes how to incorporate path-based tolls. This section discusses:
• Network development
• Path development
Highway Program > Using the Highway program > Path-based tolls > Network development
• Each network link must have three attributes, which designate the link’s role in the toll
system. You specify the attribute names in a FILEI TOLLMATI statement. A link can have a
non-zero value for at most one of these attributes. The attributes store:
m
On-gate number
m
Off-gate number
m
Toll-road indication
• A toll record must specify the toll for every possible on-off combination of toll gates. You
specify toll records in a FILEI TOLLMATI file.
Path development
To include tolls in path development, specify the keyword TOLLMATI= on a
PATHLOAD statement. The first value for TOLLMATI refers to the FILEI TOLLMATI[#].
An optional second value can specify which toll set from the TOLLMATI records to use.
The specification for the TOLLMATI records is as follows:
FILEI TOLLMATI[#]=filename, ENTRYGATE= EXITGATE= TOLLS= NETIENTRY= NETIEXIT=
NETITOLLROAD=
The file may be a DBF, an MDB-element, or a delimited text file. For DBF or MDB files,
you must name ENTRYGATE and EXITGATE to indicate which fields on the record
contain the on- and off-gate numbers, and TOLLS must name the fields containing the
toll values. The first value for TOLLS is toll set 1, the second value is set 2, and so forth.
For delimited text files, the values are field numbers instead of names. There may be up
to ten TOLLMATI record numbers, and up to ten toll sets. If any of these values is not
specified, the default is the relative field on the record (ENTRYGATE is 1, EXITGATE is
2, and TOLL is 3).
NOTE: If arecord exists for a gate-to-gate combination (for the TOLLMATI#), but does
not contain a specific toll (value missing or blank), Cube Voyager assumes a toll value
of zero.
The NETI... keywords indicate the NETI link attributes that contain the values for the
ramp and road links. You can use these keywords on any FILEI TOLLMATI statement.
If you use the keywords on more than one such statement, they must have the same
values. If any are unnamed, the defaults names are: TOLLENTRY, TOLLEXIT,
TOLLROAD.
The program will fatally terminate if:
• A link has a nonzero value on more than one of the required toll attributes.
• A possible on-to-off route does not have a toll specified. Zero is an acceptable value.
At the beginning of each iteration, the program determines the on-off combinations that
are possible for each PATHLOAD statement. It checks if there is a toll for each of those
combinations, and if not, it fatally terminates. It saves those on-off combinations and
uses them during the PATHLOAD statement; therefore, do not revise the PATH=array
within the iteration. With most toll systems, altering the array would probably not cause a
different routing between on-off ramps, but, the on-off travel costs could become
incompatible with the array costs. In some systems, changes in the path array might
cause a different on-off routing, but since the toll routings and costs are fixed for the
iteration, the application does not consider such changes. The PATHLOAD path-
building process does not directly use the toll facility links; instead, the process uses the
predetermined combinations. During path building, the new PATHTOLL keyword value
can be used to skim the toll values for the paths (MW[1]=PATHTOLL). Any I-J path that
traversed one or more combinations of entry and exit gates will have the accumulated
toll along the path placed in the matrix.
For an example of a script using TOLLMATI, see “Example 7: Using TOLLMATI to
incorporate closed system Tolls in the Pathbuilding process” on page 315.
Highway Program > Using the Highway program > Multiple user class assignment using generalized cost functions
HIGHWAY supports assigning volumes between multiple user classes, such as High
Occupancy (HOV) and Low Occupancy (LOV) vehicles.
For example, to run a two-class assignment process with a different cost function for
each user class, the user should use LW variables to define each cost function. These
will be used to build paths in the ILOOP phase. This requires two PATHLOAD
commands: the first one assigns VOL[1] based on PATH = LW.COST_LOV, and the
second one assigns VOL[2] based on PATH = LW.COST_HOV.
In the ADJUST phase the user should calculate the variable COST as the weighted
average of the two costs. This allows HIGHWAY to compute the total cost and
convergence measures based on the variable COST.
If COMBINE=AVE is used, the FUNCTION COST equation can contain LW variables
(see below, Example A: COMBINE = AVE). If COMBINE=EQUI is used, the
FUNCTION COST equation cannot contain LW variables that are function of volume
changes (such as TIME). In this case, LW variables must be replaced with their formula
inside the FUNCTION COST equation (see COST, and Example B: COMBINE =
EQUI).
In the following examples, observe that:
• When total volume after an iteration is computed using FUNCTION V, VOL[1] and VOL[2]
represent the volume sets, and not V1 and V2.
• When COMBINE=EQUI is used, the LW.COST_HOV (and LOV) work variables should not
be used in FUNCTION COST. If FUNCTION COST contains the work variables, the
equilibrium process uses the incorrect TIME values referred in the previous ("not current")
iteration because the work variables are updated following the equilibrium process in the
ADJUST phase.
Highway Program > Using the Highway program > Multiple user class assignment using generalized cost functions >
Example A: COMBINE = AVE
PROCESS PHASE=LINKREAD
T0 = (LI.DISTANCE/LI.SPEED)*60
C = LI.CAP
LINKCLASS = LI.FUNC_CLASS
IF (LI.FUNC_CLASS == 1,1.5) LINKCLASS=1 ; Freeways, tollways & HOV
IF (LI.FUNC_CLASS == 2-3) LINKCLASS=2 ; Ramps & expressways
IF (LI.FUNC_CLASS == 4-5) LINKCLASS=3 ; Arterial streets
IF (LI.FUNC_CLASS == 6) LINKCLASS=4 ; Local / collector
IF (LI.FUNC_CLASS == 9-10) LINKCLASS=10 ; Connectors /dummy
IF (LI.NAME='HOV') ADDTOGROUP=1
IF (LI.NAME='RAILACCESS') ADDTOGROUP=9
IF (ITERATION=0)
LW.COST_LOV = T0 + DIST_COST_LOV * LI.DISTANCE
LW.COST_HOV = T0 + DIST_COST_HOV * LI.DISTANCE
ENDIF
ENDPROCESS
PROCESS PHASE=ILOOP
PATHLOAD PATH = LW.COST_LOV VOL[1]=MI.1.1 EXCLUDEGROUP=1,9
PATHLOAD PATH = LW.COST_HOV VOL[2]=MI.1.2 EXCLUDEGROUP=9
ENDPROCESS
PROCESS PHASE=ADJUST
FUNCTION {
V=VOL[1]+VOL[2]
TC[1] = T0 *(1+0.18*(V/C)^8.5) ; Freeways, tollways & HOV
TC[2] = T0 *(1+1.00*(V/C)^5.0) ; Ramps & expressways
TC[3] = T0 *(1+0.70*(V/C)^5.0) ; Arterial streets
TC[4] = T0 *(1+1.40*(V/C)^5.0) ; Local / collector
TC[10]= T0 ; No congestion degradation on centroid connectors
}
LW.COST_LOV = TIME + DIST_COST_LOV * LI.DISTANCE
LW.COST_HOV = TIME + DIST_COST_HOV * LI.DISTANCE
ENDPROCESS
;PROCESS PHASE=CONVERGE
;ENDPROCESS
ENDRUN
Highway Program > Using the Highway program > Multiple user class assignment using generalized cost functions >
Example B: COMBINE = EQUI
PROCESS PHASE=LINKREAD
T0 = (LI.DISTANCE/LI.SPEED)*60
C = LI.CAP
LINKCLASS = LI.FUNC_CLASS
IF (LI.FUNC_CLASS == 1,1.5) LINKCLASS=1 ; Freeways, tollways & HOV
IF (LI.FUNC_CLASS == 2-3) LINKCLASS=2 ; Ramps & expressways
IF (LI.FUNC_CLASS == 4-5) LINKCLASS=3 ; Arterial streets
IF (LI.FUNC_CLASS == 6) LINKCLASS=4 ; Local / collector
IF (LI.FUNC_CLASS == 9-10) LINKCLASS=10 ; Connectors /dummy
IF (LI.NAME='HOV') ADDTOGROUP=1
IF (LI.NAME='RAILACCESS') ADDTOGROUP=9
IF (ITERATION=0)
LW.COST_LOV = T0 + DIST_COST_LOV * LI.DISTANCE
LW.COST_HOV = T0 + DIST_COST_HOV * LI.DISTANCE
ENDIF
ENDPROCESS
PROCESS PHASE=ILOOP
PATHLOAD PATH = LW.COST_LOV VOL[1]=MI.1.1 EXCLUDEGROUP=1,9
PATHLOAD PATH = LW.COST_HOV VOL[2]=MI.1.2 EXCLUDEGROUP=9
ENDPROCESS
PROCESS PHASE=ADJUST
FUNCTION {
V=VOL[1]+VOL[2]
TC[1] = T0 *(1+0.18*(V/C)^8.5) ; Freeways, tollways & HOV
TC[2] = T0 *(1+1.00*(V/C)^5.0) ; Ramps & expressways
TC[3] = T0 *(1+0.70*(V/C)^5.0) ; Arterial streets
TC[4] = T0 *(1+1.40*(V/C)^5.0) ; Local / collector
TC[10]= T0 ; No congestion degradation on centroid connectors
}
LW.COST_LOV = TIME + DIST_COST_LOV * LI.DISTANCE
LW.COST_HOV = TIME + DIST_COST_HOV * LI.DISTANCE
ENDRUN
Highway Program > Phases
Phases
You code Highway-program control statements within different phases. The Highway
program processes the phases in a specific order.
This section provides more details about the different phases in the
Highway program:
• SETUP phase
• LINKREAD phase
• ILOOP phase
• ADJUST phase
• CONVERGE phase
Highway Program > Phases > SETUP phase
SETUP phase
After reading all control statements, the Highway program processes the SETUP
phase’s control statements—that is, its stack. The SETUP phase can only contain COMP
and SET statements. The SETUP phase does not have a header: it precedes the first
actual PHASE= statement. Use the SETUP phase to initialize certain variables and/or
arrays.
Highway Program > Phases > LINKREAD phase
LINKREAD phase
An initial LINKREAD phase follows the SETUP phase. This phase obtains the required
initial values from the input network and computes link values that you can reference in
other phases. The program executes the LINKREAD phase implicitly during the
equilibrium/volume-combination process and during the ADJUST phase to obtain
required link values from the input network.
You reference values obtained directly from the network with the network variable name
prefixed by “LI.” Link variables not obtained directly from the network are called link-work
variables. To reference link-work variables, you must give link-work variables names
that begin with “LW.” For example, the statement: LW.TOLLTIME = LI.TOLLTIME / 100
generates a value available for every link at any phase in the program. On the other
hand, the statement: TOLLTIME = LI.TOLLTIME / 100 generates a temporary variable that
has no meaning beyond the current link. The program stores link-work variables as link-
work arrays (see “Built-in arrays” on page 149).
NOTE: Please see “Using Cluster with HIGHWAY” on page 1164 for guidelines on using
link-work arrays in a distributed system.
During the LINKREAD phase, the program processes an internal loop from the first link
through the last link, using the LINKNO variable (that is, LINKNO=1, NUMLINKS). For
each value of LINKNO, the program obtains a link data record from the input network
(NETI), and processes any control statements (the LINKREAD stack).
In the LINKREAD stack, you might use:
• COMP statements to alter, or set, link values.
NOTE: The program processes the entire LINKREAD stack for each link whenever
reading a network link’s data record. To ensure consistency, the program also
processes the LINKREAD stack for each link when reading and processing the link in
the ADJUST (capacity restraint) phase. Therefore, you must not reference DISTANCE,
LINKCLASS, C, T0, T1, TIME, COST, and DIST in the LINKREAD stack; doing so
could alter the internal arrays used and dynamically altered by the capacity-restraint
process.
If you do not need any special LINKREAD operations, you need not specify any stack
statements in this phase.
After processing the LINKREAD stack, the program ensures that certain link variables
(T0, T1, and C) have values and sets the link’s TIME, COST, and DIST values. There
are several methods for setting these variables (see “Setting TIME, COST, and DIST
values” on page 173).
NOTE: The
program does not set the TIME, COST and DIST values after processing the
LINKREAD stack for each link during the capacity-restraint process (that is, during the
ADJUST phase).
You can use the LINKREAD phase to specify GROUP codes for links. You might use
GROUP codes for various reasons. For example, you can disable links with certain
GROUP code values during path building to preclude using those links in the path. (See
“PATHLOAD” on page 270 for more details.) For example, you might build low-
occupancy vehicle paths by precluding the use of HOV links. Other applications can
also take advantage of this capability.
GROUP codes can be very useful in select-link processing. You can easily identify
paths that use links with certain GROUP codes, and use these paths for extracting
matrices. You can even identify the paths that have a certain level, or combination of
levels, of GROUP-coded links. See “SETGROUP” on page 298 for details.
Highway Program > Phases > LINKREAD phase > Setting TIME, COST, and DIST values
• COST (a link-work variable, without the required “LW.” Prefix, of cost values):
m
Compute from the COST function for the LINKCLASS. Do not reference COST in
LINKREAD stack.
• DIST (a link-work variable, without the required “LW.” prefix, of DISTANCE values):
m
Set equal to DISTANCE. Do not reference DIST in LINKREAD stack.
NOTE: Though the program examines DISTANCE and SPEED, you need not specify
them. Usually, the program computes T0 by dividing DISTANCE by SPEED. Therefore,
the program will try to obtain DISTANCE and SPEED values. If you do not set these
values in control statements, the program will try to set them, and then compute T0. On
the other hand, if you set T0 directly, the program does not use the values of
DISTANCE and SPEED.
Highway Program > Phases > ILOOP phase
ILOOP phase
The ILOOP phase performs a zonal loop (I = 1, Zones). This phase is the first phase of
the iteration loop (ITERATION=1, LASTITERATION). Almost all control statements are
valid during the ILOOP phase (that is, in the ILOOP stack). The Highway program
requires a PHASE=ILOOP statement, and the ILOOP stack must have at least one
PATHLOAD statement. The program executes the ILOOP stack one time for each value of
I.
The ILOOP stack can contain nearly any of the functions of the Matrix program. The
ILOOP phase performs MW[#] statements for all Js (J=1, Zones), unless the statement
occurs within a JLOOP block, or the statement specifies both indices (MW[m][j]).
Please see “Using Cluster with HIGHWAY” on page 1164 for guidelines on using link-
work arrays in the ILOOP phase.
For assignment, you must include a PATHLOAD statement. This statement specifies a set
of values that the program assigns to the links in a specified path set. The following
examples illustrate the PATHLOAD statement:
• Volume sets
• Select-link processing
Volume sets
A volume set is an array that accumulates assignments for each link. There may be up
to 1000 volume sets. Though the highest set number is 1000, set numbering need not
be monotonic. The program refers to volume sets as VOL[#], and clears each at the
beginning of each iteration. You can enter values into volume sets with PATHLOAD VOL[#]
= expressions. A VOL[#] expression implies an internal loop of J=1, ZONES. In example
1, VOL[1]=MI.1.6 instructs the program to assign the values from the expression “MI.1.6”
to each link in the paths from the origin zone (I) to each of the destination zones (J). As
J loops, the value (normally trips) for I to J from MI.1.6 will be assigned to links along the
path from I to J.
Highway Program > Phases > ILOOP phase > Volume sets > Example 1
Exam ple 1
PATHLOAD VOL[1]=MI.1.6, PATH=TIME
Builds paths based on TIME value. For each link in those paths, adds values to the first
volume set (VOL[1]) from matrix 6 in the MATI[1] file.
Highway Program > Phases > ILOOP phase > Volume sets > Example 2
Exam ple 2
PATHLOAD PATH=LI.DISTANCE, VOL[3]=I*10+J
Builds paths based on the value of DISTANCE read from the network. For each link in
those paths, adds values to the third volume set (VOL[3]) computed from the “I*10+J”
expression. (The program assigns a value for each J in: J=1, ZONES.)
Highway Program > Phases > ILOOP phase > Volume sets > Example 3
Exam ple 3
PATHLOAD VOL[4]=MW[5]+MW[6]+MI.2.8, PATH=LW.TOLLTIME
Builds paths based on the link-work variable, TOLLTIME. For each link in those paths,
adds values to the fourth volume set (VOL[4]) computed from the “MW[5] + MW[6] +
MI.2.8” expression.
Highway Program > Phases > ILOOP phase > Stratifying vehicle distance traveled by average trip speed
Select-link processing
Use the PATHLOAD statement to initiate select-link processing. The PATH keyword
specifies the link values that the program uses to develop the paths. Specify an M W []
expression followed by SELECTLINK , SELECTGROUP , or SELECTLINKGROUP to solve the
MW expression only for those destination zones (J) where the specified SELECT…
expressions result in a true condition. Subsequent VOL[] statements can assign any of
the select-link matrices to a link’s volume set. Select link functionality is currently not
implemented with path based assignment (COM BINE=PATH ) and will not work.
Highway Program > Phases > ILOOP phase > Select-link processing > Example (simple code – inefficient)
Solving complicated selections is time consuming. The IF process will run faster if the
zonal ranges are not too complicated.
Highway Program > Phases > ILOOP phase > Select-link processing > Example (most efficient)
• Use IF statements to find the desired I, and use IN CLU D E J and E XCLU D E J keywords to select
the desired J values.
• Use S E LE CT LIN K, specifying A=range of desired I values and B=range of desired J values.
Highway Program > Phases > ILOOP phase > Subarea trip extraction
After building paths for the current I-zone, the program computes the SUBAREAMAT
expression for each J-zone on the path from I to J. If the I-to-J path uses any links in the
subarea network, the program records the computed value for the path’s J in the
subarea matrix. This process can extract several types of records:
P o te ntia l e xtra c te d re c o rd s
R e c o rd ty p e D e s c rip tio n
When a path enters the subarea by crossing a cordon link, the A-node of the cordon link
becomes the origin zone of the extracted record. Similarly, the B-node of the cordon link
used to exit the subarea becomes the destination zone. If the path terminates at an
internal zone, the internal zone becomes the destination zone.
When a path exits the subarea, the internal zone where the path began, or the A node
of the cordon link that was used to enter the subarea, becomes the origin zone of the
extracted record, and the B node of the exit cordon link becomes the destination zone.
If a path begins and ends inside the subarea, but never crosses the cordon line, a single
I-I record is extracted. The A node of the origin zone becomes the origin, and the
destination zone becomes the destination. The intrazonal value for an internal zone will
be extracted even though there is no path.
Multiple records can be extracted for a path. (For example, a path begins outside,
enters, exits, enters, and either exits again, or terminates an internal zone.) The final
matrices are combined values from all iterations of assignment, but if requested during a
non-assignment application, only 1 iteration is processed.
The subarea network is obtained from Cube Base, using the polygon subarea network
extraction process.
Highway Program > Phases > ILOOP phase > Subarea trip extraction > Example (subarea trip extraction)
ADJUST phase
You may skip ahead to:
• Example illustrating Lambda and Factor
• Combination processes
• Convergence tests
Part of the iteration loop, the ADJUST phase automatically follows the ILOOP phase.
This phase computes the congested time (Tc) on each link and revises the link’s TIME
values, which the next iteration uses.
If you want to complete special processing on each link following the normal adjustment
process, include the Phase=ADJUST control statement followed by the stack of control
statements you want to complete. Most commonly, you might include ADJUST
statements to list how the normal adjustment process affects each link and to adjust LW
values. LW values based on values revised by the ADJUST process (such as TIME
and COST) should be recalculated. For example, if you have a set of LW.TOLLTIME
values, those values must be updated to reflect changes made in TIME. You must make
the changes to LW.TOLLTIME because the program does not know your intention and
cannot adjust the values automatically. Though allowed, Citilabs recommends that you
do not alter TIME values with ADJUST statements.
After processing user-specified ADJUST statements, the program recalculates the
COST values using the Cost Function. See FUNCTION COST for more on using cost
functions.
The ADJUST phase runs an automatic link loop across all links on the input network.
The link loop executes the ADJUST phase stack once per link. To accumulate
summary values during the link loop, you must properly initialize the values at the
beginning of the link loop. In initializing statements, you might test the value of LINKNO : IF
(LINKNO=1)... (You can also test for ITERATION and LASTITERATION .)
Congestion is based on the variable V, computed for each link. By default, V is the sum
of all VOL[] values that appear on any PATHLOAD statement. Use a FUNCTION V statement
to override the default computation of V.
When using SELECTLINK analysis:
• Do not use the default computation for V if you configure a standard assignment along with
a select-link assignment; this configuration duplicates some volumes. Use a FUNCTION V
statement to override the default computation of V.
• With SELECTLINK analysis, only the turn volume sets corresponding to the original volume
indices should be summed. This avoids double counting in the TURNS request.
NOTE: See “Functions and built-ins” on page 147 for a description of the built-in
functions, variables, and arrays the program uses.)
Most often, you configure multiple iterations, and the program computes the final
volumes by combining the volumes from each iteration. Though you can specify the
maximum number of iterations, Citilabs recommends that you let the program determine
when more iterations will not result in any assignment improvements.
The program can use various methods to combine iteration volumes. Use PARAMETERS
COM BINE to specify the method used. For a list of these methods, see “Combination
processes” on page 185.
Equilibrium assignment is performed within the ADJUST phase. If the term assignment
is used to indicate the actual accumulation of trips on link volumes, the term “equilibrium
assignment” is somewhat of a misnomer. Most users tend to think of equilibrium
assignment as the process of determining a weight factor for an iteration, and then
applying that factor to the current iteration volumes and a complementary factor to the
previously weighted volumes to obtain new weighted volumes. If the network is “well
behaved,” and the appropriate processes are included, eventually a state of equilibrium
is reached. That state is reached when further adjustments in the link costs used for
routing, will not produce significant differences in the system as a whole. In theory,
equilibrium is reached when there is no ability for individual I-J path costs to improve,
without causing degradation in other parts of the network. If a system has a significant
degree of congestion, it may be difficult (practically impossible) to reach a true state of
equilibrium.
The basic measure of equilibrium is total system user cost, and in most situations, cost
involves some measure of time. Time is generally the measurable quantity that can be
directly related to congestion. Thus, most equilibrium formulations are based upon time.
To determine the weight to apply to each iteration’s volume in the volume combining
process, a factor λ (generally referred to as Lambda) is estimated for the iteration.
Lambda is a factor >=0 and < 1. Starting from Cube 6.4 version, LAMBDA has been
allowed to take zero values. This is controlled by the PARAMETER ALLOWLAMBDA0.
By default ALLOWLAMBDA0 is set to true. Once LAMBDA reaches zero, the
assignment process stops since there will be no more convergence of the results. It is
impossible to solve directly for Lambda, so it is estimated using a linear approximation
method.
The user can select one of two Lambda search processes using the PARAMETERS
COM BINE LAM BDASEARCH = AREA, or EQUATION. Note that both processes estimate
Lambda so the results might be slightly different. In most cases, the results will be quite
similar, but the EQUATION method can save considerable computation and I/O time.
• If the AREA search process is used, the program minimizes the area under all the V vs.
Cost curves computed for incremental estimates of lambda for every link. This process
provides a Lambda calculation that is up to 6 digits in precision.
If a standard function for computing TC is used, the estimation process could be
considerably more efficient.
• If the EQUATION search process is used, the program solves the expression for only a
limited number of Lambdas, using the following expression if the default BPR form is used
for the TC functions or no TC functions are coded (default TC function is BPR form with
default BPR constant and exponent):
Y(λ) = Σ (VOLk – V k-1) * T0(1 + TCCOEFF * ((V k-1 + λ * (VOLk - V k-1))/C) ^ TCEXP)
where:
If the user has specified his own alternate form for the TC functions using the
PARAMETERS TCCOEFF and TCEXP and requests the EQUATION search process,
then the program uses the following expression to solve for Lambda:
Y(λ) = Σ (VOLk – V k-1) * TC(V’,TCCOEFF,TCEXP)
Where TC(V’,TCCOEFF,TCEXP) is the TC functions evaluated for link volumes V’,
and the appropriate values of TCCOEFF and TCEXP, where V’= V k-1 + λ * (VOLk -
V k-1).
The resulting curve is examined, and the Lambda which provides Y=0 is obtained by
interpolation. This value is then used to weight the current volumes: V k = λ * VOLk +
(1- λ)*V k-1.
NOTE: EQUATION is available only with the single user class assignment, and when
using the default FUNCTION COST=TIME. On the other hand, with a generalized cost
function, o nly the AREA process should be used. This is depicted in Example 8:
Multiple User Class Assignment with Cost based on User Class. EQUATION and
AREA will generate substantially different results when used with a generalized cost
function.
Highway Program > Phases > ADJUST phase > Example illustrating Lambda and Factor
Iter Vcost VDist VTime AAD RAAD PDiff RMSE Gap RelGap Lambda Factor
E+03 E+03 E+03
---- ----- ----- ---- --- ---- ----- ---- --- ----- ------ -----
Combining these,
V 2 = λ2 * VOL2 + (1- λ2) * (λ1 * VOL1 + (1- λ1) * V 0)
Or,
V 2 = factor0 * V 0 + factor1 * VOL1 + factor2 * VOL2
Where
factor0 = (1- λ1) * (1- λ2)
factor2 = λ2
Ite ra tio n La mb d a (λ ) Fa c to r
0 1 0.43207
1 0.32084 0.20411
2 0.36381 0.36381
Highway Program > Phases > ADJUST phase > Combination processes
Combination processes
There are several iteration volume combination processes available; the PARAMETERS
COM BINE = specifies the one to use. EQUI is the default. The available processes are:
• EQUI
• AVE
• WTD
• ITE
• SUM
• PATH
n EQUI
Standard equilibrium processing: compute a Lambda (λ) for each iteration to be applied
to obtain the factor to combine the current volume (V) with the previous combined
volume (CVOL):
V = V * λ + CVOL * (1-λ)
This method is an implementation of the Frank-W o lfe algo rithm ("An algorithm for quadratic
programming", Naval Research Logistics Quarterly, 3 (1956), pp. 95-110).
NOTE: Highway
will use TIME as the cost for the computation of Lambda, unless
FUNCTION COST is calculated in the Highway model.
With this method, there are several options that can be specified by the subkeyword
LAM BDASEARCH (see“LAMBDASEARCH” on page 259). When intersection modeling is
being undertaken (triggered by the presence of a FILEI JUNCTIONI statement),
standard Lambda estimation processes are used for the link volume evaluations, but
there is no equivalent process for including turning volumes. Intersection delays are not
directly dependent upon the volumes on them; they are influenced by the total
intersection traffic. But, the delays might have an important impact upon the assignment
convergence. The vehicle delay costs for the turn movement can be included with the
link costs by providing a value for the EQUITURNCOSTFAC keyword. If specified,
Lambda estimation includes the turning delays multiplied by this value.
HIGHWAY supports additional assignment algorithms for COM BINE=EQUI mode. To
access these, include the ENHANCE keyword immediately after the COM BINE=EQUI
statement. Please see “ENHANCE” on page 259.
When using COM BINE=EQUI, please note that:
• For distributed cluster node systems, please see “Using Cluster with HIGHWAY” on
page 1164.
• Any LW.xxxx equation containing variables which are a function of Volume changes (such
as TIME) c a nno t be used with FU N CT ION COS T and FU N CT ION T C when COMB IN E =EQUI. Such
arrays are updated following the equilibrium processes in the ADJUST phase, and will
generate incorrect results if directly referenced.
For an implementation example, Citilabs stro ngly recommends reviewing “Multiple
user class assignment using generalized cost functions” on page 166.
n AVE
Averages all the iteration loadings — the program simply keeps a running average of the
volumes on each link.
n WT D
Weighted average. MAXITERS will be set according to the number of weights specified
in W EIGHTS. This is similar to AVE (above), but the required weights are used to favor
specific iterations.
n IT E
Iterative assignment keeps only last iteration volumes as output; prior iteration volumes
are not considered. Only the last iteration volumes are used for output to NETO.
n SUM
All the Iteration volumes are summed to form the final volume. This process can be used
to perform traditional incremental loading. When SUM is specified, it must be followed by
the FRACTIONS subkeyword. The V at the end of each iteration is the accumulated V for
all the iterations to that point. Thus, the V/C ratio used in adjustment is based upon a
partial assignment; it is true only on the last iteration. If it is desired to use a “projected
full” V/C, then C must be computed differently depending upon which iteration it is. This
can be accomplished in the LINKREAD phase, by use of IF (ITERATION=...) processes
or by using an array of C scales.
n PAT H
HIGHWAY includes support for path-based assignm ent using a gradient projection
algorithm. In contrast to the Frank-Wolfe method (which finds solutions that are vertices
of the feasible region), gradient projection makes successive moves in the direction of
negative gradient.
The keywords VARIABLEDEMAND and ALLJ can be included immediately after the
COM BINE=PATH statement, which gives additional flexibilities to handle complex
scenarios. For more information, see “VARIABLEDEMAND” on page 260.
With path based assignment, select link functionality is not implemented and will not
work.
Convergence tests
If the optional CONVERGE phase has not been specified then default convergence
testing is performed at the end of the ADJUST phase to determine if more iterations are
necessary.
Convergence testing is not performed for Combine=Sum assignment. There are several
tests that can be made to determine if more iterations are necessary. The items that are
used in the tests are Keywords set with the PARAMETERS statement and include:
Ke y wo rd s D e s c rip tio n
RGAPk (SUML(VEk-1*COSTEk-1) -
SUML(VAk *COSTEk-1))/
SUML(VEk‑1*COSTEk-1)
Where VAk is the link volume from an all or
nothing assignment to the minimum cost paths
based on COSTEk-1.
NOTE: Unless FUNCTION COST is calculated in the Highway model, Highway will
use TIME as the cost for the calculation of convergence, and for the computation
of Lambda for the Frank-Wolfe algorithm (COMBINE EQUI).
m
If this is an Equilibrium pass, compute link contribution (Y) to Lambda estimations.
m
Else if Iteration > 1, combine V with prior combined Vs
m
Process LinkAdjust stack (if present), and recompute Cost.
m
End Major Link Loop.
• Test for Convergence if CONVERGE phase not specified (true if any of following
conditions met – minimum values are those set with the PARAMETERS statement):
CONVERGE phase
This phase, if specified, follows the ADJUST phase in each iteration. At the end of the
ADJUST phase, the program checks if additional iterations are necessary.
Convergence testing is not performed for Combine=Sum assignment or for Iteration=1.
There are several tests that can be made to determine if more iterations are necessary.
The default items that are used in the convergence tests are:
GAPk ABS(SUML(VEk*COSTEk) –
SUML(Vk-1*COSTEk-1))/ SUML(Vk-
1*COSTEk-1)
Where k is the current iteration and
SUML denotes summation over the
links and, if appropriate, the turning
movements in the network, VEk is the
equilibrium weighted volumes for
iteration k and COSTEk is the cost
based on the equilibrium volumes
VEk.
RGAPk (SUML(VEk-1*COSTEk-1) -
SUML(VAk*COSTEk-1))/ SUML(VEk-
1*COSTEk-1)
Where VAk is the link volume from an
all or nothing assignment to the
minimum cost paths based on
COSTEk-1.
Exam ple
PHASE=CONVERGE
IF (ITERATION < 6) BREAK; Do not even test for Iterations 2-5
IF (GAP < GAPCUTOFF)
BALANCE = 1
BREAK
ENDIF
IF (GAPCHANGEAVE(3) < 0.006 && GAPCHANGEMAX(3) < 0.009 &&
ABS(GAPCHANGEMIN) < 0.009) BALANCE = 1
ENDPHASE
Highway Program > Phases > CONVERGE phase > Example
Exam ple
; This example implements the opposite of the default stopping criteria which is to
stop if ANY of the convergence measures go below the values specified on the
PARAMETERS statement. In this example the assignment would stop only when ALL
criteria fall below their specified values.
PHASE=CONVERGE
IF (GAP<GAPCUTOFF & RGAP<RGAPCUTOFF & AAD<AADCUTOFF &
RAAD<RAADCUTOFF & RMSE<RMSECUTOFF & PDIFF<PDIFFCUTOFF)
BALANCE = 1
ENDIF
ENDPHASE
Highway Program > Control statements
Control statements
The following control statements are available in the Highway program.
Co ntro l
s ta te me nt D e s c rip tio n
ABORT
Aborts the entire run.
Keywords include:
• MS G
Use ABORT to terminate the program and return a fatal code to Cube Voyager. It normally
is not used, but allows for termination due to some conditions that can be detected in the
process. For example: if it is discovered that an LOS matrix is empty when it should
have data, the run should be aborted.
A B OR T k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple
IF (MW[1][I] != 0) ABORT ;Intrazonal present in MW[1]
Highway Program > Control statements > ARRAY
ARRAY
Declares user single-dimension arrays. Keywords include:
• V A R =size
Use ARRAY to allocate user arrays that are to be used in the process. An array is
different than a variable in that it represents vectored data. Values stored to arrays must
be numeric. String values cannot currently be stored in an array. When an array is
referenced, it should include an index [], and if the index exceeds the size, the program
may fatally terminate. Arrays can be useful for different processes. ARRAY statements
are not dynamic (stack oriented); they are allocated prior to any stack operations. When
an array variable appears in a SET statement, all the cells in the array are set to the
same value.
A R R A Y k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple
ARRAY sum_toll=20
sum_toll[NI.CLASS] = sum_toll[NI.CLASS] + VOLTOT
ARRAY VMT=LINKS
Highway Program > Control statements > BREAK
BREAK
Breaks out of a loop.
Upon encountering BREAK, the script immediately passes control to the statement after
the associated loop.
If BREAK is within a LOOP ... ENDLOOP or JLOOP ... ENDJLOOP block, control passes to the
statement following the associated ENDLOOP (loop variable remains intact) or ENDJLOOP
(J is reset to 1).
If BREAK is not within a LOOP or JLOOP block, the script terminates processing for the I
zone but does not bypass output and zonal reporting statistics.
Highway Program > Control statements > BREAK > Example
Exam ple
LOOP L1=1,3
IF (condition)
statements
ELSE
BREAK ; jump to IF statement
ENDIF
ENDLOOP
IF (condition) BREAK ; no more processing for this origin zone
Highway Program > Control statements > COMP
COMP
Computes a variable, matrix, or matrix element from an expression.
Keywords and sub-keywords include:
• MW
m EXCLUDE
m INCLUDE
• VAR
Usage:
VAR=expression
MW[n]=expression, INCLUDE=list of J zones, EXCLUDE=list of J zones
Use the COMP statement to compute variable and work matrix values.
COMP k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
If a COMP statement includes any INCLUDE or EXCLUDE filters, the filters apply to all MW[]=
values, and special matrix functions on the statement, no matter where they appear on
the statement. EXCLUDE is processed after INCLUDE. INCLUDE and EXCLUDE may not be
specified within a JLOOP.
Highway Program > Control statements > COMP > Special matrix variables
Exam ple 1
MW[mw][I] = LOWEST(mw,4,0.01,5,I)/max(1,LOWCNT)/2
Highway Program > Control statements > COMP > Example 2
Exam ple 2
MW[2]=J
MW[K]=MW[2] * MW[5]) / SQRT(A*MW[3][MW[22]])
A=1, B=2, MW[A]=A+B INCLUDE=1-5,8,47-93
MW[3]=5*A, MW[4]=MW[3]*2, MW[K][I%10+1]=ODD,
INCLUDE=1-100,401-500, EXCLUDE=90,93,452
; applies to the MW[]s=
ABC=LOOKUP(DEF)*3
/* move input matrices to work areas */
MW[11]=MI.1.1, MW[12]=MI.1.2, MW[13]=MI.1.3
MW[21]=MI.2.1, MW[22]=MI.2.2, MW[23]=MI.1.3
Highway Program > Control statements > CONTINUE
CONTINUE
Jumps to the end of a loop, bypassing all intermediate statements.
If CONTINUE is within a LOOP ... ENDLOOP or JLOOP ... ENDJLOOP block, control passes to the
appropriate ENDLOOP or ENDJLOOP statement. Otherwise, processing for the I zone is
terminated, but output statistics will not be bypassed.
Highway Program > Control statements > CONTINUE > Example
Exam ple
LOOP L1=1,3
IF (!(condition)) CONTINUE
ENDLOOP
IF (condition) CONTINUE
; no more processing for this origin zone
LOOP L2=K1,K2,KINC
LOOP L3=L2,L2+5
IF (condition) CONTINUE ; jump to ENDLOOP for L3
ENDLOOP
ENDLOOP
Highway Program > Control statements > EXIT
EXIT
Terminates stack processing. When the program encounters an EXIT statement, the
program goes to the end of I-loop processing.
Highway Program > Control statements > EXIT > Example
Exam ple
IF (expression) EXIT
Highway Program > Control statements > FILEI
FILEI
NOTE: See “FILEI” on page 50 for general information about FILEI and for important
limitations when using Application Manager.
FILEI, its keywords and subkeywords define the input HIGHWAY’s input data files.
Keywords and sub-keywords include:
• J U N CT ION I • T URNPENI
m N m LIST
m PERIOD m MISSINGLINK
m SET • ZD A T I
• LOOKU P I m AVE
• MA T I m AVEX0
• NET I m CNT
• SUBAREANET I m DEFAULT
• T OLLMA T I m FIRST
m ENTRYGATE m LAST
m EXITGATE m MAX
m NETIENTRY m MIN
m NETIEXIT m NAME
m NETITOLLROAD m SELECT
m TOLLFACTOR m SUM
m TOLLROUND m Z
m TOLLS
Matrix data is read dynamically (at the start of each I-loop), and must be in origin zone
(I) order, whereas zonal data is read prior to the initiation of the I-loop, and need not be
in any specified order. Data from MATI and ZDATI files are accessed via stack
statements, and are identified as MI.n.name and ZI.n.name. The n designates subscript
of the file, name designates the matrix name or number. Cube Voyager matrices can
have names and/or numbers, other matrices have only numbers, and zonal data files
have names only. Example: MI.1.3 indicates matrix number 3 on the MATI[1] file.
ZI.6.POP indicates the POP variable from ZDATI[6] file. Valid matrix names contain only
alphanumeric characters, spaces, and underscores (_). If matrix names have spaces,
then you must include the entire MI matrix reference in double quotes to recognize the
name. For example:
MW[1]="MI.1HBW TRIPS"
On the FILEI statement the subscript is either explicitly, or implicitly, specified. MATI=...
defaults to MATI[1], and MATI[3]=name3,name4,name5 sets up MATI[3], MATI[4], and
MATI[5]. Since it is required that ZDATI files have variables explicitly defined for them,
the vector form of ZDATI (ZDATI=file1, file2...) will be treated as an error.
When an input file is used in an expression, it may have an additional subscript
appended to it to specify a zone number. For matrices, the subscript references the
column within a row, and for zonal data, it references the nth item in the vector. Zonal
data can be viewed as having zones rows with one column per zone, or as one row
having zones columns (user’s choice, it doesn’t matter). If there is no subscript specified,
the current value of J is used. J will always be in the range 1-zones. Example: MI.6.3[I]
accesses the intrazonal cell. ZI.1.TRMTIME[I] and ZI.1.TRMTIME[J] reference the
origin and destination terminal times, respectively.
TURNPENI designates a file that contains intersection movement functions and penalties.
This file may be read and kept in memory for use during any path development
processes (specified with PATH on PATHLOAD statements). Even if the file is designated
on a FILEI statement, the penalties will not automatically be applied during path
development; the user must specify which penalties are to be applied on each PATH
selection. The file has two sections: functions and movements.
The function section is optional, but allows the user to specify that a penalty is to be
computed from an expression. If a function contains a C variable (movement capacity),
the penalty will be revised between iterations in the ADJUST phase.
Each record in the movement section designates a specific movement (a-b-c), a set
identifier for the movement, and the penalty to be assessed. For example,
a b c set # turnpen
-------- ------ ---------
11 23 15 1 -1 (Prohibitor)
1 12 13 3 2 (Constant)
15 58 36 8 FUNC1(500) (Function)
The penalty may be a prohibition, a fixed unit penalty, or a reference to a function in the
function section. A prohibition is designated as the constant -1. It is the user’s
responsibility to make sure that the penalty values are in the proper scale and units as
the paths to which they are being applied.
Turn functions are designated as numeric expressions that may contain constants and
the variables: T, C, PrevPen. T is the turn volume at the intersection (it may alternatively
be named TURN); C is the capacity of the movement, and PrevPen is the penalty that
was used in the previous iteration.
T is vectored (that is, it may contain an index []). T is the total volume for the movement;
it is 0 at the first iteration, but is the result of the T=expression on the TURNS statement
after the first iteration. If there is no TURNS statement, T will automatically be the sum of all
loadings. T[1] would indicate the turning volume associated with any PATHLOAD
VOL[1] statements. T[0] and T are the same variable. If a T is specified with an index for
which there is no PATHLOAD VOL[index], the value of T[] in the expressions will be 0.
Care must be taken if a fixed penalty is to be established for the first iteration, and then
dynamic values are to be used after the first iteration. This is usually done by using the
MAX function in the expression. For example: Func1=MAX(2.00,T/C*5.00). In this
example, since T would be 0 on the first iteration, the initial penalty would be 2, and it
would vary after the first iteration. If the 2 unit penalty was to remain in effect for all
iterations, and be increased according to the T/C ratio, the expression would be:
Func1=2+ T/C *5.
C is obtained from the record in the movement section as an argument of the function.
To apply the above Func1 (2+T/C*5), with C=500, the movement record would be
coded as: 100 200 201 0 Func1(500). This designates that the movement 100-200-201
is to be penalized 2 units on the first iteration and then the penalty will be increased
according to a T/C ratio (with C being 500) after the first iteration. If there were no C
affixed to the Func1 on the movement record, the C would be considered as 0 in the
computations. (Warning: Be careful not to create divided-by-zero errors when applying
functions with C=0.)
TURNPENI function records are structured as: FuncName=expression. The name is
what the user desires, and the expression is any valid numeric expression that may
contain numbers, standard functions, T, C, PrevPen.
TURNPENI movement records are structured as: A B C Set Penalty (one set per
record). The records are white space delimited (space, comma). A is the entry node to
the intersection, B is the intersection node, and C is the exit node. Set is a number in the
range of 0-8. If the set number is 0, it is applied any time that penalties are in effect, no
matter what the designated sets are. There may be up to 9 records (sets 0-8) for the
same movement. During path building, when the movement is detected and PENI= is
specified in the PATHLOAD statement, the penalty process will automatically apply set
0, if there is a set 0 for the movement. If there is no set 0, the penalty is assumed to be 0.
Then it will check all the other possible sets for the movements; it there are additional
sets, the penalty for the highest set number that matches the highest PENI designation
for the PATH process will be used. NOTE that any movements that have functions
specified will cause the B node to be included as a node for which TURNS are to be
kept, and will be reported on the TURNVOLO file.
JUNCTIONI designates a file or Cube Geodatabase network containing descriptions of
junction models. The format of the file is discussed in Chapter 7, “Intersection
Modeling.” N specifies a list of nodes where the intersection modeling is to be invoked
during the ADJUST phase. However, invoking intersection modeling for a node where
there is no model description has no effect. PERIOD is the model period in minutes. It is
used to convert the assigned volumes into units of per hour, and it is one of parameters
of the queuing delay equation.
Executing a junction model produces turning delays that may be applied during the next
iteration of capacity restraint. This form of output is similar to a set of turn penalties, and
the turn penalty set numbering system applies. The SET keyword designate the turn
penalty set to contain the model results. Turn penalty records may be applied with
higher or lower priority (that is, set number) than the calculated delays.
FILE I k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Caveat: The program establishes a buffer to read file records into. It has to know how
long a buffer is required. With DBFs and fixed format records, the required length is
known, but with delimited format, the required length can not be estimated exactly. For
delimited files, the record length is estimated by multiplying the highest field number by
10. If the estimated length is inadequate, a dummy variable with a high field number can
be specified to generate a larger record length.
Highway Program > Control statements > FILEI > Example
Exam ple
NETI=network.net ; TPP binary network file
MATI=test11.dat, test12.dat ; MINUTP binary matrix files
MATI[4]=tppltrips.mat ; TPP or MINUTP matrix file
TURNPENI=time.pen, MISSINGLINK=1
ZDATI[1]=housing.txt, Z=#1,DU1=#2,DUPLEX=3,MULTI_FAMILY=4,
CONDO=5,RETIREMENT=6
ZDAT[4]=pop.txt,Z=1-5,poptotal=6-15,popmale=16-25,popfemale=26-35,
popyouth=36-45,pop19-65=46-55,popsr=56-65,
poptotal=sum, popmale=cnt
Highway Program > Control statements > FILEO
FILEO
Specifies files that the Highway program outputs.
Keywords and sub-keywords include:
• E S T MD A T O • T OLLV OLO
m LINKTOICP m INCLUDE0
m NAME m MOMO
• E S T MICP O m MULTITOLL
m CONFVAR m NAMES
m COUNTVAR m OFFGATES
m DEFAULTCONF m ONGATES
m FORMAT m PATHSETS
m SCREENLINE m TOLLMATI
m VAR m TOLLSETS
• J U N CT ION O m VOLSETS
• MA T O • T REEO
m COMBINE m ALTNODEFIELD
m DEC m APPEND
m FORMAT m CELLTYPE
m MO m DELIMITER
m NAME m FORM
• NET O m FORMAT
m APPEND m LISTALTNODES
m DEC m LISTCOLNUMS
m EXCLUDE m LISTNETNODES
m INCLUDE m LISTLINKS
• PAT HO m MAXPERLINE
m COSTDEC m ORIGINTYPE
m ITERS m ROWTYPE
• P R IN T O • T URNPENO
m APPEND • T U R N V OLO
• S U B A R E A MA T O m DEC
m DEC m DELIMITER
m FORMAT m FORMAT
m NAME m INCLUDE0
Use FILEO to specify the number and types of files that are to be written by the program.
Requested matrices are written for every origin zone for every iteration, but are
combined into a single “combined” matrix at the end of the application. A single network
with appended volumes and associated variables is written at the end of the application.
A turning volume file must be requested if a TURNS statement is used.
There MUST be a NETO specified if assignment is to be made; there would be no use in
running the program if there was no way to obtain the results. By default the NETO file will
contain all the input variables from NETI plus the variables V, VT, VC, TIME, CSPD
(congested speed), VDT (vehicle distance traveled), VHT (vehicle hours traveled) and
a Vn, and VnT for every VOL[n] specified on any PATHLOAD statements. VT and VnT
are the non-directional (two-way) counterparts of V and Vn. (Non-directional volumes
can be turned off using NETO EXCLUDE=T_.) These appended variables will have an
assignment number appended to their names. If there were no prior assignment result
variables appended to the link records, the assignment number will be 1. Thus, the first
assignment variables will be named V_1, VT_1, VC_1, TIME_1, V1_1, V1T_1 etc. If the
NETI file contains any variable whose name ends in _#, the NETO appended variables will
have an appended number that is one greater than the highest _# from NETI.
The following list summarizes the abovementioned additional output NETO attributes
from the assignment:
• T IME _ = Congested travel time
• CS P D _ = Congested speed
• V n_ = Volume for class n for every VOL[n] specified on any P A T H LOA D statement
If the NETO file is being written to a Cube geodatabase network in an MDB file, the
source geometry for links in the output network will come from the geometry of the input
network. If the input network is a binary network, then the output NETO file will have no
associated geometry and will be displayed as straight-line links when opened in the
Cube GIS window.
The FILEO TOLLVOLO [#] file output keyword, along with its sub keywords, provides users
with the capability to output gate-to-gate toll trips captured with the TOLLPATHSET keyword
in PATHLOAD statement. Three different file formats (text, DBF and matrix) are supported
with this keyword. Below is a description of each of the keywords. The keyword
descriptions follow the same format as used in Cube help.
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
TOLLVOLO PAT HSET S |IVP1000| List of path set numbers that will
be included in the output file for
all formats except MAT. For MAT
format, the list will control the
inclusion of output tables when
wildcard characters are used in
the MO specification. If this
keyword is not specified, then by
default, all PATHSETS will be
output.
• 3 - alternative node
number
PATHLOAD must include the keyword ESTMO=num, where num is between 1 and 20
corresponding the ICP file to write to, in order for the trips assigned from that statement
to be included in the matrix estimation. There may be more than one PATHLOAD
statement including ESTMO. It does not make sense to have ESTMO=num on a PATHLOAD
statement that does not have VOL[]= on it. PATHLOAD must have the keyword PATHO=#
in order to output the path file specified with FILEO PATHO=
Highway Program > Control statements > FILEO > Example using TURNVOLO
Exam ple using m ultiple o utput screenline data files (DAT), and o utput intercept files (ICP)
RUN PGM=HIGHWAY
FILEO ESTMDATO[05] = NewSL22NF.DAT,
LINKTOICP=7,
ESTMDATO[10] = NewSL24NF.DAT,
LINKTOICP=17,
ESTMDATO[12] = NewSL23NF.DAT,
; default to match ESTMICPO[12]
ESTMICPO[02] = NewSL21NF.ICP,
countvar=li.count, FORMAT=1, ; new
; format
ESTMICPO[07] = NewSL22NF.ICP, countvar=li.count, FORMAT=0, ; old
; format
ESTMICPO[12] = NewSL23NF.ICP, countvar=li.cost, FORMAT=1,
ESTMICPO[17] = NewSL24NF.ICP, countvar=li.cost, FORMAT=1
FILEO NETO = NEWLOAD.NET
FILEI NETI = dtown2.net
PAR MAXITERS=5
PROCESS PHASE=LINKREAD
IF (LI.SPDCLASS=33) ADDTOGROUP=1
IF (LI.SPDCLASS=45) ADDTOGROUP=2
IF (LI.SPDCLASS=55) ADDTOGROUP=3
ENDPROCESS
PROCESS PHASE=ILOOP
MW[1]=10
MW[2]=20
MW[3]=30
MW[4]=40
PATHLOAD PATH = COST, VOL[1]=MW[1], EXCLUDEGROUP=1, ESTMO=2
PATHLOAD PATH = COST, VOL[2]=MW[2], EXCLUDEGROUP=2, ESTMO=7
PATHLOAD PATH = COST, VOL[3]=MW[3], EXCLUDEGROUP=3, ESTMO=12
PATHLOAD PATH = COST, VOL[4]=MW[4], ESTMO=17
ENDPROCESS
ENDRUN
Highway Program > Control statements > FILEO > Example
Exam ple
MATO=TPPTEST.MAT, MO=1-2, DEC=2*2 NAME=SLINK1,TOLL1,COMBINE=Y
MATO[3]=DEMO12.DAT, FORMAT=MINUTP, MO=1,3,5-7
NETO=ALTERNATE.NET, EXCLUDE=_#1, _#2
TURNVOLO=AlternateA.Trn.Bin, format=BIN
TURNVOLO=AlternateA.Trn.DBF, format=DBF, DEC=0
TURNVOLO=AlternateA.Trn.TXT, format=TXT, DELIMITER=',', DEC=0
ESTMICPO=ESTMO.ICP, VAR=LI.COUNT, SCREENLINE=LW.SCREENLINE
ESTMDATO=ESTMO.DAT, NAME='SL#1','SL#2','SL#3', NAME[5]='SL#5'
; The ESTMDATO and ESTMICPO keywords will not need an index because
; they default to index 1. However, the PATHLOAD ESTMO keyword value
; will have to be changed from "T" to "1" for the script to work.
Highway Program > Control statements > FILEO > Example
Exam ple
/*
Commands to generate a path file.
*/
FILEO PATHO[1]=myfile.pth, costdec=2, iters=0
.
.
.
PATHLOAD PATH=TIME, PATHO=1, INCLUDECOST=F, NAME=TIME_PATH, ALLJ=T
Highway Program > Control statements > FILEO > QUEUEDATA Example
ZONESMSG=1
TURNS N=1-99999
PROCESS PHASE=LINKREAD
C = LI.CAP
ENDPROCESS
PROCESS PHASE=ILOOP
MW[1]=500
PATHLOAD PATH = TIME, VOL[1]=MW[1], PENI=1,2
ENDPROCESS
PROCESS PHASE=ADJUST
FUNCTION {
V=VOL[1]
TC = T0 *(1+0.18*(V/C)^8.5)
}
ENDPROCESS
ENDRUN
FILET
Specifies where the Highway program writes various temporary files.
Keywords include:
• PAT H
FILE T k e y wo rd
Ke y wo rd D e s c rip tio n
The value for PATH is entered as a standard operating system path. If not specified, it will
default to the path in the environment variable named TMP, or TEMP. The logic for
determining the appropriate path, and opening the files is:
• If the PATH=' ', use current directory.
Exam ple
PATH=' ' ; use current directory
PATH=..\ ; up a directory
PATH=c:\ ; root of c:
Highway Program > Control statements > FILLMW
FILLMW
Fills work matrices.
See “FILLMW” on page 629 for a complete description.
Highway Program > Control statements > FUNCTION
FUNCTION
Defines special functions.
Keywords include:
• COS T
• TC
• V
Use FUNCTION statements to enter single expressions for computing certain values. The
statements are inoperable by themselves, and can be anywhere in the input stream, the
program dictates when they will be processed. It is recommended that they be placed
prior to the first PHASE statement or within the major phase in which they will be
processed. If there is no function for a type, a default function will be used. The V
function may be defined one time only. Each of the other functions is entered with an
index [] to indicate which LinkClass it is to be applied to. All the functions can be on one
FUNCTION statement, or they can be on individual statements, or some combination of
both. To reduce confusion, some users may wish to code the functions on a single
FUNCTION statement with a block control.
FU N CT ION k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
FUNCTION {
V = VOL[1] + VOL[3] + VOL[10]*1.3
TC[1] = T0 * (1 + 0.20 * (V/C) ^ 6)
TC[201] = MIN(T0*5, T0 * (1.5 + 0.18 * (V/C) ^ 4))
COST[255] = TIME * 2
}
Highway Program > Control statements > GOTO
GOTO
Jumps immediately to a named statement.
GOTO label
When GOTO is processed, flow immediately branches to the target statement, named
“:label.” Each GOTO statement must have an associated :label statement. Use care when
the :label statement is within a different IF or LOOP block. The target statement must begin
with a colon (:).
NOTE: GOTO is not valid in the SETUP phase. You cannot place a :label statement inside a
JLOOP statement. However, you can use a GOTO statement inside a JLOOP to jump to a
:label statement outside the JLOOP.
Highway Program > Control statements > GOTO > Example
Exam ple
GOTO buildhwy
GOTO :buildhwy
Highway Program > Control statements > GOTO > Example
Exam ple
GOTO tolls
...
:tolls
...
IF (expression) GOTO :tolls
; It is permissible to go backwards.
Highway Program > Control statements > IF ... ELSEIF ... ELSE ... ENDIF
Use IF/ENDIF blocks to determine if certain operations are to be performed. IF blocks may
be nested, but they may not overlap LOOP, JLOOP, or other IF blocks. If a variable in the
expression is MI.n.name, ZI.n.name, or MW[], the same rules for indexing in a COMP
statement are applied. MI.n.name or MW[] should realistically only be used within a
JLOOP. Lengthy IF expression solutions could be time consuming; use them judiciously.
Although IF expressions can be quite powerful for zonal selection, sometimes INCLUDE
and EXCLUDE filters may provide a much more efficient selection process (see the
examples below).
You may append the following control statements to a single IF statement:
• BREAK
• COMP
• CONTINUE
• EXIT
• GOTO
• PRINT
Highway Program > Control statements > IF ... ELSEIF ... ELSE ... ENDIF > Example
Exam ple
IF (LI.DIST< 20) LIST=a,b,LI.dist; single IF with process
IF (expression) EXIT
• E XCLU D E
• IN CLU D E
Each row represents an origin zone and each column represents a destination zone.
Typically, you use JLOOP ... ENDJLOOP blocks for matrix computations that you cannot
complete with a single COMP MW control statement.
JLOOP blocks may not be nested, and may not overlap other JLOOP, LOOP, or IF blocks.
J LOOP k e y wo rd s
Ke y wo rd D e s c rip tio n
EXCLUDE |I| Optional. List of origin zones that the program will not
process. If you include this keyword, the program will not
process statements for these zones, and instead skip to the
next zone.
INCLUDE |I| Optional. List of origin zones that the program will process. If
you include this keyword, the program will only process
statements for these zones.
A JLOOP block causes the program to loop between the JLOOP statement and its
ENDJLOOP statement, moving J from Jbeg to Jend in increments of Jinc. The logic for
JLOOP and ENDJLOOP processing is:
• At JLOOP:
m
If J is specified, establish values for Jend and Jinc, else set J=1, Jend=Zones, Jinc=1.
m
If (J < 1 or J > Zones or Jend <1 or Jend > Zones), terminate fatally.
m
If (statement contains INCLUDE keyword and J is not listed among INCLUDE keyword values)
go to ENDJLOOP.
m
If (statement contains EXCLUDE keyword and J is among listed EXCLUDE keyword values) go
to ENDJLOOP.
m
Process statements within JLOOP.
• At ENDJLOOP:
m
Add Jinc to J.
m
If (Jinc > 0 and J <= Jend) go to statement following JLOOP.
m
If (Jinc < 0 and J >= Jend) go to statement following JLOOP.
m
Control passes to statement following ENDJLOOP.
The program processes all statements between the JLOOP and ENDJLOOP statements,
including COMP MW statements, with the current value of J.
The following statements are valid within a JLOOP block:
• BREAK
• COMP
• CONTINUE
• EXIT
• GOTO
• REPORT
• SET
NOTE: You cannot place a :label statement inside a JLOOP; a GOTO statement cannot jump
into a JLOOP. However, you can place a GOTO statement inside a JLOOP to jump to a :label
statement outside the JLOOP.
Highway Program > Control statements > JLOOP ... ENDJLOOP > Example
Exam ple
;process only intra zonal values, but exclude externals
JLOOP J=I EXCLUDE 500-535
...
ENDJLOOP
ROWSUM1 = 0 ROWSUM3=0
JLOOP ; get rowsums for matrices
ROWSUM1 = ROWSUM1 + MW[1]
ROWSUM3 = ROWSUM3 + MW[3]
ENDJLOOP
Highway Program > Control statements > LINKLOOP ... ENDLINKLOOP
NOTE: You can nest LINKLOOP blocks within other blocks such as IF or LOOP, but not
another LINKLOOP. You cannot overlap them with IF blocks.
Highway Program > Control statements > LINKLOOP ... ENDLINKLOOP > Example 1
Exam ple 1
; Print each Link’s number and Distance
LINKLOOP
PRINT LIST="LINKNO=", LINKNO," LI.DISTANCE=",LI.DISTANCE
ENDLINKLOOP
Exam ple 2
; double LW.VAR for even number zones
IF (I%2==0)
LINKLOOP
LW.VAR=LW.VAR*2 ; no [LINKNO] subscript needed
ENDLINKLOOP
ENDIF
Highway Program > Control statements > LOOP ... ENDLOOP
where:
• Lvar — Name of the loop control variable. Lvar is not protected during the loop;
computational, program, and other LOOP statements can alter its value. Lvar must be
followed by Lbeg, and optionally, Lend and Linc.
• Lend — Optional. Numeric expression that Lvar is compared to when processing the
ENDLOOP statement. If not specified, no comparison is made and loop ends at ENDLOOP
statement.
• Linc — Optional. Numeric expression added to Lvar before making the ENDLOOP comparison.
If not specified, Linc is set to 1 (or -1 if Lbeg and Lend are both constants and Lbeg <
Lend; a backwards loop).
• At LOOP:
m
Initialize Lvar to Lbeg.
m
Drop through to next statement.
• At ENDLOOP:
m
If Lend not specified, jump to next statement.
m
Compute Lend.
m
If Linc not specified, set Linc to 1 or –1(if Lbeg and Lend are constants, and Lbeg >
Lend), otherwise compute Linc.
m
Add Linc to Lvar.
m
Compare Lvar to Lend.
m
If (Linc > 0 and Lvar > Lend) jump to statement after ENDLOOP
m
If (Linc > 0 and Lvar <= Lend) jump to statement after LOOP
m
If (Linc < 0 and Lvar < Lend) jump to statement after ENDLOOP
m
If (Linc < 0 and Lvar >= Lend) jump to statement after LOOP
This logic offers considerable flexibility, but can result in unpredictable results or endless
loops. Endless loops could happen if the Lend and/or Linc values are expressions that
contain variables that could change during the loop. On the other hand, the flexibility
provides for powerful control. The loop will be processed at least one time regardless of
Lend and Linc values. Most uses will involve constants. Because Lvar values can be
expressions, Lbeg, Lend, and Linc must be separated by commas (standard white
space delimiting cannot be interpreted properly).
Highway Program > Control statements > LOOP ... ENDLOOP > Example
Exam ple
LOOP pass=1,10 ; perform 10 passes
...
ENDLOOP
LOOP xyz=abc*def,ghi+jkl,mno/pqr
LOOP abc=xyz,xyz+2,2 ; nested LOOP
...
ENDLOOP
ENDLOOP
LOOP jj=10,3,-2.5 ; 10, 7.5, 5.0
...
ENDLOOP
Highway Program > Control statements > PARAMETERS
PARAMETERS
Sets general parameters.
Keywords and sub-keywords include:
• AAD • MA XIT E R S
• A LLOW LA MB D A 0 • MA XMW
• A LLOW A LLU T U R N S • MA XS T R IN G
• A LLOW U T U R N S • MA XV A R S
• CA P FA C • MOD E LP E R IOD
• COMB IN E • P D IFF
m BiFWVERSION • P D IFFV A LU E
m ENHANCE • RAAD
m FRACTIONS • R E LA T IV E GA P
m LAMBDASEARCH • R MS E
m LINKRANDSERIES • T CCOE FF
m STOCHASTICSEED • T CE XP
m • T U R N COS T FA C
VARIABLEDEMAND /
ALLJ • T U R N GA P W T
m WEIGHTS • U S E _V _ON LY
• CON S OLID A T E • ZON E MS G
• D IS T R IB _E S T M • ZON E S
• D P _COMB IN E P A T H • T R A CE S U MMA R Y
• D P _KE E P P A T H FILE
• E QU IT U R N COS T FA C
• GA P
• MA T OA D J U S T
P A R A ME T E R S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
HIGHWAY includes
support for path based
assignment using a
gradient projection
algorithm.
For details on usage,
see “PATH” on
page 188.
PROBIT
Supports stochastic
assignment.
For important usage
information, see
“PROBIT and
BURRELL” on
page 188.
BURRELL
Supports stochastic
assignment.
For important usage
information, see
“PROBIT and
BURRELL” on
page 188.
1 These keywords are used to control when to not do any more assignment iterations. In the USA, GAP is a
commonly used criteria. Thus, if GAP=0.01, this implies that when the system costs do not change by
more than one percent, the process is to terminate. The first of these criteria that is satisfied controls the
process. It is suggested that MAXITERS always be used to preclude endless processing. Some networks
may never converge, and oscillations may start. Using MAXITERS can prevent useless processing. If
MAXITERS ends up being the controlling value, the results printed at the end of the program should be
examined to determine if oscillation has occurred, or if more iterations are really needed.
Highway Program > Control statements > PARAMETERS > Example
Exam ple
ZONES=3000
COMBINE=WTD, WEIGHTS=1,1,2,3*3,5; 7 iterations
COMBINE=EQUI, MAXITERS=30
PARAMETERS COMBINE=SUM, FRACTIONS=.30,.20,5*.10
; 7 Iterations - Incremental
; SAMPLE INCREMENTAL ASSIGNMENT WITH “PROJECTED” RESTRAINT
PARAMETERS COMBINE=SUM, FRACTIONS=.5,.2,.2,.1
ARRAY CSCALE=4
CSCALE[1]=.5, CSCALE[2]=.7, CSCALE[3]=.9, CSCALE[4]=1
PHASE=LINKREAD
C = LI.CAPACITY * CSCALE[ITERATION]
Highway Program > Control statements > PARAMETERS > TRACESUMMARY Example
Glo bal U-Turn co ntro l settings and interactio n with Junctio n file level co ntro ls
Glo bal U-turn co ntro l settings and interactio n with Turn Penalty file level co ntro ls
EXAM PLE A:
RUN PGM=HIGHWAY
FILEI TURNPENI = "myTurnPen.pen"
FILEO JUNCTIONO = "myJunOut.INT"
FILEO NETO = "myLoaded.NET"
FILEI JUNCTIONI = "myJunctions.ind",
period=60,set=1
FILEI NETI = "myBase.net"
ZONESMSG=1
TURNS N=1-99999
PROCESS PHASE=LINKREAD
C = LI.CAP
ENDPROCESS
PROCESS PHASE=ILOOP
MW[1]=500
PATHLOAD PATH = TIME, VOL[1]=MW[1], PENI=1,2
ENDPROCESS
PROCESS PHASE=ADJUST
FUNCTION {
V=VOL[1]
TC = T0 *(1+0.18*(V/C)^8.5)
}
ENDPROCESS
ENDRUN
Highway Program > Control statements > PARAMETERS > EXAMPLE B:
EXAM PLE B:
RUN PGM=HIGHWAY
FILEI TURNPENI = "myTurnPen.pen"
FILEO JUNCTIONO = "myJunOut.INT"
FILEO NETO = "myLoaded.NET"
FILEI JUNCTIONI = "myJunctions.ind",
period=60,set=1
FILEI NETI = "myBase.net"
ZONESMSG=1
TURNS N=1-99999
PROCESS PHASE=LINKREAD
C = LI.CAP
ENDPROCESS
PROCESS PHASE=ILOOP
MW[1]=500
PATHLOAD PATH = TIME, VOL[1]=MW[1], PENI=1,2
ENDPROCESS
PROCESS PHASE=ADJUST
FUNCTION {
V=VOL[1]
TC = T0 *(1+0.18*(V/C)^8.5)
}
ENDPROCESS
ENDRUN
Highway Program > Control statements > PATHLOAD
PATHLOAD
Builds a path, generates related matrices, and loads path links.
Keywords and subkeywords include:
• E S T MO • P E N IFA CT OR
m ALLJ • SPREADPERC
• E XCLU D E GR OU P • S P R E A D P E R CV A R
• E XCLU D E J • S P R E A D MA X
• FR OMN OD E • S U B A R E A MA T
• IN CLU D E J m MAXMSG
• MA XP A T H COS T • T REEO
m NAME
• MW [ ]
m NOACCESS • V OL[ ]
m m Valuename
SELECTGROUP
m
SELECTLINK
m SELECTLINKGROUP
m SELECTTOLL
• PAT H
m DEC
• PAT HO
m ALLJ
m FULLPATH
m INCLUDECOST
m NAME
m PATHOGROUP
Use a PATHLOAD statement build a path, and then complete other processes based on
that path. Selected I-J path traces can be written to the standard output print file,
matrices can be generated based upon path criteria, link volumes can be obtained by
routing matrix values along the path. Although any of the keywords on the statement can
be in any order, the statement is processed in the following specific order:
1. PATH — Built using any EXCLUDEGROUP and PENI values specified
2. TRACE
3. LINKIDARRAY
P A T H LOA D k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
NOTE: INCLUDEJ and EXCLUDEJ should really be mutually exclusive, but they can be
combined. When both are used, The INCLUDEJ is processed first, and than the EXCLUDEJ
follows. Thus, if INCLUDEJ=100-200 and EXCLUDEJ=140-150, zones 100-139 and 151-200 would
be the only destination zones processed.
Example:
TOLLMATI Example:
In the above
simple PATHLOAD statements, there are
three unique set of toll trips
1. TOLLMATRIX=1, TOLLSET=1,
PATHSET=1, VOL=1
2. TOLLMATRIX=1, TOLLSET=1,
PATHSET=1, VOL=2
3. TOLLMATRIX=1, TOLLSET=2,
PATHSET=2, VOL=3
TREEO N A ME |S| Name for this path set, which will be output
to the T R E E O file.
T R A CE e xa mp le
RUN PGM=HIGHWAY
FILEO PRINTO[1] = PATH.CSV
FILEO PRINTO[2] = PATH_TRACE_RPT.DAT
FILEI NETI = TEST.NET
FromZone=150
ToZone=187
PHASE = LINKREAD
lw.fac_dist=10*li.DISTANCE
ENDPHASE
PROCESS PHASE=ILOOP
IF (I=FromZone) ; build paths for select I
PATHLOAD PATH=li.TIME mw[1]=PATHTRACE(li.TIME),
mw[2]=PATHTRACE(li.DISTANCE), TRACE=(I=FromZone
& J=ToZone) PRINTO=2 PRINT=T
F=6.0,LIST=I,J,A,B,li.TIME(8.3),_pathcost(8.3),
li.DISTANCE(8.4),lw.fac_dist(10.2)
EXIT
ENDIF
ENDPROCESS
ENDRUN
FR OMN OD E e xa mp le 1
RUN PGM=HIGHWAY
FILEI NETI = "Highway.NET"
FILEO PRINTO[1] = PATH_TIME_DISTANCE.PRN
FILEO PRINTO[2] = PATH_100500.PRN
FILEO PRINTO[3] = PATH_101000_TIME.PRN
LOOKUP NAME=FROM_TO,
LOOKUP[1]=1, RESULT=2, ; lookup from node
LOOKUP[2]=1, RESULT=3, ; lookup to node
R= '1 106500 76011',
'2 106722 83000',
'3 107100 92650',
'4 107122 100000',
'5 103500 101000'
PROCESS PHASE=ILOOP
IF (I=1)
LOOP _N=1,5
FND=FROM_TO(1,_N)
TND=FROM_TO(2,_N)
PARAMETERS TRACESUMMARY=T
PHASE=ILOOP
IF (I=1)
PATHLOAD PATH=LW.TIME FROMNODE=100500, TRACE=
(TONODE=76000,100000-100100) PRINTO=1
LIST=FROMNODE,TONODE,_pathcost(10.2)
ENDIF
ENDPHASE
ENDRUN
An example of getting toll costs would entail having a LOOKUP function where the
lookup value is the gate-gate combination traversed on the path and the result of the
function is the toll value associated with gate-gate movement.
LINKIDMW=1-2
Cost = tolllook(MW[1]*1000+MW[2])
See “Example 6: Toll Gate accumulation using LINKIDARRAY” on page 314 for an
example of using the LINKIDARRAY keyword and its subkeywords in a script.
Highway Program > Control statements > PATHLOAD > PATHLOAD example
This first PATHLOAD statement causes the COST paths to be built, and then the values
from MI.1.ODTRIPS are assigned and added to VOL[1].
The second PATHLOAD statement causes the following sequence of events:
1. COST paths are built.
2. MW[6] is set equal to the values in MW[3] for the Js whose path from I crosses link 2001-
2004. Note that MW[6] was cleared at the beginning of the ILOOP for I, but if the user
caused any values to be set into MW[6] prior to this statement, the MW[6] values could be
incorrect.
3. The values from MW[3] are assigned to the COST paths and added into VOL[1] volumes.
4. The values from MW[6] (the selected link trips) are assigned to the COST paths and added
into VOL[2].
5. The values from MW[3] are assigned to only the links that are within 7.5 minutes from I and
added into VOL[3] (these are the cold start volumes).
Highway Program > Control statements > PATHLOAD > Example
Exam ple
/*
The first PATHLOAD statement below (PATH is a trigger keyword – PATHLOAD is not
required) builds the DISTANCE paths and illustrates two different ways to extract a
LOS matrix for the path.
The second PATHLOAD statement builds the COST path using penalties and shows that
the two extracted matrices are not necessarily the same because of the penalties.
The comments illustrate how to properly skim a path when penalties should be
incorporated.
*/
PATH=LI.DISTANCE,MW[1]=PATHTRACE(LI.DISTANCE),MW[2]=PATHCOST
; MW[1] and MW[2] are the same in this case
PATH=TIME, PENI=1,3 MW[1]=PATHTRACE(COST),MW[2]=PATHCOST
; MW[1]and MW[2] could be different because penalties are used
; in the path. If MW[1]=PATHTRACE(TIME,1,3),they would be the same.
/*
Following is an example of trip splitting based upon the relative difference of time
if a link (say, a bridge) is added to the network. In this example the link is
already in the network, and it can be unavailable to the path builder by excluding
links with group code 1. The steps are:
1. Compute the time path with the bridge included and extract the times along the
path into MW[1].
2. Compute another path with the bridge excluded (group=1)and extract the times
along the path into MW[2]
3. Compute a path split based upon the total times for the two sets of paths. The
portion of trips that would use the bridge path is computed based upon the values in
the two time LOS matrices [1] and [2]. If the time saved exceeds 10 minutes and the
relative saving (time saved / total trip time) is greater than 15 percent, the
portion of trips that will use the bridge path is set equal to the relative saving.
(This is to illustrate a method of application, and is not meant to imply any type
of realistic diversion.)
4. Assign a portion of the trips to the one path set, and the remaining trips to the
other path set. The two assignments are made to the same volume set, but, they could
have just as easily be kept separate.
*/
PHASE=LINKREAD
If ((A=1001 & B=1002) | (A=1002 & B=1001)) ADDTOGROUP=1
PHASE=ILOOP
PATHLOAD PATH=TIME, MW[1]=PATHTRACE(TIME) ;w bridge
PATHLOAD PATH=TIME, EXCLUDEGROUP=1 MW[2]=PATHTRACE(TIME) ;wo bridge
JLOOP; MW[3] = the fraction of trips diverted to the bridge path
TimeSaved = MW[2] - MW[1]; 2 is always >= 1.
Divert = 0
RelativeSaving = TimeSaved / MW[2]
IF (TimeSaved > 10 && RelativeSaving >.15)Divert = RelativeSaving
MW[3] = Divert
ENDJLOOP
;assign bridge trips
PATHLOAD PATH=TIME, VOL[1]=MI.1.TRIPS*MW[3]
PATHLOAD PATH=TIME, EXCLUDEGROUP=1, VOL[1]=MI.1.TRIPS*(1-MW[3])
Highway Program > Control statements > PRINT
PRINT
Formats and prints a line of information. See “PRINT” on page 69 for details.
Highway Program > Control statements > PRINT > Example
Exam ple
IF (ITERATION = 0) ; LIST INPUT LINKS
LIST= A(5), B(5), NI.DIST(6), T0(6.2)
ENDIF
IF (ADJUST=1 && ITERATION >5 && VC >2.0) LIST='BIGVC for: ',A,B,VC(5.2)
Highway Program > Control statements > PRINTROW
PRINTROW
Formats and prints row(s) of matrices. See “PRINTROW” on page 77 for details.
Highway Program > Control statements > PRINTROW > Example
Exam ple
PRINTROW mw=1-2,1 form=LRD title='form=LRD'
PRINTROW mw=1-21 form=6D base1=y maxperline=10 form=6D,
base1=y maxperline=10
Highway Program > Control statements > PROCESS ... ENDPROCESS
• ENDPHASE
A user process phase stack is defined by a PROCESS statement that names it and an
ENDPROCESS statement that ends it. To simplify coding, the PROCESS control word is not
necessary; PHASE=name may be used directly. And, to further simplify coding, the
ENDPROCESS statement is not necessary; the occurrence of another PROCESS statement
acts as the ENDPROCESS statement. If ENDPROCESS is used, it may be coded as either
ENDPROCESS or ENDPHASE.
P R OCE S S k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
PHASE=LINKREAD
T0 = LI.DISTANCE*60 / SPEED
ENDPHASE
PHASE=ILOOP
PATH=TIME, VOL[1]=MI.1.ODTRIPS
ENDPHASE
PHASE=ADJUST
LW.TIME = TIME * LW.FLAGCODE
ENDPHASE
Highway Program > Control statements > REPORT
REPORT
Requests reports and establishes tracing.
Keywords and sub-keywords include:
• CA P A CIT Y
• PENI
• SPEED
• T R A CE
• VDT SPD
m I
m J
m FILE
m RANGE
m VOL
• ZD A T
m DEC
R E P OR T k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
TRACE=y ; turn stack tracing on
REPORT CAPACITY=yes
; report the capacities by lane by CAPCLASS
REPORT VDTSPD=T,
VOL=1, I=1-933, J=1-933,
RANGES=0-7.5, 7.5-100-5,
FILE=VDTSPD.TXT
Highway Program > Control statements > SET
SET
Sets multiple variables or arrays to the same value.
• VAL
• VARS
Use SET to set any number of variables to some value. All variables are set to zero when
they are first allocated. COMP statements produce most changes. A COMP statement is
not as efficient as a SET statement.
S E T k e y wo rd s
Ke y wo rd D e s c rip tio n
VAL |R| Value that the VARS that follow will be set
to. It must be a numeric constant. VAL is
initialized to zero when the statement is
encountered.
Exam ple
SET VAL=0, VARS=TOT1,TOT2,COUNTER
TOT1=0 TOT2=0 COUNTER=0
; is a COMP statement to do the same thing
SET VARS=TOT1 TOT2 COUNTER ; is also the same (VAL is 0)
SET VAL=123 VARS=C123, VARS=TOT1, TOT2, TOT3
; sets all to 123
SET VAL=0, VARS=VA1,VA2,VA3, VAL=100, VARS=VX, VY
Highway Program > Control statements > SETGROUP
SETGROUP
Sets group codes for a link.
• A D D T OGR OU P
• R E MOV E FR OMGR OU P
Use SETGROUP to set group codes for a link; it is applicable during only the LINKREAD
phase. Group codes are used primarily for designating links that are to be excluded in
path-building, and for inclusion in select link analysis. Each link can have up to 32
different group codes assigned to it. The codes are numbered 1-32. There are no
preconceived definitions for the codes; that is the user’s responsibility. Group codes can
be quite helpful in project analysis or for determining specific interchange to interchange
movements.
S E T GR OU P k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
PHASE=LINKREAD
IF (LI.SPDCLASS==1-3,6,9,55) ADDTOGROUP=1
Highway Program > Control statements > SORT
SORT
Sorts user-defined arrays. See “SORT” on page 81 for details.
Highway Program > Control statements > SPDCAP
SPDCAP
Revises speed and capacity tables.
• CA P A CIT Y
• LA N E S
• SPEED
The SPDCAP statement is the same as that used in the Network program to revise the
SPEED and CAPACITY tables attached to the network. If this statement is used in the
control file for the Highway program, the values from the NETI are updated when NETI is
opened. This capability allows you to test various scenarios without having to modify the
network. The revised tables will be written to the NETO file.
S P D CA P k e y wo rd s
Ke y wo rd D e s c rip tio n
A network contains an array of capacity and speed data. Each array is dimensioned with
ninety-nine values for each of nine lane stratification, and contains 891 values. When an
array is accessed, the program uses the number of lanes (LANES) as the row index, and
the capacity and/or speed classification (CAPCLASS, SPDCLASS) as the column index to
obtain a value for a link. If CAPACITY or SPEED is encountered prior to a LANES keyword on
the statement, LANES will be preset to 1-9. CAPACITY and SPEED are entered as vector
data, and may be indexed to set a specific loading place, and may have null fields to
skip the revision of certain columns. The SPEEDFOR and CAPACITYFOR functions
can be used to obtain values for these tables.
Highway Program > Control statements > SPDCAP > Example
Exam ple
;Set entire table to 50,
; then revise the values for 20,21, and 24 for lanes 1,3,8
SPDCAP CAPACITY=99*50, LANES=1,3,8, CAPACITY[20]=300,400,,,700
SPDCAP LANES=2,4-9, SPEED=20.5,30.3,50.6,,,88.2, LANES=5,SPEED[15]=15
SPDCAP SPEED=30, LANES=2-8; Inappropriate; the LANES will not be used.
Highway Program > Control statements > TURNS
TURNS
Requests turning movement volumes.
• N
• T
Use TURNS to request that the volumes at specific interchanges (nodes) be accumulated.
If there is at least one TURNS statement, the program will accumulate turns for every
PATHLOAD VOL[]= statement that is present. At the end of each iteration (in the Adjust
phase), a single total turn volume will be computed for each movement at the nodes
where turns are requested (these volumes may also be used by an intersection model, if
one exists).
By default, the single volume is computed by adding all the individual turn volume sets
together (T = TURN[1] + TURN [2] + TURN [..] ...). This default accumulation process
can be overridden by using the T= capabilities on this statement. Usually, the T=
expression should be parallel to the V= expression that is specified on a FUNCTION
statement. If additional volume sets are required for SELECTLINK analysis, only the turn
volume sets corresponding to the original volume indices should be summed. This
avoids double counting in the TURNS request.
For example, when
FUNCTION V = VOL[1] + VOL[2]
The value of T for each movement will be computed in the Adjust phase, and then
combined with other iteration values to form the “combined” volume.
By default, when there is no 'N=XXX-XXX' set specified by the user (or no TURNS
statement), the Highway program will only consider junction related nodes and links
(from the input junctions file) in the turn volume accumulation and corresponding
iteration-by-iteration statistics' calculation. Users should decide to set N=XXX-XXX
accordingly to their requirements in terms of turn volumes accumulation and
corresponding statistics calculation (e.g., when using TURNPENI, to accumulate non-
junction nodes).
To accumulate turn volumes, you must specify a FILEO TURNVOLO statement. The turn
volumes will be written to the file(s) specified on that statement.
T U R N S k e y wo rd s
Ke y wo rd D e s c rip tio n
N |IP| List of nodes at which turning volumes are
to be accumulated. Default: only junction
related nodes.
Exam ple
FILEO TURNVOLO=myfile.trn, FORMAT=BIN
TURNS N=1000-2000,3000,5000-6000,19000-32000, T=TURN[1] + TURN[3]
Highway Program > Theory
Theory
This section discusses topics related to the theory used in the Highway program. These
include:
• Process overview
• User stacks
Highway Program > Theory > Process overview
Process overview
It is important to have a basic understanding of the logic of the program, so that when
certain special operations are to be performed, they can be placed properly. Although
you can place phases in the script in any order, Citilabs suggests that you use a basic
template for all applications. If you use a basic template, then only the actual operations
of each segment need be completed.
E xa mp le o f s ug g e s te d b a s ic a p p lic a tio n te mp la te
RUN PGM=HIGHWAY
FILEI
FILEO
FUNCTION ; include V, TC, and COST functions
here
PHASE=SETUP ; normally this phase is not used
...
PHASE=LINKREAD ; insert any statements required to:
; extract custom information from the
input network.
...
PHASE=ILOOP ; build paths, skim paths, load trips
to paths
...
PHASE=ADJUST ; revise special LW.values for next
iteration
...
PHASE=CONVERGE ; optional for user specified
convergence tests
...
ENDRUN
• PHASE = LINKREAD
m
Loop LINKNO=1,NUMLINKS
• Read each link record.
• If there is a user supplied LINKREAD block, process it, then set the required values
that LINKREAD did not set properly
• Set the Time and Cost values
m
EndLoop
m
ENDPHASE
• LOOP ITERATION=1,MAXITERS
• PHASE = ILOOP
m
Loop I=1,ZONES
• Read required MATIs.
• Process the ILOOP stack.
• Write requested MATOs.
m
EndLoop
m
ENDPHASE
• PHASE = ADJUST
m
Loop LINKNO=1,NUMLINKS
• Read each link record.
• Obtain link values using most of the LINKREAD process
• Apply the appropriate Functions (V, TC, COST) for the link.
• Process the user’s ADJUST stack to either list the results of the assignment, or to
revise LW.values, or Time for the next iteration.
• Apply Function Cost.
m
EndLoop.
m
Depending upon the values for COMBINE and ITERATION:
• Combine link volumes.
• Combine MATO matrices.
m
Process the CONVERGE stack (user or default)
m
If Convergence met, exit ITERATION Loop.
m
ENDPHASE
Burrell's method
The travelers’ perceived travel cost follows a Uniform Distribution of the individual link
cost, where the mean of the link cost and variance is supplied by the user.
m
The loading process is based on perturbing link cost values used in path building away
from the mean value (input by user), which gives rise to one sample set of paths for
each origin. It generates one path per OD pair at each iteration based on the uniformly
distributed link cost.
Highway Program > Theory > Stochastic traffic assignment theory > Probit method
Probit method
The travelers’ perception error follows a Normal Distribution, where the random
perceived link cost has mean equal to the measured link travel cost and its variance is
proportional to the measured link travel cost. The proportional parameter can also be
controlled by the user.
• The probit-based stochastic assignment is able to alleviate the drawbacks of logit-based
stochastic assignment (i.e., the inability to account for correlations between alternatives?
utilities, and the inability to account for perception variance with respect to trips of different
costs.), and provides reasonable results.
• Probit-Loading process is simple, and it does not require the sampling of the perceived
path travel times; only perceived link travel times are sampled at each iteration thus
avoiding path enumeration. Probit-loading process requires higher computational time than
the logit-based loading based on Dial’s method. At the price of high computational time, it
provides reasonable results.
Highway Program > Theory > Stochastic traffic assignment theory > All or Nothing Path
User stacks
These are stacks of control statements that you provide to perform certain operations at
various times in the process. The term stack, as used here, means all the user supplied
statements for the phase. Stack and phase are sometimes used interchangeably.
Phase refers to a phase the program automatically processes, and stack refers to the
user supplied statement for that phase. The ILOOP stack is required, but all the others
are optional. Most times, the other stacks will not be necessary, but it does provide a
mechanism for altering program variable values at crucial times. Each stack begins with
a PROCESS PHASE = StackName statement. (PHASE is a trigger key, so most users
will just code PHASE= without the leading control word.) The operational statements
that are to be preformed in this stack follow the PHASE statement. The stack is
terminated by the presence of another PHASE = stackname statement, an ENDPHASE
statement, or the end of input. Non-operational statements (FILEI, FILEO,
PARAMETERS, FUNCTION and others) can be within a stack, but they are ignored
during stack processing. It is suggested that all non-operational statements be placed at
the beginning of the input for reader clarification. Each of the phases, may be specified
one time only. IF and LOOP blocks must be complete within a stack, and GOTO and
associated label statements must be within the same stack. EXIT and ABORT will
cause termination of a stack, but will have impact on the actual program process only
from ILOOP.
Highway Program > Theory > User stacks > LINKREAD stack
LINKREAD stack
This stack is in the LINKREAD phase, and is used as explained above in that section.
Primarily, it is used to obtain required link values (if they are not directly available from
the input network), and to set link LW.values and GROUP codes.
Highway Program > Theory > User stacks > ILOOP stack
ILOOP stack
This stack is the entire ILOOP phase, and is described previously. It MUST be present.
Highway Program > Theory > User stacks > ADJUST stack
ADJUST stack
This stack is processed as the last operation in the ADJUST phase link loop. It provides
a place for computing and accumulating special values such as objective functions
(currently undocumented). It also provides the capability to print certain link values
during the process. If LW.values are dependent upon Time and/or Cost, and it is
necessary to reflect the changes in those values to the LW.values for the next iteration,
the adjustment can be made here. Alternatively, the LW.values can be adjusted with
ILOOP statements.
Highway Program > Theory > User stacks > CONVERGE stack
CONVERGE stack
This stack is processed during convergence testing in the ADJUST phase. Its primary
purpose is to set BALANCE to 1 if certain conditions are met. Most users will not have
any need for this stack.
Highway Program > Examples and FAQ
• Example 8: Multiple User Class Assignment with Cost based on User Class
• Example 9: Multiple User Class Assignment with Cost based on Link Class
RUN PGM=HIGHWAY
FILEI NETI = Network.net
FILEI MATI[1] = TRIPS.mat
FILEO NETO = LOADED.NET
PARAMETERS COMBINE=EQUI MAXITERS = 99 GAP=.0001
PROCESS PHASE = LINKREAD
C = LI.CAPACITY ; set capacity equal to a link field
; assumes DISTANCE and SPEED are available on the input network
; no LINKCLASS defined, therefore defaults to 1 for all links
ENDPROCESS
PROCESS PHASE=ILOOP ; main loop for program
PATHLOAD PATH=TIME, ; build path based on time
VOL[1]=MI.1.CAR ; load trips from input matrix to volume set 1
ENDPROCESS
; No TC functions defined therefore congested travel times computed using
; the standard BPR formula for all links.
; No COST function defined therefore COST defaults to TIME
ENDRUN
Highway Program > Examples and FAQ > Example 2: Level-of-Service Skimming
RUN PGM=HIGHWAY
FILEI NETI = LOADED.NET
RUN PGM=HIGHWAY
FILEI NETI = NETWORK.NET
FILEI MATI[1] = VEHICLETRIPS.MAT
FILEI JUNCTIONI = JUNC_BASE.IND,
period=60,set=1
FILEO NETO = LOADED.NET
FILEO PATHO[1] = ROADPATHS.PTH
FILEO TURNPENO = TURNDELAYS.DAT
FILEO JUNCTIONO = TURNS.INT
; set convergence method and criteria
PARAMETERS COMBINE = EQUI, GAP = 0.005, maxiters=99
PARAMETERS EQUITURNCOSTFAC=1
; ----- SET CAPACITY and group links
PROCESS PHASE=LINKREAD
C = LI.CAP
IF (LI.FUNC_CLASS = 1-2) LINKCLASS=1
IF (LI.FUNC_CLASS = 3-10) LINKCLASS=2
ENDPROCESS
PROCESS PHASE=ILOOP
PATHLOAD PATH = TIME, VOL[1]=MI.1.1,
PATHO=1, NAME='assignment',ALLJ=T,
INCLUDECOSTS=T,PENI=1
ENDPROCESS
PROCESS PHASE=ADJUST
function {
tc[1]=t0*(1.0+0.15*((v/c)^8))
; congested time function for major roads
tc[2]=t0*(1.0+0.15*((v/c)^4))
; congested time function for minor roads
ENDPROCESS
ENDRUN
Highway Program > Examples and FAQ > Example 4: Subarea Assignment and Extraction
RUN PGM=HIGHWAY
NETI=DEMO.NET
; subarea network created with POLYGON tools in CUBE/VIPER
FILEI SUBAREANETI=subarea1.net
MATI=TRIPSBYPURPOSE.MAT
FILEO NETO=Loaded_DEMO.NET
FILEO SUBAREAMATO=submat1.mat NAME=HTW,WTH,HTO,OTH,NHB,TOTAL
PARAMETERS COMBINE=EQUI GAP=.0001
PHASE=LINKREAD
LINKCLASS=LI.CLASS
C=LI.CAPACITY
ENDPHASE
PHASE=ILOOP
; this PATHLOAD statement builds paths on TIME, assigns each trip purpose
; and the total trips to separate volume sets,
; extracts a subarea matrix for each trip purpose and the total trips
PATHLOAD PATH=TIME,VOL[1]=mi.1.1,,VOL[2]=mi.1.2,VOL[3]=mi.1.3,VOL[4]=mi.1.4,
VOL[5]=mi.1.5,VOL[6]=mi.1.6,
SUBAREAMAT[1]=mi.1.1,SUBAREAMAT[2]=mi.1.2,
SUBAREAMAT[3]=mi.1.3,SUBAREAMAT[4]=mi.1.4,
SUBAREAMAT[5]=mi.1.5,SUBAREAMAT[6]=mi.1.6
ENDPHASE
PHASE=ADJUST
; volume function V sets the volume to use for V/C in the delay function
; No delay functions (TC[#]=) are specified here so the default BPR
; formula is used for all link classes
FUNCTION V=VOL[6] ; set volume to use in congested travel time functions
ENDPHASE
ENDRUN
Highway Program > Examples and FAQ > Example 5: Select-Link Assignment
RUN PGM=HIGHWAY
MATI=TRIPS.MAT
NETI=DEMO.NET
NETO=DEMOSelectLink.NET
MATO = MATVOUT.MAT,mo=1-2,4 dec=2, combine=Y
; this is an example of an incremental assignment procedure
; the number of fractions defines the number of iterations
; at each iteration the listed fraction of the trip table is assigned
COMBINE=SUM,FRACTIONS=0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.05,0.05,0.05,0.05,0.05,0.05
; Equilibrium assignment could be performed specifying COMBINE=EQUI
; or volume averaging by specifying COMBINE=AVE if desired
PHASE=LINKREAD
LINKCLASS=LI.CLASS
C=LI.CAPACITY
ENDPHASE
PHASE=ILOOP
PATH=TIME,VOL[1]=mi.1.6, mw[1] = mi.1.6, selectlink = (L=1449-1495),
vol[2] = mw[1]
mw[2]=mi.1.6
/* this step says “build paths based on time, assign trips from mi.1.6 to these
paths and put them in Volume set 1 (V1_1 on the output network), put trips from
mi.1.6 into working matrix 1 if they are on paths that use the selected links (L=),
assign the trips in working matrix 1 (the select link trips) back to the time based
paths and put them into Volume set 2 (V2_1 on the output network), and lastly put
the total trips assigned from mi.1.6 into working matrix 2. Note that on the MATO
line mo=1-2 will output the selected trip matrix (1) and the total trip matrix
assigned (2) */
/* this step says “build paths based on time, assign trips from mi.1.6 to these
paths and put them in Volume set 3 (V3_1 on the output network), put trips from
mi.1.6 into working matrix 4 if they are on paths that use the selected links (L=),
assign the trips in working matrix 4 (the select link trips) back to the time based
paths and put them into Volume set 4 (V4_1 on the output network). Note that on the
MATO line mo=4 will output the selected trip matrix (4) for the links L=. Now you
have 4 volume sets, but only want to calculate congested travel times based on the
true total volumes on each link. This is why you need the function V=vol[1]. Note
that V=vol[3] would give the same result as these two sets are the same. The V
function is automatically executed during the adjust phase. */
ENDPHASE
PHASE=ADJUST
function { V=vol[1] }
/* this function sets the volume for the capacity restraint to be the total volume.
Without this statement, V is set to the sum of all volume sets which double counts
volume when you have a select link volume set */
ENDPHASE
ENDRUN
RUN PGM=HIGHWAY
FILEI NETI = SF_BAY_AREA.NET
FILEO MATO[1] = test.mat,
mo=1-8
PHASE=LINKREAD
LW.TIM=LI.DISTANCE/LI.FFS * 60
If (li.USE=2,3) ADDTOGROUP=1 ; don't use HOV facilities,
; they by pass tolls
ENDPHASE
PHASE=ILOOP
PATHLOAD PATH = LW.TIM, EXCLUDEGROUP=1,
MW[1] = PATHTRACE(LW.TIM), LINKIDARRAY=li.TOLL,
LINKIDCNTMW=2 LINKIDLASTUSE=3 LINKIDMW=4-8
ENDPHASE
ENDRUN
Highway Program > Examples and FAQ > Example 7: Using TOLLMATI to incorporate closed system Tolls in the
Pathbuilding process
RUN PGM=HIGHWAY
FILEI TOLLMATI[1] = "TOLL.DBF",
ENTRYGATE=ON_RAMP, EXITGATE=OFF_RAMP, TOLLS=COST_CAR,COST_TRUCK,
NETIENTRY=ONRAMP, NETIEXIT=OFFRAMP, NETITOLLROAD=TOLLROAD
FILEI NETI = "BASE.NET"
FILEI TURNPENI = "PROHIBIT1.PEN"
FILEI MATI[1] = "PKHOURTRIPS.MAT"
FILEO TURNVOLO[1] = "TURNS.DBF",
FORMAT=DBF
FILEO NETO = "TOLLLOAD.NET"
FILEO PATHO[1] = "TOLLPATH.PTH"
FILEO JUNCTIONO = "JUNCTION1.DAT"
FILEO MATO[1] = "TOLLSKIM.MAT",
MO=1-5,99 NAME=PATHCOST,COST,PATHTOLL,TIME,VEHTOLLS,LOADS
PAR MAXITERS=20
TURNS N=1-9999
PROCESS PHASE=LINKREAD
C = LI.CAP
IF (LI.FUNC_CLASS = 1-2)
LW.COEF=0.15
LW.EXPO=8.00
ELSE
LW.COEF=0.15
LW.EXPO=4.00
ENDIF
ENDPROCESS
PROCESS PHASE=ILOOP
; -----------------------------------------------------------
; trips to load
MW[99]=MI.1.1+MI.1.2
; -----------------------------------------------------------
; Assign WITH TOLL COST CONSIDERED
PATHLOAD PATH=COST, VOL[1]=MW[99],
PENI=1 TOLLMATI=1,1,
TOLLFACTOR=2.0, ; toll factor is in min/toll units,
; here 2min/$ (implies VOT=$30/hr)
MW[1]=PATHCOST, NOACCESS=0,
MW[2]=PATHTRACE(COST,1), NOACCESS=0,
MW[3]=PATHTOLL,
MW[4]=PATHTRACE(TIME,1),NOACCESS=0,
PROCESS PHASE=ADJUST
function {
tc=t0*(1.0+LW.COEF*((v/c)^LW.EXPO))
; congested time function for major roads
}
ENDPHASE
ENDRUN
Highway Program > Examples and FAQ > Example 8: Multiple User Class Assignment with Cost based on User Class
RUN PGM=HIGHWAY
FILEI NETI = NETWORK.NET
FILEI MATI[1] = TRIPS.MAT
FILEI TURNPENI = TURNPEN.PEN
FILEO NETO = LOADED.NET
FILEO PATHO[1] = HWY_PATHS.PTH
; set parameters and values for time and distance costs
PARAMETERS COMBINE = EQUI GAP = 0.005
time_cost1 = 0.5
time_cost2 = 0.7
distance_cost1 = 0.2
distance_cost2 = 0.4
; ----- SET CAPACITY and LINKCLASS
PROCESS PHASE=LINKREAD
CAPACITY = LI.CAPACITY * 1.0
; set link classes for major roads
IF (li.CLASS = 1-4) LINKCLASS = 1
; set link classes for minor roads
IF (li.CLASS = 5-10) LINKCLASS = 2
; group railway links for exclusion from assignment
IF (li.CLASS = 11 | li.CLASS = 12) ADDTOGROUP=1
ENDPROCESS
PROCESS PHASE=ILOOP
PATHLOAD PATH=COST, PENI=1-2, ; include turn penalties,
VOL[1]=MI.1.CAR, ; load car trips,
VOL[2]=MI.1.TRUCKS, ; load truck trips,
EXCLUDEGROUP=1, ; exclude rail links
PATHO=1 NAME=COST_PATH INCLUDECOSTS=T ALLJ=T
; save path file ENDPROCESS
PROCESS PHASE=ADJUST
; Define cost and delay functions
function {
tc[1]=t0*(1.0+0.15*((v/c)^8))
; congested time function for major roads
tc[2]=t0*(1.0+0.15*((v/c)^4))
; congested time function for minor roads
cost[1]=time*time_cost1+li.distance*distance_cost1
; cost function for major roads
cost[2]=time*time_cost2+li.distance*distance_cost2}
; cost function for minor roads
ENDPROCESS
ENDRUN
Highway Program > Examples and FAQ > Example 10: Shortest Path Trees Using TREEO
ENDRUN
NOTE: A global minimum capacity of 1 vehicle (or PCU) per hour is now enforced. A PCU
is similar to a vehicle but it is adjusted for vehicle length, so a car counts 1, a bus counts
2. Trucks vary between 1.5 (light van) and 2.5 (tractor-trailer).
Intersection Modeling > Introduction to intersection modeling > Cube Voyager intersection modelling and other programs
In implementation the user can provide the relationship between U-turn flow proportion
and U-turn Adjustment Factor based on their own observed data if available via a U-turn
slope parameter such that:
Otherwise u-turn slope parameter would take on a default values base on
the relationships estimated by Carter, D et al.
The table below provides an example of the effects of increasing u-turn flow proportion
on the saturation flow rate of a shared left/u-turn lane. In this example we use the default
u-turn slope parameter of 0.18 and assume that there is no right turn overlap condition
(as that is likely to be the case for all intersections in the current Abu Dhabi network).
The proportion of u-turn flow is then the ratio of u-turn flow to approach flow, the u-turn
adjustment factor Fut = 1.0-0.18*Put and S = S 0*Fut and S 0=1900. When the u-turn
flow proportion is 1.0 the lane is effectively an exclusive u-turn lane with an adjustment
factor of 0.82.
Effect o f U-turn flo w o n lane Saturatio n Flo w Rate S
Le ft U -T urn A p p ro a c h
Flo w flo w flo w P ut F ut S
where,
= number of vehicles (PCUs in STEAM model context) that can queue up in the
right most through lane before it blocks the entry into the right turn pocket/channel
(length of right turn storage bay in vehicles or distance from the stop line to the entry
point to the right turn channel in vehicles if no right turn storage bay). This parameter
value is computed from the user supplied length of the entry lane (Free Turn Entry
Length) in meters (or feet if US units) and the average queued vehicle density
(Queued Vehicle Spacing in meters/feet) specified by the users. Presence of some
positive value for Free Turn Entry Length triggers the free right turn model to be
applied for the right turn movement of the approach.
= right turn volume at approach j (vph)
= volume in the right most through lane at approach j (vph)
where,
= total volume in the through lane group at approach j (vph)
= total number of lanes in the through lane group at approach j (vph)
= lane utilization factor at approach j from HCM2000 exhibit 10-23
This entry capacity is independent of the presence multiple lanes for the free right
movement as it only depends on the through queue blocking entry.
Exit Capacity
A gap acceptance model for the determination of the flow rate at the exit would be
appropriate for the case with little or no acceleration lane however some adjustment
needs to be made to account for the length of the acceleration lane if one is present. As
the length of the exit/acceleration lane increases the less impact there is on the lanes
flow rate due to merging and lane changing with conflicting flow such that the flow rate
should approach the saturation flow rate s, as defined in HCM2000.
The exit lane capacity for approach j during signal phase i can be defined as:
If :
else if :
Else
where,
= length in meters (or feet) of the right turn exit/acceleration lane. This parameter is
specified by the users. Measured from the first point a vehicle could enter the
conflicting traffic stream to the last point a vehicle could enter the conflicting traffic
stream.
= maximum exit lane length. Lane lengths at or greater than this value have no
effect on capacity. This defaults to 160m but can be overridden by the user.
= gap acceptance model based capacity computed as a signal time weighted
average capacity computed for each interval of the signal cycle during the red
phase for the approach. During the green phase of the approach the capacity is
assumed to be at saturation flow (1900vph). Functional form uses TWSC gap
acceptance model per HCM2000 equation 17-3 but with adjusted critical gap and
follow-up time parameters:
where,
= conflicting flow rate for the free right movement at approach j
= critical gap, i.e., the minimum time that allows vehicle for a free right movement.
It's a user-specified parameter with a default value of 4 seconds.
= follow-up time, i.e., the time between the departure of one vehicle from
approach and the departure of the next under a continuous queue condition. A
user-specified parameter with a default value of 2.5 seconds.
Given the default values of critical gap and follow-up time, the above relationship to
compute exit lane capacity based on a gap acceptance model adjusted for the length
of the exit lane is depicted in the figure below:
The upper limiting value of the capacity from the gap acceptance model
is the value computed as the conflicting flow approaches zero and is a
function of the assumed critical gap and follow up time parameters
used. Based on the default values for these parameters this upper
limiting value is 1440.
In cases where multiple lanes are present for the free right movement the number of
lanes is included in the computation for the exit saturation flow. However a reduction
factor should be applied similar to the method used for two lane entry to round about
circulation lanes.
Once the entry and exit capacities are determined, is determined and used to
compute delay from a modified HCM Exhibit 17-38 formula as:
where,
= capacity of a free right movement for an approach j at a signalized
intersection
= analysis time period (h)
= right turn volume at approach j (vph)
Intersection Modeling > Control statements
Control statements
A junction file contains a sequence of statements, of which at most one is a UNITS
statement, and the remainder are JUNCTION statements.
This section describes:
• JUNCTION
• UNITS
Intersection Modeling > Control statements > JUNCTION
JUNCTION
Each JUNCTION statement, listed below, describes the control of some particular
intersection in the network. It follows the usual syntax for Cube Voyager script
statements. Comments, also following the usual Cube Voyager script syntax, are also
allowed in the file.
J U N CT ION s ta te me nt k e y wo rd o v e rv ie w
A ll- R o und a b o ut
wa y P rio rity P rio rity Ga p R o und a b o ut S ig na ls S ig na
Ke y wo rd S to p Ge o me tric S a tura tio n a c c e p ta nc e E mp iric a l Ge o me tric S a tur
ACTUALGREEN |R| v v
APPROACH |KIV10| v v v v v v v
APPROACH1 |KI| v v v v v v v
APPROACH-WIDTH |R| v
AVERAGELANE-WIDTH |R| v
BUSBLOCKAGE |RV2*| v
CANSHARE-LEFT |?| v v v
CANSHARE-RIGHT |?| v v v
CAPACITY-INTERCEPT |R| v
CAPACITY-SLOPE |R| v
CENTRAL-BUSINESS- |K?| v
DISTRICT
CENTRAL-RESERVATION- |KR| v
WIDTH
CRITICALGAP |R| v
CYCLETIME |KR| v v
ENTRYANGLE |R| v
ENTRYRADIUS |R| v
ENTRYWIDTH |R| v
ESTIMATED-DELAY |R| v v v v v v v
EXCLUSIVE-LANES |I| v v v
EXITONLY |?| v v v v v v v
FLARELENGTH |R| v
FOLLOWUP-TIME |R| v
FOURLANE-MAJOR |K?|
FREEFLOWCAP |R| x v x x x x x
FR E E T U R N E N T R Y |R| v v
FR E E T U R N E XIT |R| v v
FR E E T U R N FOLLOW U P |R| v v
FR E E T U R N GA P |R| v v
GRADE |R| v
INITIALQUEUE |R| v v v v v v v
INSCRIBED-DIAMETER |R| v
LANEADJUST |K?| v
MAJORROAD-WIDTH |KR| v
MINIMUM-CAPACITY |R| v v v v v v v
MOVEMENT |S| v v v v v v v
NODE |KI| v v v v v v v
NUMBEROF-LANES |I| v
PARKING-MANEUVERS |RV2*| v
PHASE |KI| v v
PHASES |I| v v
RANDOMNESS |R| v v v v v v v
SATFLOWPER-LANE |R| v v
STORAGESPACE |KR|
TURN-CHANNELIZED |?|
TYPE |KS| v v v v v v v
U T U R N CON T R OL |R| v v v v v v v
U T U R N S LOP E |R| v v v v v v v
V E H LE N GT H |R| v v
VISIBILITY |R| v
WIDTH |R| v
UNITS
Defines units of measurement for junction geometry. Keywords and include:
• LE N GT H
This statement defines whether the lengths used to define junction geometry are
measured in feet or meters. The value of the Length may be either “feet” or “meters”
(case insensitive). At most one UNITS statement may appear in a junction file. If no UNITS
statement is found, measurements will be taken to be in meters.
The keywords, in the Junction statement, that have units of length are: AverageLaneWidth,
ApproachWidth, EntryWidth, EntryRadius , FlareLength, InscribedDiameter, Width, Visibility, MajorRoadWidth
and CentralReservationWidth.
Intersection Modeling > Control statements > UNITS > Example
Exam ple
UNITS LENGTH=FEET
UNITS LENGTH=METERS
Intersection Modeling > Common keywords
Common keywords
This section describes common keywords, applicable to multiple intersection types:
• APPROACH
• APPROACH1
• ENABLE
• ESTIMATEDDELAY
• EXITONLY
• HCMVERSION
• INITIALQUEUE
• MINIMUMCAPACITY
• MOVEMENT
• NODE
• RANDOMNESS
• TYPE
• U-TURN CONTROL
• U-TURN SLOPE
Intersection Modeling > Common keywords > APPROACH
APPROACH
The APPROACH keyword takes a list of integers as its value. It has two functions within the
junction description:
1. It begins a sequence of keywords which describe the specified approach. This sequence
continues until the next occurrence of Node, Type, LaneAdjust, CentralBusinessDistrict, CycleTime, Phase,
MajorRoadWidth, CentralReservationWidth, StorageSpace, FourLaneMajor, Approach1 , Approach, or the end of the
JUNCTION statement.
2. It describes how neighbors of the modeled node are grouped into approaches. The value
of the keyword is a list of node numbers of nodes adjacent to the node being modeled. The
grouping of neighboring nodes into a single approach may be necessary, for example,
because Cube Voyager can only model three- or four-legged intersections (although, at
roundabouts, this restriction may be overcome by modeling the circulating section
explicitly); because some of the neighbors are fictional (for example, zone centroid
connectors); or because the two lanes of a road are represented by individual links.
Every node, which is a neighbor of the modeled node, must appear in exactly one
Approach clause.
Cube Voyager requires that the legs of a junction can be assigned a clockwise ordering
by using the coordinates of the nodes involved. Any grouping of links into legs must not
invalidate the ordering. For example, in the diagram below, a is a modeled node. Any
valid approach which includes both nodes b and d must also include node c.
Intersection Modeling > Common keywords > APPROACH1
APPROACH1
Every junction description must contain exactly one occurrence of the integer-valued
keyword APPROACH1. Its value is the node number of a node adjacent to the modeled
node, Node. The approach containing the specified node, is taken to be the first
approach and the other approaches are numbered in relation to it.
By default, the approaches are numbered in anti-clockwise order, but if LEFTDRIVE = y is
in force, the approaches are numbered in clockwise order.
At two-way stop-controlled and priority (two-way yield-controlled) intersections, the first
and third approaches are major and the second and fourth (if any) approach are minor.
At three-legged intersections, the value of APPROACH1 determines which movements are
available from each approach:
Le ftD riv e =
n Le ftD riv e = y
ENABLE
Every junction description may contain at most one occurrence of the logical-valued
keyword ENABLE. If it has the value false, Cube Voyager will ignore the entire junction
description (that is, no intersection modeling will occur at the node).
ENABLE is a quick way of turning modeling on and off at a particular node from within the
junction file during model development. Modeling can also be turned on and off in the
Cube Voyager Highway script file using the N clause of the FILEI JUNCTIONI command.
Intersection Modeling > Common keywords > ESTIMATEDDELAY
ESTIMATEDDELAY
NOTE: Keywords are case insensitive. Capitalizing as EstimatedDelay might improve
readability.
This real valued keyword specifies the delays, in minutes per vehicle, to be used during
the first PATHLOAD command to be executed. This occurs prior to the first Adjust phase,
so no calculated values will be available yet. Once an Adjust phase has been executed,
calculated values will replace these initial estimates.
By default, a value of 0.0 minutes is used. However, in urban areas, this is a very poor
estimate and it is very desirable that better values be supplied.
An approach’s ESTIMATEDDELAY value is analogous to a link’s initial travel time. On the
assignment’s first iteration, no volumes exist yet to use for junction-delay calculations.
During the first iteration, this user-specified value provides an initial estimate of the
movement delay during path building.
Intersection Modeling > Common keywords > EXITONLY
EXITONLY
NOTE: Keywords are case-insensitive. Capitalizing as ExitOnly might improve readability.
For any “approach,” EXITONLY=y indicates that the leg is not an approach; it is an exit
only. No other keywords, except EXITLANES, may be coded for the approach.
The coding of EXITONLY must agree with the network (that is, the exit only approach must
correspond to a set of one-way links leading away from the modeled intersection).
Intersection Modeling > Common keywords > HCMVERSION
HCMVERSION
This keywoard signifies if the delay calculations should be based on HCM 2000 or HCM
2010. Valid values are either 2000 or 2010. Depending upon which type of delay
calculations the user wishes to use, the respective value will be used. For the new
calculators, it is set to 2010.
Intersection Modeling > Common keywords > INITIALQUEUE
INITIALQUEUE
NOTE: Keywords are case insensitive. Capitalizing as InitialQueue might improve
readability.
This is the number of vehicles (pcu) that are waiting to make the specified movement
from the specified approach at the beginning of the model period. It defaults to zero.
INITIALQUEUE is the queue at the start of the modeled period. INITIALQUEUE generates
additional delay after Cube Voyager assigns flows and calculates delay because the
vehicles arriving during the assignment must wait for the queue in front of them to
discharge before they reach the stop line (or give-way line). Consequently, if there is no
assignment (that is, just path building for skimming), INITIALQUEUE has no effect. Note
that the initial queue’s discharge rate is not a constant; the discharge rate depends on
the junction’s conflicting flows. Rather than being additional time added to the delay at
the end of the process, INITIALQUEUE is more like additional demand added to the
assigned demand prior to junction calculations. However, the delay to the vehicles in the
initial queue is not part of the results. The results only include the delay that these initially
queueing vehicles cause to the vehicles that arrive during the modeled period.
Intersection Modeling > Common keywords > MINIMUMCAPACITY
MINIMUMCAPACITY
The MINIMUMCAPACITY keyword takes a positive value in vehicles per hour as its
argument. It is coded by approach. If no value is coded, a default value of one vehicle
per hour is applied.
If the calculated capacity for any stream from an approach is less than the minimum
capacity value for that approach, the minimum capacity will be used instead of the
calculated value. This substitution occurs before any delay calculations are started.
The minimum capacity is most likely to apply when a movement is very lightly trafficked
but is very heavily opposed. In this circumstance, the delay for the lightly trafficked
movement will be close to 60/MinimumCapacity (that is, the default value leads to
delays being estimated as an hour).
The default minimum capacity of one vehicle per hour is sufficient to prevent division by
zero errors from crashing program execution but there are two arguments in favor of
applying a higher value:
1. Modeling expediency: If a minimum capacity of one vehicle per hour results in a predicted
delay of the order of an hour, trips will be diverted away from that turn during subsequent
iterations. So long as the turn has low traffic there is little reason for the turn model to
allocate capacity to that movement (especially at adaptive signal models where the signal
optimizer will be trying to allocate the available green time where the flow is heaviest).
Thus a positive feedback may occur between having low traffic on the turn and having high
delay on the turn.
2. Driver behavior: If conditions are very congested, drivers will no longer wait for an
appropriate gap in the opposing stream. Eventually, they will just force their way into a
smaller gap. This is especially true when the opposing stream is a slow moving queue.
Intersection Modeling > Common keywords > MOVEMENT
MOVEMENT
The MOVEMENT keyword takes one of three case-insensitive values:
• Left
• Right
• Through
NODE
Every junction description must contain exactly one occurrence of the integer-valued
keyword NODE. Its value is the node number of the junction to be modeled.
Intersection Modeling > Common keywords > RANDOMNESS
RANDOMNESS
RANDOMNESS is a real-valued keyword which specifies how random the service times are
with respect to the arrival times. Its value must satisfy the inequality 0.0 < RANDOMNESS
<= 1.0. At geometrically modeled signals, the platoon ratio is estimated as 2(1.0 -
RANDOMNESS)
By default, RANDOMNESS is 0.55 for signalized intersections and 1.0 for unsignalized
intersections. These values are appropriate for isolated junctions (that is, arrivals are
random). The lower value for signals reflects that even if arrivals at a signal are random,
the service times depend on whether the arrival was at a green signal aspect or a red
one.
However, in urban areas where there are signal linkage effects, the appropriate
RANDOMNESS values are reduced. RANDOMNESS values of 0.1 or 0.2 are appropriate for
signals in advanced traffic management systems (for example, SCOOT, SCATS,
OPAC) or in offline signal plans at the time that they are installed. Unsignalized
intersections in this region should have RANDOMNESS values of the order 0.3 or 0.4.
Offline signal plans are generally not completely up to date so they are usually more
random than ATMS. Consequently, in areas where offline signal plans operate
RANDOMNESS values for signals should be 0.3 or 0.4; values of 0.6 to 0.8 are appropriate
for unsignalized intersections in these areas. When using “dummy links” to model
internal parts of a signal (such as modelling a five-armed signal as two nodes)
synchronization across the dummy link is perfect. Therefore, code very low values of
randomness, such as 0.01, for the relevant approaches.
Intersection Modeling > Common keywords > TYPE
TYPE
Every junction description must contain exactly one occurrence of the keyword TYPE. It
determines the type of junction to be modeled. Its value should be taken from the
following list:
• Roundabout
• Priority
• FixedTimeSignal
• Adaptive Signal
• TwoWayStop
• AllWayStop
The keywords are case insensitive; the capitalization in the list above is merely to
improve readability.
Note that the type field only distinguishes between different types of intersection on the
ground. When Cube Voyager offers more than one methodology for modeling a
particular kind of junction control, other keywords will be used to distinguish between
them:
• The presence or absence of CRITICALGAP and FOLLOWUPTIME (by approach) distinguishes
between gap-acceptance and empirical roundabout modeling
• The value of LANEADJUST distinguishes whether a fixed time signal uses geometric modeling
or measured saturation flows
• The value of HCMVERSION determines teh delay calculation methodolgy to use. (only
applies to All-Way, Two-Way and Roundabouts)
The exception to the above rule is signals when there are several layers of choice of
modeling methodology. When observed base-year signal settings are available, use
TYPE=FixedTimeSignal to perform delay calculations for those settings. However, given a
feasible signal setting and a set of constraints, Cube Voyager can optimize the settings
for the forecast flows. This facility is invoked using TYPE=AdaptiveSignal. (Note that when
forecasting future years, adaptive modeling is always recommended; even if the signal
controller is fixed time, some traffic engineer will reset the signals every few years.)
The next level of modeling methodology chooses between calculating capacities using
supplied saturation flows or calculating them using the methodology described in HCM
2000, Chapter 16. The HCM methodology is invoked using the keyword LANEADJUST.
Both methodologies may be invoked either using supplied settings or adaptive green
time calculations. Note that the HCM methodology can model semi-actuated signal
controllers. Giving the keyword UnitExtension to a positive value for some approach
invokes this model. The issues of “adaptive settings” (that is, future or base year) and
“actuated controllers” (that is, hardware in the field) are independent of each other.
When HCM capacity calculations are executed, by default Cube Voyager also applies
the HCM delay calculations. However, for all other models, a delay equation formulated
by Ian Catling is used. If you code DELAYEQUATION=Catling you can force the use of
Catling’s delay formulation at an HCM signals.
Note that the type of control called a “priority junction” in the U.K. (where they are very
common) would be called a “two-way yield-controlled intersection” in the U.S. (where
stop-controlled intersections are the norm).
Intersection Modeling > Common keywords > U-TURN CONTROL
U-TURN CONTROL
U-turn control keyword specifies if the intersection has U-turn movement coded locally. It
has 3 check boxes at each approach to specify if U turns are allowed or banned, and if it
has an exclusive lane. If users check Allow only, it means that U-turn movement does
not have an exclusive lane but shared with the left most lane with the left turn lane(s).
Allow and Ban cannot be checked together. If they are both unchecked, then it means it
will be controlled by the keyword set in Voyager (Allo wAllUTurns) . If any of the three boxes
are checked, it means that this intersection node has local settings. See
PARAMETERS.
Intersection Modeling > Common keywords > U-TURN SLOPE
U-TURN SLOPE
This keyword is the U turn saturation flow reduction factor value. If specified, it will
override the global default setting, regardless of the turn overlap condition. The valid
range for this key word is [0.01, 0.66]. The Intersection Data Editor only takes values
with 2 decimal places. If provided with more than 2 decimal places, the values will be
rounded up with 2 decimal places. There is a file default specified for the whole junction
data file (See Data file settings) option for No Turn Overlap and With Turn Overlap
condition. If not specified in the File Settings, it will default to 0.18 and 0.33 for no overlap
and with overlap. The overlap condition is determined by the software automatically from
the phase setting. See Methodology for U-Turns at Signalized Intersections.
Intersection Modeling > Signal-controlled intersections
Signal-controlled intersections
This section describes signal controls. Topics include:
• Overview of signals
• Generic keywords
• Geometric keywords
Overview of signals
Signalized intersections are controlled by sets of traffic lights. At any given time, vehicles
making a particular movement through the intersection will see a particular signal
aspect:
• In the U.K., red, green, amber, red amber, flashing amber.
Modelers reclassify the aspect into effective green (when the traffic can go) and effective
red (when the traffic stops). Note that effective green begins and ends later than actual
green (due to reaction times).
A set of signal aspects for all movements through an intersection is called a phase. Note
that the total duration of all the phases should be significantly less than the duration of
the signal cycle. The difference is primarily due to two factors: lost time while the signals
are changing phase and pedestrian phases.
Cube Voyager offers two ways of modeling the capacity of signals. There is a detailed
model of junction geometry, which has been calibrated to traffic conditions in the U.S.
(Geometric / HCM model), and there is a model which requires saturation flows to be
estimated or measured externally, which has been calibrated to traffic conditions in the
U.K.(Saturation Flow model). The detailed model also imposes more constraints on the
allowed signal phasing than the saturation flow only model.
Cube Voyager offers four signal intersection types, i.e. signal saturation flows, signal
geometric (HCM), adaptive signal saturation flows, and adaptive signal geometric
(HCM).
• S ig na l, S a tura tio n Flo ws mo d e l :
It is developed to model capacities, queues, delays and LOS at
fixed time signal controlled isolated intersections. The user inputs include geometric
characteristics of the intersection, signal timing arrangements, and demand flow
information. The methodology is based on the Catling's delay method and the TRRL
(Transport and Road Research Laboratory, UK) Report 105.
• S ig na l, Ge o me tric (H CM) mo d e l :
It addresses the capacities, queues, delays and LOS for lane
groups and the LOS for intersection approaches and the intersection as a whole at
signalized intersections. Each lane group is analyzed separately in the HCM model. It
considers a wide variety of prevailing conditions, including the amount and distribution of
traffic movements, traffic composition, geometric characteristics, and details of intersection
signalization. The methodology is based on the HCM 2000 signal model.
The above intersection types output not only delay, capacity, queue and LOS, but also
low flow delay. The low flow delay is a measure commonly used by European users. It is
the additional travel time experienced by drivers of each movement at low degree of
saturation (flow to capacity ratio << 1). According to Catling's delay method, the delay at
low degree of saturation is almost equal to that occurring when the traffic intensity is
uniform. The low flow delay is calculated as the inverse of the capacity for Saturation
Flows models, and is calculated as the half cycle time times the square of the red time
proportion for Geometric (HCM) models.
A left turn (right turn when LEFTDRIVE=T) which sees a green phase will either be
protected (that is, no opposing flow is running) or permitted (that is, the vehicles must
give way to some oncoming traffic). Both methodologies can model both permitted and
protected phases.
Cube Voyager does not offer any model of “right turn on red” although this is allowed in
many areas of the U.S. (The LEFTDRIVE=T equivalent, “left turn on red,” is not permitted
in the U.K.) This is best handled by introducing a dummy link into the network, allowing
the right-turners to bypass the signal control, and omitting some lane(s) from the
definition of the approach.
References
• Kimber, R. M., Mcdonald, M., Hounsell, N. B. (1986). The prediction of saturation flows for
single road junctions controlled by traffic signals. Transport and Road Research
Laboratory Report RR 67.
• Kimber, R.M. and M.C. Semmens (1983). Traffic signal junctions: a track appraisal of
conventional and novel design. Transport and Road Research Laboratory Report RL 1063.
Generic keywords
This section describes generic keywords used for signals:
• CANSHARELEFT
• CANSHARERIGHT
• CYCLETIME
• EXCLUSIVELANES
• LANEADJUST
• PHASES
• SATFLOWPERLANE
• SINGLELANE
Intersection Modeling > Signal-controlled intersections > Generic keywords > CANSHARELEFT
CAN SHARELEFT
NOTE: Keywords are case insensitive. Capitalizing as CanShareLeft might improve
readability.
This keyword specifies that there is a shared lane to the left of the exclusive lanes for
this movement (that is, the movement can share with the movement to its left). Note that
this keyword does not mean “can share with left turners” unless either the movement is
THROUGH or the movement is on the minor leg of a three-arm junction.
CAN SHARERIGHT
NOTE: Keywords are case insensitive. Capitalizing as CanShareRight might improve
readability.
This keyword specifies that there is a shared lane to the right of the exclusive lanes for
this movement (that is, the movement can share with the movement to its right). Note
that this keyword does not mean “can share with right turners” unless either the
movement is THROUGH or the movement is on the minor leg of a three-arm junction.
If a movement has CANSHARERIGHT = T coded, then there must be a movement to this
movement’s right, and the movement to this movement’s right must have CANSHARELEFT
= T coded.
If SINGLELANE = T then CANSHARERIGHT should not be coded.
Intersection Modeling > Signal-controlled intersections > Generic keywords > CYCLETIME
CYCLET IME
NOTE: Keywords are case insensitive. Capitalizing as CycleTime might improve readability.
This real-valued keyword is required for all signals. Its value is the length of the signal
cycle in seconds.
The cycle time must be strictly greater than the sum of all the coded green times.
At actuated signals, the CYCLETIME value is taken to be part of the example feasible
solution and the subkeywords MAXIMUM and MINIMUM may be used to supply
constraints. For example:
Actual Cycle = 120, Minimum = 60, Maximimum=180,
If no constraints are placed on the cycle time at an adaptively modeled signal, the
constraints will be deduced from the constraints on the individual green times.
Intersection Modeling > Signal-controlled intersections > Generic keywords > EXCLUSIVELANES
EX CLUSIVELAN ES
NOTE: Keywords are case insensitive. Capitalizing as ExclusiveLanes might improve
readability.
This integer-valued keyword gives the number of lanes, on the specified approach,
which are reserved for the exclusive use of vehicles making the specified movement.
If SINGLELANE = T, then EXCLUSIVELANES should not be coded.
Intersection Modeling > Signal-controlled intersections > Generic keywords > LANEADJUST
LAN EADJUST
NOTE: Keywords are case insensitive. Capitalizing as LaneAdjust might improve readability.
PHASES
The keyword PHASES is integer-valued but, conceptually, it consist of either one phase
number (that is, digit) or of two phase numbers (that is, two digits). The vehicles making
the movement see a green signal aspect when the specified phase(s) is/are running
and red otherwise.
Note that the (node-level) keyword PHASE is used to define phases and the (movement-
level) keyword PHASES associates movements with the defined phases.
At geometrically specified signals, then any two-digit phase specifications must specify
contiguous phases. No such restriction is required when saturation flows are coded.
Intersection Modeling > Signal-controlled intersections > Generic keywords > SATFLOWPERLANE
SAT FLOWPERLAN E
NOTE: Keywords are case insensitive. Capitalizing as SatFlowPerLane might improve
readability.
This real-valued keyword allows the specification of saturation flows in pcu (vehicles)
per hour per lane.
Saturation flows at signals are the flows that would be observed if the movement had a
continuous green all other movements had no flow and no green.
Saturation flow at a priority junction (two-way yield-controlled intersection) is defined
similarly, except that no signal aspects are involved. SATFLOWPERLANE is only applicable
to Saturation flow model. The suggested value is 1700 pcu/h for THEOUGH and
UNOPPOSED movements and 1279 pcu/h for OPPOSED movements.
Intersection Modeling > Signal-controlled intersections > Generic keywords > SINGLELANE
SIN GLELAN E
NOTE: Keywords are case-insensitive. Capitalizing as SingleLane might improve readability.
At two-way stop-controlled intersections and priority junctions, a minor arm that does not
have SINGLELANE = Y explicitly coded, has two lanes.
Intersection Modeling > Signal-controlled intersections > Geometric keywords
Geometric keywords
This section describes geometric keywords:
• AVERAGELANEWIDTH
• CONFLICTINGBIKE
• BUSBLOCKAGE
• CENTRALBUSINESSDISTRICT
• DELAYEQUATION
• EXITLANES
• FREEENTRYLENGTH
• FREETURNEXITLENGTH
• FREETURNFOLLOWUP
• FREETURNGAP
• GRADE
• NODEFACTOUNOPPOSE
• NODEFACTOOPPOSE
• PARKINGMANEUVERS
• PEDESTRIANFLOW
• PEDESTRIANPHASE
• PHASES
• UNITEXTENSION
• VEHICLELENGTH
Intersection Modeling > Signal-controlled intersections > Geometric keywords > AVERAGELANEWIDTH
AVERAGELAN EWIDT H
NOTE: Keywords are case insensitive. Capitalizing as AverageLaneWidth might improve
readability.
This real-valued keyword describes the mean lane width, in meters or feet, of an
approach to a geometrically modeled signalized junction. If no value is provided, a
default of 3.6m is used.
The average lane width must be in the range from 2.4m to 4.8m. If the value falls outside
this range, the approach should be recoded to have more or fewer lanes, as appropriate.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > CONFLICTINGBIKE
The flow of bicycles in from the curb-side lane in units of bicycles per hour. Bicycle traffic
which weaves with turning traffic in advance of the stop line should be excluded from this
value, because these bicycles do not interact with the other vehicles while they are still
within the intersection.
The diagram below illustrates the relevant bicycle flow for right hand rule of the road. In
the diagram, the crossed box is the bicycle conflict zone where right turning traffic may
be impeded by any bicycles crossing the intersection. The CONFLICTINGBIKE is the flow
of bicycles through this region.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > BUSBLOCKAGE
BUSBLOCKAGE
NOTE: Keywords are case insensitive. Capitalizing as BusBlockage might improve
readability.
The real values supplied to this keyword are number of buses stopping per hour. The
first element refers to the normal curb side of the road; the second refers to the other
side of the road (for example, if there is a tram line in the center of the road or there is a
bus stop on the offside of a one-way street). Only buses stopping within 75 meters (246
feet) of the stop line (either upstream or downstream) should be included.
This keyword is only applicable at geometrically modeled signals.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > CENTRALBUSINESSDISTRICT
DELAYEQUAT ION
Selects the delay modeling methodology applied to the capacities calculated by the
HCM2000 signal capacity modeling methodology. The keyword accepts the values
“HCM” or “Catling” (case-insensitive). By default, The HCM delay equations are
invoked.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > EXITLANES
EX IT LAN ES
The number of lanes traveling away from the modeled intersection.
This key may occur on the same arm as the EXITONLY keyword but is invalid for a one-
way link that travels towards the intersection.
Cube Voyager only uses this value for pedestrian and bicycle modeling.
FREEEN T RYLEN GT H
This keyword defines the length in the entry leg measured from the stop line to the
earliest point when a free turn vehicle can enter the free turn pocket or channel in the
current unit (meter or feet. See Data file settings). If this value is greater than zero and
the turn is coded as exclusive, then it is considered a free turn. Default to 0 for not a free
turn. The Intersection Data Editor only takes values with 2 decimal places. If provided
with more than 2 decimal places, the values will be rounded up with 2 decimal places.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > FREETURNEXITLENGTH
GRADE
The real-valued keyword GRADE describes the grade, expressed as a percentage, of an
approach to a geometrically modeled signals or a two-way stop-controlled intersection. It
is a signed value; negative values indicate that the approach is downhill and positive
values indicate that the approach is uphill.
By default the approach is assumed to be flat (GRADE = 0).
The models have been calibrated for grades the range -6% to +11%, but more extreme
grades do occur. For example the maximum grade in San Francisco is about 31%.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > NODEFACTOUNOPPOSE
N ODEFACT OOPPOSE
Option to stop the de-facto exclusive turn lane check on the opposed turning movement
(left turn on right drive and right turn on left drive). This is a boolean keyword. Setting this
option to True will disable the check for exclusive turn lane modeling when volumes
exceed threshold. This setting is used to control the lane grouping for turn movements.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > PARKINGMANEUVERS
The real values supplied to this keyword are number of maneuvers per hour. The first
element refers to the normal curb side of the road; the second refers to the other side of
the road (that is, if there is parking in a central reservation or on the offside of a one way
street). Only parking within 80 meters of the stop line should be included
By default, parking is not allowed. Coding PARKINGMANUEVERS = 0 means that parking is
allowed, but it is extremely rare.
This keyword is only applicable at geometrically modeled signals.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > PEDESTRIANFLOW
PHASES
The keyword PHASES is integer-valued but, conceptually, it consist of either one phase
number (that is, one digit) or of two phase numbers (that is, two digits). The vehicles
making the movement see a green signal aspect when the specified phase(s) is/are
running and red otherwise.
Note that the (node-level) keyword PHASE is used to define phases and the (movement-
level) keyword PHASES associates movements with the defined phases.
At geometrically specified signals, any two-digit phase specifications must specify
contiguous phases. No such restriction is required when coding saturation flows.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > UNITEXTENSION
UN IT EX T EN SION
The minimum gap, in seconds, between successive vehicles moving on a traffic-
actuated approach to a signalized intersection that will cause the signal controller to
terminate the green display.
Intersection Modeling > Signal-controlled intersections > Geometric keywords > VEHICLELENGTH
VEHICLELEN GT H
This keyword defines queued vehicle spacing on the adjacent through lane in meter or
feet depending on the unit setting of the file. It only becomes effective when calculating
the statistics for free right-turn movements. It will default to the Intersection File Setting
(See Data file settings). If not specified in file setting, default to 6 meters. The
Intersection Data Editor only takes values with 2 decimal places. If provided with more
than 2 decimal places, the values will be rounded up with 2 decimal places.
Intersection Modeling > Signal-controlled intersections > Geometric signals example
• Keywords
• Example
Intersection Modeling > Two-way stop-controlled intersections > Overview
Overview
The two-way-stop-controlled (HCM 2000/2010) model offered by Cube Voyager is a
gap-acceptance model calibrated against traffic conditions in USA. Users in other
countries may need to adjust the base critical gap and base follow-up time to reflect local
conditions. The method is designed for steady-state conditions, i.e. the demand and
capacity conditions are constant during the analysis period. The model can be used to
analyze the capacity, delay, queue and LOS of two-way-stop-controlled (TWSC)
intersections. The low flow delay is the inverse of the capacity for TWSC intersections.
The capacity model, which has been implemented in Cube Voyager, is a gap-
acceptance model that has been calibrated against traffic conditions in the USA. Users
in other countries may need to adjust the base critical gap and base follow up time to
reflect local conditions.
If there is a central reservation, or there are islands, between the lanes of the major road,
minor road traffic, which crosses the major road, may do so in two stages. First the
vehicle crosses to the central reservation; then it completes its movement through the
intersection. This situation is enabled when a non-zero value of storage space is coded.
The value is the number of vehicles which can wait in the center of the major road
without obstructing major road flows.
References
Keywords
This section describes the keywords for two-way stop-controlled intersections:
• CRITICALGAP
• FLARESTORAGE
• FOLLOWUPTIME
• FOURLANEMAJOR
• FREEFLOWCAP
• GRADE
• PEDESTRIANFLOW
• PEDESTRIANSPEED
• SINGLELANE
• SIXLANEMAJOR
• STORAGESPACE
• TURNCHANNELIZED
Intersection Modeling > Two-way stop-controlled intersections > Keywords > CRITICALGAP
CRIT ICALGAP
NOTE: Keywords are case insensitive. Capitalizing as CriticalGap might improve readability.
The critical gap, in seconds, is one of the parameters of any gap-acceptance capacity
model. At two-way stop-controlled intersections, it is applicable by movement. It is
defined as the minimum time interval in a higher priority stream that allows intersection
entry for one vehicle. Note that the coded value is the base critical gap. It is modified to
allow for junction geometry.
The default value depends on the movement:
B a s e c ritic a l g a p (s e c o nd s )
Normally this value is allowed to default; only code when there are observations
indicating site-specific driver behavior at the intersection
Intersection Modeling > Two-way stop-controlled intersections > Keywords > FLARESTORAGE
FLAREST ORAGE
The number of vehicles that may queue in the flared region of a minor approach without
disrupting the flowing or queueing of traffic in the main lane.
By default this value is zero, that is, no or negligible flare.
Intersection Modeling > Two-way stop-controlled intersections > Keywords > FOLLOWUPTIME
FOLLOWUPT IME
NOTE: Keywords are case insensitive. Capitalizing as FollowUpTime might improve
readability.
Normally this value is allowed to default; only code when there are observations
indicating site-specific driver behavior at the intersection
Intersection Modeling > Two-way stop-controlled intersections > Keywords > FOURLANEMAJOR
FOURLAN EMAJOR
NOTE: Keywords are case insensitive. Capitalizing as FourLaneMajor might improve
readability.
This logical-valued keyword determines the number of lanes on the major road of a two-
way stop-controlled intersection. If FourLaneMajor = y is coded, then the major road has
two lanes in each direction (total four); otherwise the major road has one lane in each
direction (total 2).
Intersection Modeling > Two-way stop-controlled intersections > Keywords > FREEFLOWCAP
FREEFLOWCAP
NOTE: Keywords are case insensitive. Capitalizing as FreeFlowCap might improve
readability.
This value is only relevant for major approaches where FOURLANEMAJOR is false. It is the
capacity for the unmodelled movements from the arm. By default, these movements
have infinite capacity, which, when combined with the capacity of the modelled turn,
gives strange large capacities in the results. If you code a sensible value (such as 1800
vph), the resulting capacity will be reduced, but there will be a corresponding increase in
delays.
Intersection Modeling > Two-way stop-controlled intersections > Keywords > GRADE
GRADE
The real-valued keyword GRADE describes the grade, expressed as a percentage, of an
approach to a geometrically modeled signals or a two-way stop-controlled intersection. It
is a signed value; negative values indicate that the approach is downhill and positive
values indicate that the approach is uphill.
By default the approach is assumed to be flat (GRADE = 0).
The models have been calibrated for grades the range -6% to +11%, but more extreme
grades do occur. For example the maximum grade in San Francisco is about 31%.
Intersection Modeling > Two-way stop-controlled intersections > Keywords > PEDESTRIANFLOW
SIN GLELAN E
NOTE: Keywords are case insensitive. Capitalizing as SingleLane might improve readability.
At two-way stop-controlled intersections and priority junctions, a minor arm, which does
not have SINGLELANE = Y explicitly coded, has two lanes.
Intersection Modeling > Two-way stop-controlled intersections > Keywords > SIXLANEMAJOR
ST ORAGESPACE
NOTE: Keywords are case insensitive. Capitalizing as StorageSpace might improve
readability.
The turn referred to is the turn which follows the curb (by default, the right turn; when
LEFTDRIVE = T, the left turn). The turn is said to be channelized if there is a triangular,
curbed island separating the turners from the other movements on the approach. The
effect of turn channelization is ensure that the turning flows do not act as conflicting flows
during the calculation of capacities on other legs.
Setting TURNCHANNELIZED to T for an approach indicates that the unopposed turn from
that approach is channelized. By default, no turns are channelized.
Intersection Modeling > Two-way stop-controlled intersections > Example
Example
The example describes a two-way-stop-controlled intersection with two-lane majors,
two-lane minors and a central reservation.
Junction Node = 9 Type = TwoWayStop Approach1 = 8,
FourLaneMajor = y, StorageSpace = 3,
Approach = 6, TurnChannelized = y,
Approach = 7,
Approach = 8,
Approach = 5,
Intersection Modeling > All-way-stop-controlled intersections
All-way-stop-controlled intersections
All-way-stop-controlled intersections are unsignalized intersections with “stop” signs at
every approach.
Cube 6.4 version supports both HCM2000 and HCM 2010 modeling of All-way stop
controlled intersections. This can be set up using the HCM Versio n keyword. The model is
described for different cases based on intersection geometry and the arrival patterns at
the stop line. The model's only variable is the number of lanes for each arm. The model
can be used to analyze the capacity, delay, queue and LOS of all-way-stop-controlled
(AWSC) intersections. The low flow delay is the adjusted saturation headway or the
inverse of the capacity for AWSC intersections.
The capacities reported by models of undersaturated all-way-stop-controlled
intersections can appear very large. However, the model is very nonlinear and, as the
flows are increased, the capacities will decrease.
A ll-wa y -s to p -c o ntro lle d inte rs e c tio n k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple
References
Roundabouts
This section describes roundabouts. Topics include:
• Overview of roundabouts
Overview of roundabouts
Roundabouts are a form of unsignalized intersection in which traffic circulates around a
one-way closed lane to travel from an approach to an exit. Traffic on an approach must
give way to traffic which is already on the circulating section. There are no constraints on
traffic leaving the roundabout.
The circulating flow past an entry is the only flow which influences the capacity of that
entry. The model builder, therefore, can always represent the circulating lane explicitly in
the network, without compromising the modeling of the intersection. Individual
roundabout models are placed at each entry. The approach characteristics of the actual
roundabout entries remain unchanged. One of the circulating legs is exit only and the
other circulating leg should be coded so that vehicles entering the roundabout from that
approach are not significantly constrained. This technique is particularly useful for
modeling roundabouts with five or more legs.
• Empirical model — Each entry is characterized by a capacity slope and a capacity intercept.
The methodology is implemented based on the TRRL report 940.
Both models can be used to analyze the capacity, delay, queue and LOS of roundabout
intersections. The low flow delay is the inverse of the capacity for roundabout
intersections.
You can calculate the slope and intercept outside of Cube Voyager, or you can supply
geometric data and let Cube Voyager calculate the slope and intercept using formulas
calibrated in the UK.
Worldwide experience with roundabouts and roundabout models leads to the following
conclusions:
• When a well calibrated empirical model exists, it should be used in preference to a gap
acceptance model
• However, the calibration of relationships between geometry, on one hand, and slope and
intercept, on the other, requires very large amounts of data
• The number of roundabouts in the US is not yet sufficiently great to allow calibration of a
US empirical model
• Even when general countrywide empirical relationships exist, it may be necessary to fine
tune the slope and intercept for local conditions
The Highway Capacity Manual (HCM 2000) indicates appropriate parameter ranges for
a single-lane roundabout entry in the US.
References
• CAPACITYINTERCEPT
• CAPACITYSLOPE
• CROSSING2ENTRY
• CROSSING2EXIT
• CROSSINGLENGTH
• ENTRYANGLE
• ENTRYRADIUS
• ENTRYWIDTH
• FLARELENGTH
• INSCRIBEDDIAMETER
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > APPROACHWIDTH
APPROACHWIDT H
NOTE: Keywords are case-insensitive. Capitalizing as ApproachWidth might improve
readability.
This real-valued keyword allows the specification of the approach half width (in meters
or feet), one of the geometric parameters for the U.K.-calibrated empirical roundabout
model.
To measure the approach half width, measure from the road center line to the curb at a
point sufficiently far from the roundabout that the curb and center line are parallel. In the
diagram below, the double arrow marked “v” (below the arrow) and “AWID” (to the left of
the arrow) illustrates the measurement.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > CAPACITYINTERCEPT
CAPACIT YSLOPE
NOTE: Keywords are case insensitive. Capitalizing as CapacitySlope might improve
readability.
CROSSIN G2EN T RY
This keyword specifies the position of a zebra crossing on an approach to a roundabout
or a minor approach priority junction. Its value is the number of vehicles that may queue
at the junction without impeding pedestrians who wish to cross. At roundabouts and
single lane minor approaches to priority junctions, a single integer value should be
supplied. However, on two-lane minor approaches to priority junctions, separate values
should be supplied for each of the two lanes.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > CROSSING2EXIT
CROSSIN G2EX IT
This integer-valued keyword specifies the position of a zebra crossing on an exit from a
roundabout or priority junction. Its value is the number of vehicles that may queue at the
crossing without impeding vehicles using other exits from the junction.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > CROSSINGLENGTH
CROSSIN GLEN GT H
This real-valued keyword allows the specification of the length of a zebra crossing that
crosses an approach to a roundabout or priority junction. If it is absent then no crossing
will be modeled.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > ENTRYANGLE
EN T RYAN GLE
NOTE: Keywords are case insensitive. Capitalizing as EntryAngle might improve readability.
This real-valued keyword allows the entry angle, theta, of a roundabout to be coded.
There are three cases for the measurement of phi.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > ENTRYANGLE > Case 1: A roundabout with
straight weaving sections
• Let A be the point where the entry line meets the inside edge of the lane
• Let D be the point on the median island (or line) of the following entry which is nearest to A
• EF is curve which is in the middle of the area of road for vehicles entering the junction
The construction for case 2 is nearly identical to that for case 1. However, the line AD is
replaced by a curve A’D’ which is always parallel to the weaving section.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > ENTRYANGLE > Case 3: A roundabout with
short weaving sections
• JK is constructed in the same way as EF, but for the following exit
EN T RYRADIUS
NOTE: Keywords are case insensitive. Capitalizing as EntryRadius might improve
readability.
This real-valued keyword allows the specification of the entry radius (in meters or feet),
one of the geometric parameters for the U.K.-calibrated empirical roundabout model.
The entry radius is defined as the minimum radius of curvature of the curb line at the
entry.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > ENTRYWIDTH
EN T RYWIDT H
NOTE: Keywords are case insensitive. Capitalizing as EntryWidth might improve readability.
This real-valued keyword allows the specification of the entry width (in meters or feet),
one of the geometric parameters for the U.K.-calibrated empirical roundabout mode.
To measure the entry width:
• Let A be the point where the stop-line meets the inside edge of the lane
• Let B be a point on the curb-line such that the line A-B is normal to the curb at B
In the diagram below, the double arrow marked “C” and “EWID” illustrates the
measurement.
Intersection Modeling > Roundabouts > Empirical roundabouts: Keywords > FLARELENGTH
FLARELEN GT H
NOTE: Keywords are case insensitive. Capitalizing as FlareLength might improve
readability.
This real-valued keyword allows the specification of the modified flare length (in meters
or feet) for the entry to an empirically modelled roundabout. This is measured using the
following procedure:
• Let A be the point where the stop line meets the inside edge of the lane.
• Let B be the point on the curb line such that the line A-B is normal to the curb line at B (A-B
is the entry width, e).
• Let v be the approach width. Let D be a point on A-b such that the length of A-D is v.
• Let D-G be a curve through D and parallel to the inside edge of the lane. (G is the point
where the curve meets the curb).
• Let C-F’ be a curve parallel to the curb which intersects the curve D-G at F’.
IN SCRIBEDDIAMET ER
NOTE: Keywords are case insensitive. Capitalizing as InscribedDiameter might improve
readability.
This real-valued keyword allows the specification of the inscribed circle diameter of the
roundabout (in meters or feet). Usually this is the largest circle that can be inscribed
wholly within the outline of the junction (see figure below). However, when the
intersection is very asymmetrical, a local value in the region of the entry should be taken.
Intersection Modeling > Roundabouts > Empirical roundabouts: Example
After comparing the model results to the performance of the intersection on the ground, it
was decided to recode approach 224 to give the slope and intercept directly:
Junction,
Node = 213,
Type = Roundabout,
Approach1 = 223,
Approach = 223,
CapacitySlope = 0.2,
CapacityIntercept = 3600,
Approach = 224,
EntryWidth = 10.0,
ApproachWidth = 6.0,
FlareLength = 15.0,
InscribedDiameter = 25.0,
Approach = 321,
EntryWidth = 10.0,
ApproachWidth = 6.0,
FlareLength = 15.0,
InscribedDiameter = 25.0,
Intersection Modeling > Roundabouts > Gap acceptance roundabouts: Keywords
• CENTERLANEPERCE
• CIRCULATINGLANE
• CRITICALGAP
• FOLLOWUPTIME
Intersection Modeling > Roundabouts > Gap acceptance roundabouts: Keywords > BYPASSTYPE
BYPASST YPE
This keyword identifies how right-turn lanes yields at roundabout. This depends upon
the existence of exclusive right-turn lanes on the subject link. Below is a screenshot from
HCM 2010 Exhibit 21-8 that explains how this keyword is used. For the new calculators,
the following values are used:
• If RT=1, then B Y P A S S T Y P E is non-yielding. Value=2 in Junction.
CIRCULAT IN GLAN E
CIRCULATINGLANE specifies the number of circulating lanes in the roundabout. This is
identified by comparing the cross street lanes. For each apporach, lanes at legs 2 and 4
(for a 4-link roundabout) or legs 2 and 3 (for a 3-link roundabout) will be obtained and
the maxt of the values will be used. By default, Cube Junction model will keep teh
default value as 1 unless specified by user.
Intersection Modeling > Roundabouts > Gap acceptance roundabouts: Keywords > CRITICALGAP
CRIT ICALGAP
Keywords are case-insensitive but the recommended capitalization CriticalGap may
improve readability.
The critical gap, in seconds, is one of the parameters of any gap-acceptance capacity
model. At roundabouts, it is applicable by arm. It is defined as the minimum time interval
in the circulating stream that allows intersection entry for one vehicle.
The U.S. Highway Capacity Manual 2000 suggests that, for a single-lane roundabout
entry in the US, the critical gap should be in the range 4.1 to 4.6 seconds.
Intersection Modeling > Roundabouts > Gap acceptance roundabouts: Keywords > FOLLOWUPTIME
FOLLOWUPT IME
NOTE: Keywords are case insensitive. Capitalizing as FollowUpTime might improve
readability.
Priority junctions
This section describes priority junctions (two-way yield-controlled intersections). Topics
include:
• Overview of priority junctions
• Keywords
• Kimber, R. M., Mcdonald, M., Hounsell, N. B. (1986). The prediction of saturation flows for
single road junctions controlled by traffic signals. Transport and Road Research
Laboratory Report RR 67.
Keywords
This section describes keywords for priority junctions:
• GEOMETRIC
• SINGLELANE
Intersection Modeling > Priority junctions > Keywords > GEOMETRIC
GEOMET RIC
The keyword “ Geometric=y”, invokes modeling of layout geometry at a priority junction.
The default, “ GapAcceptance =n”, at a priority junction is for the user to supply saturation
flows directly.
Intersection Modeling > Priority junctions > Keywords > SINGLELANE
SIN GLELAN E
NOTE: Keywords are case insensitive. Capitalizing as SingleLane might improve readability.
At two-way stop-controlled intersections and priority junctions, a minor arm, which does
not have SINGLELANE = Y explicitly coded, has two lanes.
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords
• CROSSING2ENTRY
• CROSSING2EXIT
• CROSSINGLENGTH
• FREEFLOWCAP
• MAJORROADWIDTH
• VISIBILITY
• WIDTH
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords > CENTRALRESERVATIONWIDTH
CROSSIN G2EN T RY
This keyword specifies the position of a zebra crossing on an approach to a roundabout
or a minor approach priority junction. Its value is the number of vehicles that may queue
at the junction without impeding pedestrians who wish to cross. At roundabouts and
single lane minor approaches to priority junctions, a single integer value should be
supplied. However, on two-lane minor approaches to priority junctions, separate values
should be supplied for each of the two lanes.
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords > CROSSING2EXIT
CROSSIN G2EX IT
This integer-valued keyword specifies the position of a zebra crossing on an exit from a
roundabout or priority junction. Its value is the number of vehicles that may queue at the
crossing without impeding vehicles using other exits from the junction.
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords > CROSSINGLENGTH
CROSSIN GLEN GT H
This real-valued keyword allows the specification of the length of a zebra crossing that
crosses an approach to a roundabout or priority junction. If it is absent then no crossing
will be modeled.
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords > FREEFLOWCAP
FREEFLOWCAP
NOTE: Keywords are case insensitive. Capitalizing as FreeFlowCap might improve
readability.
By default, the unmodelled movements from the major approaches of a priority junction
have infinite capacity. However, this may result in too large a capacity for the approach
as a whole when it must share a lane with a modelled turn. You can supply a capacity
for these movements by coding FreeFlowCap=value and SingleLane=t.
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords > MAJORROADWIDTH
MAJORROADWIDT H
NOTE: Keywords are case insensitive. Capitalizing as MajorRoadWidth might improve
readability.
VISIBILIT Y
This real-valued keyword allows the visibilities, in meters or feet, at a geometrically
coded priority junction (two-way yield-controlled intersection) to be entered.
Visibilities may be coded for the minor road left and right movements and for the
opposed movement from the major road. Minor road visibilities should be measured from
a point ten meters before the give-way line and 1.05 meters above the road surface. The
major road visibility is measured from the mid-point of the turning lane (again at height
1.05m), along the major road, towards the road center line.
Intersection Modeling > Priority junctions > Geometric priority junctions: Keywords > WIDTH
WIDT H
This real-valued keyword is used to specify the lane widths (in meters or feet) for a
minor road at a priority junction (two-way yield-controlled intersection).
Code widths for left and right movements on minor roads and for the opposed
movement from the major road. The width for the major road’s opposed movement is the
width of the lane from which vehicles on the major road turn. Coding techniques for
minor roads vary with the number of lanes.
To describe a two-lane minor road:
• Do not code SINGLELANE = T.
• Code the width of the single lane in the left movement, or the right movement, but not both.
The coded widths should be the lane’s average width during the final 25 meters of the
approach before the give-way line.
Intersection Modeling > Priority junctions > Geometric priority junctions: Example
• CANSHARERIGHT
• EXCLUSIVELANES
• SATFLOWPERLANE
Intersection Modeling > Priority junctions > Saturation-flow priority junctions: Keywords > CANSHARELEFT
CAN SHARELEFT
NOTE: Keywords are case insensitive. Capitalizing as CanShareLeft might improve
readability.
This keyword specifies that there is a shared lane to the left of the exclusive lanes for
this movement (that is, the movement can share with the movement to its left). Note that
this keyword does not mean “can share with left turners” unless either the movement is
THROUGH or the movement is on the minor leg of a three-arm junction.
If a movement has CANSHARELEFT = T coded then there must be a movement to this
movement’s left and the movement to this movement’s left must have CANSHARERIGHT = T
coded.
If SINGLELANE = T then CANSHARELEFT should not be coded.
Intersection Modeling > Priority junctions > Saturation-flow priority junctions: Keywords > CANSHARERIGHT
CAN SHARERIGHT
NOTE: Keywords are case insensitive. Capitalizing as CanShareRight might improve
readability.
This keyword specifies that there is a shared lane to the right of the exclusive lanes for
this movement (that is, the movement can share with the movement to its right). Note
that this keyword does not mean “can share with right turners” unless either the
movement is THROUGH or the movement is on the minor leg of a three arm junction.
If a movement has CANSHARERIGHT = T coded, then there must be a movement to this
movement’s right, and the movement to this movement’s right must have CANSHARELEFT =
T coded.
EX CLUSIVELAN ES
NOTE: Keywords are case insensitive. Capitalizing as ExclusiveLanes might improve
readability.
This integer-valued keyword gives the number of lanes, on the specified approach,
which are reserved for the exclusive use of vehicles making the specified movement.
If SingleLane = t then ExclusiveLanes should not be coded.
Intersection Modeling > Priority junctions > Saturation-flow priority junctions: Keywords > SATFLOWPERLANE
SAT FLOWPERLAN E
NOTE: Keywords are case insensitive. Capitalizing as SatFlowPerLane might improve
readability.
This real-valued keyword allows the specification of saturation flows in pcu (vehicles)
per hour per lane.
Saturation flows at signals are the flows that would be observed if the movement had a
continuous green all other movements had no flow and no green.
Saturation flow at a priority junction (two-way yield-controlled intersection) is defined
similarly, except that no signal aspects are involved.
Intersection Modeling > Priority junctions > Saturation-flow priority junctions: Example
Upon detecting a Tranplan network as input, the program immediately writes it in Cube
Voyager format to a temporary file, and then uses that file in place of the original file for
subsequent processing. (Note: Cube Voyager treats a FSUTMS network as a standard
Tranplan network. No auxiliary files will be open. Only Cube deals with FSUTMS
networks differently.)
If you specify an output network, the program writes a file in a proprietary (Cube Voyager
or MINUTP) binary format. It is a network database that contains speed/capacity
information, node records, and link records. In MINUTP networks, the node information
consists solely of coordinates for each node. In a Cube Voyager or TP+ network, there
may be any number of items for nodes. Optionally, a file of link records and/or a file of
node records may be written in either ASCII or DBF format. Beginning with version 5.0,
output networks may be a Cube Voyager custom network feature class, stored in an
ESRI custom geodatabase. See the description for the FORM AT subkeywords under
NETO keyword for the FILEO statement on page 445 for information on specifying output
networks to a Cube Voyager custom feature class network in a geodatabase file.
Subsequent topics discuss:
• Built-in variables
• Built-in functions
Network Program > Introduction to the Network program > Built-in variables
Built-in variables
V a ria b le D e s c rip tio n
GEOMETRYSOURCE Defines the input file index number that controls the
source of the geometry to be applied to the output
NETO or LINKO file when multiple input networks are
specified.
The Network program may take up to ten input
networks. These ten networks can be any of the
supported binary formats, Cube geodatabase
networks, GIS shapefiles (for GEOMI only), or
combinations of link and node files in ASCII, DBF, or
MDB formats. When specifying an output network to
a Cube geodatabase network or LINKO shape file,
GEOMETRYSOURCE specifies which # from the FILEI
LINKI[#]= or FILEI GEOMI[#]= specifications
provides the geometry to be applied to the output
geodatabase network.
Each input network coming from a geodatabase
network will have a field called GEOMETRYSOURCE.
This field’s value is the index of the input file (3 for
LINKI[3], for example). Other input formats could
also have a field called GEOMETRYSOURCE
defined by the user. The value of the
GEOMETRYSOURCE field in the output network
dictates the source of the link geometry. By default,
the value is taken from the first available value from
all the input networks. So if LINKI[1] is a binary
network without a GEOMETRYSOURCE field and
LINKI[2] is a geodatabase network, the output
GEOMETRYSOURCE field will have a value of 2
(unless there is no record in LINKI[2] for a certain
link). If MERGE RECORD=T, records that are merged
from other LINKIs retain their GEOMETRYSOURCE
value. Therefore, the output network could have a
mix of GEOMETRYSOURCE values.
In addition, you can specifically set the value in a
script based on other attributes in the various input
networks (for example, downtown use LINKI[3], and
other areas use LINKI[2]).
Please refer to GEOMI for additional usage
requirements specific to that keyword and its indices.
Built-in functions
Func tio n D e s c rip tio n
Control statements
This section describes the control words available in the Network program.
ABORT
Aborts the Network program and Cube Voyager. Keywords include:
• MS G
Use ABORT to quit the Network program at with a “fatal” return code. Use this statement if
you can determine from the data that you desire no further processing.
A B OR T k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple
IF (a > 1000) ABORT MSG='Must be the wrong Network'
Network Program > Control statements > ARRAY
ARRAY
Declares user single dimension arrays. Keywords include:
• VAR=size, VAR=size
Use ARRAY to allocate user arrays that are to be used in the process. An array is different
than a variable in that it represents vectored data. Values stored in arrays must be
numeric. Arrays cannot store string values. When an array is referenced, it should
include an index [], and if the index exceeds the size, the program may fatally terminate.
Arrays can be useful for different processes; the most common use may be to store
information for specific zones. ARRAY statements are not dynamic (stack oriented); they
are allocated prior to any stack operations.
A R R A Y v a ria b le
Exam ple
ARRAY abc=100, xyz=100
BREAK
Breaks out of stack processing for current data record.
When a data record is being subjected to the operations in a phase block, and the
operation is BREAK, the remainder of the block operations are bypassed and the next
data record is processed. Most likely, BREAK would be used in conjunction with an IF
statement. However, if BREAK is encountered within a LOOP, stack processing jumps to
the statement after the associated ENDLOOP statement.
Network Program > Control statements > BREAK > Example 1
Exam ple 1
if (a=1-500 || b=1-500) BREAK ; do not process centroid links.
if (a.x > b.x) ; bypass the links that go from right to left
BREAK
endif
Network Program > Control statements > BREAK > Example 2
Exam ple 2
/* this example finds the index where subtotal of ARRAY1 exceeds 1000 */
loop index=1,_zones
_total = _total + array1[index]
if (_total>1000) BREAK
endloop
list=’INDEX =’,index ; BREAK jumps to here
Network Program > Control statements > COMP
COMP
Computes a value for a variable. Functions include:
• S P E E D FOR (la ne s ,s p d c la s s )
Usage is:
Variable = Expression
COMP statements specify that new variables are to be created or that existing variables
are to have new values computed for them. During any phase other than the
SUMMARY, any name that appears on the left side of the equals sign will be placed into
the output network record, unless it is a working variable (begins with an underscore).
There may be more than one variable computed on a statement, but there must be
comma between an expression and the next variable=expression. The statement need
not begin with COMP.
The expression will be solved and the results stored in the named variable. The phase
for which this COMP statement is coded will establish which variables may be included
within the expression, and where the results can be stored. The maximum length of the
name is 15 characters. This limit includes the “_” prefix of temporary variables.
A normal numerical expression is required. If the expression results in a string, the mode
of the target (named) variable will be set to string instead of numeric. A variable’s mode
should be consistent throughout the application. The program tries to detect any
possible changes, or misuse of variable modes, but it might not detect all
inconsistencies. If a variable is misused as to mode, unpredictable results could occur. It
might be prudent to have a standard naming convention for string variables, such as
always beginning with the same letter.
The expression may contain function names with their arguments. To obtain speed
and/or capacity values from the SPDCAP tables, the SPEEDFOR and CAPACITYFOR
functions are utilized. They are coded as:
Example
i = 0
j = a / i, k=j*2+3*i
newb = nodecode(b)
sumab = newb+newa
cdist = sqrt((a.x-b.x)^2 + (a.y-b.y)^2)
_LinkSpeed = SPEEDFOR(Lanes,Facility*10+Area)
Network Program > Control statements > COMPARE
COMPARE
Compares network records. Keywords and sub-keywords include:
• R E COR D
m LIST
m TITLE
COMPARE statements are dynamic and are used to compare the records of either the link
or node portion of two networks. At the end of the phase (NODEMERGE or
LINKMERGE), a summary of the comparison is reported. The LIST parameter controls
the listing of individual differences. To make this statement function properly, the MERGE
RECORD=T statement should be coded.
In addition to a summary report, COMPARE also returns a value indicating the result after
the comparison of each record. The value is stored in a temporary variable:
_COMPARE. The meaning of the returned value is as follows:
V a lue o f
_COMP A R E Me a ning
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple 1
LINKI[1] = current.net
LINKI[2] = future.net
COMPARE RECORD=1-2
The 1=2 column lists the number of records where the records are the same. The 1<2 set
of columns lists the number of records where the values for the listed variables are lower
in file 1 than in file 2, and the 1 > 2 set lists the summary where file 1 values are greater
than file 2, The final AVE column lists the average difference for the variable, using only
records where there is a difference. The Min and Max differences show the range of
differences for the variable.
Network Program > Control statements > COMPARE > Example 2
Exam ple 2
RUN PGM=NETWORK
NETI=NET1.NET, NET2.NET
NETO=NET3.NET
MERGE RECORD=T
PHASE=LINKMERGE
COMPARE RECORD=1-2, LIST=20 ; compare link record 1 with 2
IF (_COMPARE=-2) CMPFLAG=1 ; link in NET1, not in NET2
IF (_COMPARE=-1) CMPFLAG=2 ; link in NET2, not in NET1
IF (_COMPARE>0) CMPFLAG=3 ; link in both but different
ENDRUN
Example 2 illustrates how to use _COMPARE to flag the links in the merged network. The
CMPFLAG attribute can be used in selection expressions in Viper to post the
comparison results.
Network Program > Control statements > CONTINUE
CONTINUE
Immediately jumps to the end of a loop, bypassing all stack statements until the
associated end of loop. If it is within a loop, control passes to the appropriate ENDLOOP
statement. Otherwise (not in a loop), stack processing for the record is terminated.
Network Program > Control statements > CONTINUE > Example
Exam ple
LOOP _L1=1,3
IF (!(condition)) CONTINUE
ENDLOOP
IF (condition) CONTINUE ; no more processing for this data record
LOOP _L2=_K1,_K2,_KINC
LOOP _L3=_L2,_L2+5
IF (condition) CONTINUE ; jump to ENDLOOP for _L3
ENDLOOP
ENDLOOP
Network Program > Control statements > CROSSTAB
CROSSTAB
Cross tabulates variables. Keywords and subkeywords include:
• COL
m RANGE
• COMP
m FORM
• R OW
m RANGE
• VAR
m FORM
Use the CROSSTAB control statement to accumulate a tabular summary from the network.
Use the VAR keyword to specify the variables you want tabulated. Use the ROW keyword
along with the RANGE subkeyword and the COL keyword along with the RANGE
subkeyword to specify the table’s dimensions. If you omit either ROW or COL, the report
collapses into only one column or one row. Although the CROSSTAB statement can
include several instances of the VAR keyword, the statement tabulates all the variables to
the same specifications. Use the COMP keyword to generate additional reports after
network generation using the values from the tabulated variables. For example; if the
statement includes VAR = VehDist, VehTime, then including COMP = VehDist / VehTime
would produce a table of average speeds.
NOTE: The program does not automatically produce totals because your ranges may
overlap. You can produce totals and subtotals with appropriate use of RANGE values.
See below for a description of the process used in placing values in the appropriate
range slots.
CR OS S T A B k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
The ROW RANGE and COL RANGE values are stored as single-precision numbers, and the
actual variable values are computed and stored as double-precision floating-point
numbers. Single precision provides accuracy to about six, or seven, significant digits,
whereas double precision provides accuracy to up to fifteen, or sixteen, digits. Because
computers do arithmetic on a binary basis, numbers which seem to be easily described
in base 10 cannot always be represented exactly in the computer. For example: the
number 0.01 is a definite number in base 10, but it can only be approximated in base 2.
If the program compares a variable to a range limit, it might fail due to this limitation of the
computer. The comparison result may differ, depending upon the floating point
capabilities of the computer.
Another concern is the definition of limits. If RANGE is 1-10, should a value of
0.9999999999 be included in it? If RANGE is 1-10-1, should a value of 10.001 be
included, and which range should the value of 2.0001 fall into? To address all these
concerns, the program is designed to check for RANGE satisfaction based upon an
integer representation of both the RANGE limits and the data.
You can control the level of precision when specifying the RANGE values. The level of
precision is set by the maximum number of decimal places in any of the RANGE values
(low-high-increment). The RANGE values and the ROW and COL variable values are
factored and integerized (rounded) according to the decimal digits. If a single RANGE (no
increment) is used, the program checks the value against the limits as: if the value is
greater than, or equal to, the lower RANGE, and less than, or equal to, the higher value,
the value satisfies the range. If a RANGE with an increment is used, a similar initial check
is made to determine if the value fits within the outer RANGE limits. If the value fits with the
range, the increment index is computed (in integer) as: ((value-lo) / inc) + 1.
Examples may best illustrate this process.
There is a caveat with this process. The maximum integer revised value for either RANGE
or ROW is 2,147,483,647. For this reason, the program may adjust the number of decimal
digits if either RANGE limit would exceed the maximum after revising.
Network Program > Control statements > CROSSTAB > Example
Exam ple
CrossTab VAR=DIST, _CNT,
ROW=VC, RANGE=0.5-1.2-0.1, 0.5-1.2, 1.2-2.5-0.5, 2.5-9999,
COL=LANES, RANGE=1-7-1, 1-3, 4-7, 1-7, 1-100-5,
CrossTab VAR=VMT FORM=6.1c, VAR=VHT, FORM = 6.2c,
ROW=CLASS, RANGE=1-50-1,
COL=LANE, RANGE=1-10,
COMP=sqrt(VMT)+10*(min(1000,VHT)),
COMP=VMT / VHT,
FORM=8.3 ; weird example & ave trip length
Network Program > Control statements > DELETE
DELETE
Deletes data record.
When a data record is being subjected to the operations in a phase block, and the
operation is DELETE, the remainder of the block operations are bypassed, and the record
is removed from the network. Most likely, DELETE would be used in conjunction with an IF
statement.
Network Program > Control statements > DELETE > Example
Exam ple
If (a=2150-2199 || b=2150-2199) DELETE
;remove all links connected to nodes 2150-2199
Network Program > Control statements > EXIT
EXIT
Exits current phase.
Use EXIT to exit the current phase. The remaining input records to the phase will not be
read.
Network Program > Control statements > EXIT > Example
Exam ple
IF (a > 1000) EXIT; no reason to process beyond this link.
Network Program > Control statements > FILEI
FILEI
NOTE: See “FILEI” on page 50 for general information about FILEI and for important
limitations when using Application Manager.
• LIN KI
m COMBINE
m DETAILS
m EXCLUDE
m RENAME
m REV
m SELECT
m START
m STOP
m TRIPSXY
m VAR
• LOOKU P I
• N OD E I — Uses the same subkeywords as LINKI (above), except REV and TRIPSXY
The FILEI statement specifies the input files that contain the network data. You may
designate up to ten NODEI, ten LINKI and ten GEOMI files in a FILEI statement (GEOMI
support GIS inputs; see next page).
Upon recognizing a LINKI file as a binary file, the program automatically assumes a
corresponding NODEI file. To preclude the program from using the node data in the
automatic NODEI file (not recommended), provide a NODEI file with the same index as the
LINKI file. NODEI files that have the same index as a binary-network LINKI file must
precede the LINKI file.
On the other hand, you may list non-binary LINKI and NODEI files in any order. Cube
geodatabase networks have associated link and node stand-alone feature classes. If a
LINKI file is a Cube geodatabase network, the automatic corresponding NODEI file is the
network’s node stand-alone feature class.
Upon reading input files, the program truncates field names longer than 15 characters. If
truncation results in duplicate field names, the program automatically renames fields to
avoid duplicate names.
If you code value limits for a variable (with MIN=, MAX=), the program only checks those
limits during the INPUT phase. If the limits are exceeded, the program rejects the record
as an error and does not process the record. The program does not edit input record
keys before stack processing. You can decide how to handle records with invalid keys.
After stack processing, the program ensures that key values range from 1 to the number
of nodes. If a key is outside this range, the program lists the record as an error. If the
input file contains many extraneous records (invalid data records—possible if coming
from a GIS DBF with extra data), you can check the key (N, A, or B ) and DELETE the
record, or recode the key.
NETWORK also includes the GEOMI keyword to input Shape and Geodatabase
geometry sources. GEOMI has three advantages over using LINKI as geometry source:
1. It eliminates the need to read and merge a GDB network into the final network if it is
needed as a geometry source only.
2. It allows using shape files as geometry source since LINKI does not allow shape files as
input.
3. It will not merge the data fields or data records into the base network because it is not a
LINKI.
FILE I k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
• DBF
• MDB data table
• Cube geodatabase network
• Link stand-alone feature class in a
geodatabase network
• Recognized binary network.
The program will try to detect what type of
file it is. If it cannot identify the file as a DBF,
MDB, Cube geodatabase network, or a
binary network, it will assume ASCII. If it
detects that the file is a MINUTP binary
network, the variables DIST, SPDC, CAPC,
and LANE will automatically be renamed to
DISTANCE, SPDCLASS,CAPCLASS, and
LANES, respectively.
Since most applications will input binary
networks or Cube geodatabase networks,
you can use the keyword NETI as an alias
for LINKI. If the LINKI file and the NODEI file
are DBF or MDB format then at a minimum,
the LINKI file must have a field named A
and a field named B and the NODEI file
must have a field named N. If these fields in
the DBF or MDB do not use this naming
convention, then the RENAME keyword
below can be used to rename the variables
on input.
NOTE: A valid network in Cube
Voyager/TP+ need not have coordinate
variables on the node records. If the
network is to be viewed/edited in Cube then
it must have variables named X and Y on
the node records to hold the coordinate
data.
FILEI NODEI=node.dat,
vars=n,x,y, combine=t, first=x,
last=y
LINKI DETAILS |?| Flag that indicates if you would like to keep
the full iteration results from an input loaded
Tranplan network on the output file and
have the iteration specific attributes
available as li. variables during the run.
LINKI RENAME |SP| Use to rename a variable from the input file.
The format is RENAME=oldname-
newname; both names must be specified.
Names can be swapped on one statement;
to swap names for V1 and V2:
RENAME=V1-temp1,V2-V1,temp1-V2
Exam ple 1
This section contains some examples of FILEI LINKI and FILEI NODEI usage.
LINKI[1]=\demo\demo20.dat exclude=dist,tsin ; file is binary network
NODEI[1]=C:\DEMO\DEMOXY.DAT VAR=N,X,Y ; file is ASCII
NODEI[2]=\demo\demo21.dat,
LINKI[2]=\demo\?07.dat,
var=a,beg=1,len=5,
var=b,beg=6,len=5,
var=dist,beg=14,len=4,
var=rev,beg=35,len=1
LINKI[3]=freeform.fil, VAR=a,b,name,21,5,,,1,section,0,5
;section follows name in free form
nodei[4]=c:\citya\nets\linka.dbf, linki[4] = c:\citya\nets\nodea.dbf
LINKI[8]=Mixed_Node_and_Link.lxy, var=a,b,distance,
start=(substr(record,1,2)=='LD'),
stop=(substr(record,1,2)=='XY')
NODEI[8]=Mixed_Node_and_Link.lxy, var=n,x,y,
start=(substr(record,1,2)=='XY'),
stop=(substr(record,1,2)=='LD')
Network Program > Control statements > FILEI > Example 2
Exam ple 2
This example specifies a shapefile Geometry source, then link and node shape outputs
matching that geometry. The associated DBF file will be from the LINKO/NODEO
process. Note that the GEOMI index is 1, even with LINKI[1] specified. The GEOMI data
will be used as the geometry source.
RUN PGM=NETWORK
FILEI LINKI[1]="2005HWYLOAD.NET"
FILEI GEOMI[1]="SHAPES\LINK3.SHP"
FILEO LINKO="SHAPES\LINK4.SHP" FORMAT=SHP INCLUDE=A,B,DISTANCE,CAPACITY,SPEED,TIME
FILEO NODEO="SHAPES\NODE4.SHP" FORMAT=SHP
phase=linkmerge
GEOMETRYSOURCE=1
ENDRUN
Network Program > Control statements > FILEO
FILEO
Generates output files—a network file, link file, and node file. Keywords and subkeywords
include:
• LIN KO
m DELIMITER
m EXCLUDE
m FORM
m FORMAT
m INCLUDE
m VARFORM
• NET O
m EXCLUDE
m FORMAT
m INCLUDE
m LEFTDRIVE
• N OD E O
m Uses the same subkeywords as LINKO (above).
• P R IN T O
m APPEND
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
LINKO FORM |S| Sets the print format of all variables written
to the file. Usually specified as w.d to
indicate the maximum field width and
number of decimal places to preserve.
See “Defining a numeric print format” on
page 74 and “Defining a character print
format” on page 76. Optional format codes
are usually not appropriate for use on this
statement.
LINKO FORMAT |S| Sets the file format of the LINKO file.
Possible values are:
• TXT — File of ASCII records in which
all the data fields are written in a
fixed format
• SDF — File of ASCII records in which
the data fields are written in variable
length, and separated by a delimiter
• CS1 — File of comma separated
values with one header row. The
header row contains comma
separated field names.
• CS2 — File of comma separated
values with two header rows. The
first header row contains two comma
separated values [number of fields
and number of records] and the
second header row contains
comma separated field names.
• DBF — Industry-standard database
file
If there is a ? in the name, and there is
no filename extension to the LINKO
value, an extension of this value will
be appended to the filename. If a DBF
is written, and a designated FORM
does not provide adequate width and
decimal space for a field value, the
program will try to adjust the field form
within typical database rules to fit the
value into the field space.
• SHP — Industry-standard shapefile.
The file extension must be .shp.
NETWORK will write the shape file
with geometry from the geometry
source(s) but the associated DBF file
will be from the LINKO process. This
will allow using the INCLUDE and
EXCLUDE keywords to limit the fields
written to the shape file DBF.
When an associated node shapefile
is specified using LINKO NODEO
FORMAT=SHP, it must reside in the
same folder as the link shapefile.
Otherwise, both files will be
consolidated to the LINKO folder.
For more on usage with the SHP
FORMAT, see Example 2.
NETO FORMAT |S| Specifies the file format for writing the
output network. Normally, this is not
specified; the program will write the file as
a standard Cube Voyager binary network.
If the NETO keyword specifies an
MDB/element name, the program writes
the output as a Cube geodatabase
network in the MDB file under the element
name. The program also creates two
stand-alone feature classes in the MDB
file, element_Node and element_Link, and a
table, element_SPDCAP, that contains the
indices and values from the internal
speed and capacity table. The output
Cube geodatabase network will contain
the additional link and node attribute,
GEOMETRYSOURCE, which contains the
input file number from which the geometry
will be applied (for more information on
GEOMETRYSOURCE see “Built-in
variables” on page 417).
Specify FORMAT=MINUTP to write a
MINUTP network. MINUTP string
variables are truncated to 80 characters.
Specify FORMAT=TRIPS
TRIPSXY=fname to write a TRIPS
network and its associated XY file.
The program produces output files by combining data from the input files. Use the
MERGE statement to specify how to process duplicate records. Unless you specifically
exclude fields with the EXCLUDE subkeyword, the output files will contain the fields from
all the input files, even if you do not merge the files and the output file contains no data
from a particular input file.
When writing output files, the program generates an output network first even if NETO is
not specified. The program derives both LINKO and NODEO from the output network; the
link and node files are subsets of the output network. Consequently, if you specify NETO
and exclude a link variable, then that link variable will not be available for LINKO.
Network Program > Control statements > FILEO > Example 1
Exam ple 1
FILEO NETO=MY.NET
NETO=DEMOMINU.DAT, FORMAT=MINUTP, EXCLUDE=TEMP1, TEMP2
NODEO=TEXTNODE FORMAT=TXT, FORM=8.0 INCLUDE=A,B,DIST,SPEED,SPDCAP(2)
LINKO=LINK FORMAT=DBF VARFORM=VC(6.3)
Network Program > Control statements > FILEO > Example 2
Exam ple 2
This example specifies a shapefile Geometry source, then link and node shape outputs
matching that geometry. The associated DBF file will be from the LINKO/NODEO
process.
RUN PGM=NETWORK
FILEI LINKI[1]="2005HWYLOAD.NET"
FILEI GEOMI[2]="SHAPES\LINK3.SHP"
FILEO LINKO="SHAPES\LINK4.SHP" FORMAT=SHP INCLUDE=A,B,DISTANCE,CAPACITY,SPEED,TIME
FILEO NODEO="SHAPES\NODE4.SHP" FORMAT=SHP
phase=linkmerge
GEOMETRYSOURCE=2
ENDRUN
Network Program > Control statements > IF ... ELSEIF ... ELSE ... ENDIF
Exam ple
PHASE=INPUT, FILE=NI.1
IF (N==5)
.
ELSEIF (N=1,3, 8-42 && X<3000 || Y=1-500,800-900)
.
ELSE
.
ENDIF
ENDPROCESS
IF (I < (K*3/6 +J) ) DELETE
Network Program > Control statements > LOOP ... ENDLOOP
where:
• LVAR is the name of the loop control variable. LVAR is not protected during the loop;
computational, program, and other LOOP statements can alter its value. LVAR must be
followed by Lbeg, and optionally, by Lend and Linc.
• Lend is a numeric expression that is computed and stored when the LOOP statement is first
processed. LVAR is incremented by Linc, and compared with Lend when the ENDLOOP
statement is processed. If Lend is not specified, it is assumed no comparison is to be made
(rather meaningless loop).
• Linc is a numeric expression that is computed and stored when the LOOP statement is first
processed. The value is added to LVAR before the ENDLOOP comparison is made. If Linc is
not specified, it will be set to 1 (-1 if Lbeg and Lend are both constants and Lbeg < Lend; a
backwards loop).
• At ENDLOOP:
m
If Lend not specified, jump to next statement.
m
Add Linc to LVAR.
m
Compare LVAR to Lend.
m
Either jump back to statement following associated LOOP, or drop through.
The Lend and Linc variables are processed somewhat differently than in the other
programs; they are computed at the LOOP statement and can not be modified by other
statements. This helps to protect against possible endless loops. The loop will be
processed at least one time regardless of Lend and Linc values. Most uses will involve
constants. Because LVAR values can be expressions, Lbeg, Lend, and Linc must be
separated by commas (standard white-space delimiting cannot be interpreted properly).
If an expression is used, it is suggested that it be enclosed in either parentheses or
quote marks.
Network Program > Control statements > LOOP ... ENDLOOP > Example
Exam ple
LOOP _pass=1,10 ; perform 10 passes
...
ENDLOOP
LOOP _xyz=_abc*_def,_ghi+_jkl,_mno/_pqr
LOOP _abc=_xyz,_xyz+2,2 ; nested LOOP
...
ENDLOOP
ENDLOOP
MERGE
Specifies record and variable merging. Keywords include:
• R E COR D
• AVE
• A V E X0
• CN T
• FIR S T
• LA S T
• MA X
• MIN
• SUM
Use MERGE to specify how to merge records from different files, and how to combine
variables in a merged record. Note that merging records and combining variables are
independent processes.
Use the RECORD keyword to indicate whether to merge data in duplicate records when
encountering identical keys during the NODEMERGE or LINKMERGE phases.
Use the other keywords to specify the method for determining data values for specific
variables when merging data in duplicate records from different input files. (Duplicate
records from the same file may not occur in the MERGE phase.) Each resulting record
will have a cell for every variable specified in any input file or any COMP statement.
ME R GE k e y wo rd — s e le c ting re c o rd s
Ke y wo rd D e s c rip tio n
Use the following keywords to indicate how to obtain the value of variables when
merging records. The program only obtains variable values from file records that contain
the variable. Only list a variable with one keyword; the program uses the FIRST keyword
for variables not listed with any keyword.
ME R GE k e y wo rd s — te c hniq ue
Ke y wo rd D e s c rip tio n
FIRST |SV| Directly from the record from the FILEI with
the lowest index[].
LAST |SV| Directly from the record from the FILEI with
the highest index [].
Exam ple
MERGE RECORD=TRUE FIRST=CAPCLASS,SPDCLASS, LAST=LANES, AVE=DISTANCE,
SUM=COUNT
Illustration for sample input files (-- indicates variable not defined for file):
FILEI LINKI[1]=FILE1,VAR=A,B,DISTANCE,SPDCLASS,CAPCLASS,LANES
FILEI LINKI[2]=FILE2,VAR=A,B,COUNT
FILEI LINKI[3]=FILE3,VAR=A,B,DISTANCE,LANES
PARAMETERS
Specifies basic parameter values. Keywords include:
• LE FT D R IV E
• LIS T _E R R S
• MA X_IP _E R R S
• N OD E S
• R E P L_D U P
• S H A P E A N GLE
• S OR T A N GLE
• ZON E S
P A R A ME T E R S k e y wo rd s
Ke y wo rd D e s c rip tio n
All the values on this statement are trigger keys; the PARAMETERS control word need not
be specified. Each keyword could begin a new statement.
Network Program > Control statements > PARAMETERS > Example
Exam ple
PARAMETERS repl_dup=n
MAX_IP_ERRS=10
nodes=35000 zones=2203
Network Program > Control statements > PLOT
PLOT
Selects links/nodes for plotting.
• DRAW A
• D R A W LIN K
• LIN KP OS T
• N OD E P OS T
PLOT statements in the LINKMERGE phase control plotting. After the program completes
the LINKMERGE stack for a link, it processes the final values for the PLOT keywords that
may have been applied to the link. If there are no DRAWLINK values present, the link is
not processed for plotting. If there are DRAWA and/or NODEPOST values, they are saved
until all the links from the current A-node are completed. When the A-node is completed,
the node values are saved for post processing, so that node symbols will be prominent
on the display.
If there is a LINKPOST value, but there is no DRAWLINK value, the LINKPOST value is
ignored. The situation for nodes is different; a node can be posted without a symbol.
A PLOT statement may be specified on a short IF statement, but it must begin with one of
the keywords.
P LOT k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
PLOTTER
Specifies plotting parameters
• B A N D W ID T H
m FILL
m TAPER
• D E V ICE
• FILE
• FOOT E R
m ALIGN
m FONT
• HEADER
m ALIGN
m FONT
• LE GE N D
m FONT
m LINE
m SYMBOL
• LIN KOFFS E T
• MA P S CA LE
• MA P W IN D OW
• MA R GIN S
• P LA T E S IZE
• P OS T LIN KV A R
m FONT
m POST
• P OS T N OD E V A R
m FONT
The PLOTTER statement specifies the configuration for plotting link and/or node
information. See “Plotting” on page 492 for some information about getting your printer
device installed and its basic configuration established. The printer driver properties are
established by left-clicking the desired printer and then modifying the properties as
desired. The orientation (portrait or landscape) determines how the plot will be
generated, and the size determines the plate size of the drawing.
P LOT T E R k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
BANDWIDTH TAPER |I| Specifies that the ends of the bands are
to be tapered towards the nodes rather
than being perpendicular to the link. In
grid plots where Fill is not used, a taper
of 45 might be more presentable. Any
integer value from 0 to 45 (degrees)
may be specified.
• BottomRight
NOTE: The four positions can also be
designated as TL, TR, BL, and BR, or 1,
2, 3, and 4. See “Examples and FAQ” on
page 496.
The legends are placed within the plot
window area, and their areas are not
written into by network drawing. The
coding rules are similar to those for
HEADER and FOOTER, but you can also
enter symbols on each line. Legends
are primarily for identifying the
characteristics of the network drawing.
Each LEGEND may have its own font
characteristics; they will be used for the
text for all lines in the legend. Each LINE
can have its own symbol.
Fo nt specificatio ns
You can control all text that is to be printed on the plot. In general, you can specify the
name of the font, the size, and the color. The font name must be recognized (and
available), or the printer driver will substitute a font of its choosing. If no font is specified,
the program will supply the name “ARIAL.” The size is always specified as absolute, in
inches; changing to a different size printer will not alter the size the text. If no size is
specified, the program will supply a value of 0.01. The color can be specified in various
ways: by a standard name, or a numeric value to index color mix. Colors are processed
in Windows by using a number that is a combination of the three colors (red green and
blue). You can create the internal number by specifying an integer number (not too
likely), a hexadecimal value (very common process), or by a string of digits preceded by
a color indicator. Three bytes are used to store the intensity of each of the colors; the
values can range from 0 to 255. To use the mixing string, the string must begin with one
of the letters (RGB) followed by a number in the range of 0-255, and more color strings, if
desired. The order of the strings is irrelevant. To enter the hexadecimal value, the string
must begin with 0x and be followed by a string of hexadecimal values (0-f). The table
below indicates the standard colors and their various representations. If there is no color
for the font, a color will be chosen by the printer driver. For pen plotters, the driver will
translate the color number to a pen number. The pen color correlation is determined by
the properties of the driver. You may have to experiment to obtain which pen is selected
for each color used.
black 0 0x000000 --
none -1 -- --
Network Program > Control statements > PLOTTER > Example
Exam ple
PRINT
Formats and prints a line of information. Please see “PRINT” on page 69 for more
details.
Network Program > Control statements > PRINT > Example
Exam ple
PRINT LIST=A(4),B(5),DISTANCE(6.2) ABCDE(6.3), FORM=LRCD,
LIST=SPEED, TIME1 ;Note: this line is a continuation
LIST= N(5), X, Y
PRINT FORM=6.0CDLR LIST=A,B,DISTANCE, T0, SPDCLASS FILE=PRINTFIL.002
Network Program > Control statements > PROCESS ... ENDPROCESS
P R OCE S S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Normally, a PROCESS statement contains only the above keywords and values, and the
operations to be performed on the designated file during the phase follow on additional
control statements. The ENDPROCESS statement can alternatively be specified as
ENDPHASE; that is more consistent if the PROCESS control is triggered by PHASE=.
Exam ple 1
; Re-code node numbers for LINKI[1] and NODEI[1] using a
; lookup function. The 2nd PROCESS statement also acts as
; an ENDPROCESS statement, but an ENDPROCESS is required
; after the 2nd PROCESS.
PHASE=INPUT FILEI=NI.1
N = NODECODE(N);
PHASE=INPUT FILEI=LI.1;
A = NODECODE(A), B = NODECODE(B)
ENDPROCESS
Network Program > Control statements > PROCESS ... ENDPROCESS > Example 2
Exam ple 2
PHASE=LINKMERGE
IF (LI.1.DIST != LI.2.DIST) LIST='Distances Differ for link:',
LIST=A(5) B(6), FORM=6.2, LI.1.DIST, LI.2.DIST
ENDPHASE
Network Program > Control statements > REPORT
REPORT
Defines report specifications. Keywords include:
• A LL
• CA P A CIT Y
• D E A D LIN KS
• D U P LICA T E S
• FILE I
• FILE O
• IN P U T
• ME R GE
• SPEED
• U N CON N E CT E D
REP
R E P OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
REPORT FILEI=Y, FILEO=Y; normally not specified.
REPORT SPEED=Y, UNCONNECTED=N
REPORT ALL=true, fileo=false, filei=false
Network Program > Control statements > SORT
SORT
Sorts user-defined arrays. Keywords include:
• ARRAY
• N U MR E CS
See “SORT” on page 81 for more information about this standard Cube Voyager
statement.
Network Program > Control statements > SORT > Example
Exam ple
ARRAY AN=LINKS, BN=LINKS, VMT=LINKS ; NETI must be a binary network
PHASE=LINKMERGE
_L = _L + 1
AN[_L] = A
BN[_L] = B
VMT[_L] = V_1 * DISTANCE
ENDPHASE
/* note:
The User has to keep count of the records entered into the arrays
If links are deleted, the number of entries will be less than the
original number of links.
*/
PHASE=SUMMARY
SORT ARRAY=-VMT, AN,BN, NUMRECS=_L
LOOP _K=1,30 ; only want to see the highest 30
LIST=AN[_K](6),BN[_K](6),VMT[_K](10.2c)
ENDLOOP
ENDPHASE
Network Program > Control statements > SPDCAP
SPDCAP
Revises speed and capacity tables. Keywords include:
• CA P A CIT Y
• LA N E S
• SPEED
S P D CA P k e y wo rd s
Ke y wo rd D e s c rip tio n
CAPACITY |RV*99| Capacity in vehicles per lane per hour. Actual link
capacity is obtained by multiplying the link capacity
based upon its capacity classification (CAPCLASS)
value by the number of LANES. All values must be 0-
9999, inclusive. The capacity array is initialized to 20
times the index number, for all lane stratification
(CAPACITY[1]=20, CAPACITY[2]=40...).
A network contains an array of capacity and speed data. Each array is dimensioned with
ninety-nine values for each of nine lane stratification, and contains 891 values. When an
array is accessed, the program uses the number of lanes (LANES) as the row index, and
the capacity and/or speed classification (CAPCLASS, SPDCLASS) as the column index to
obtain a value for a link. If CAPACITY or SPEED is encountered prior to a LANES keyword on
the statement, LANES will be preset to 1-9. CAPACITY and SPEED are entered as vector
data, and may be indexed to set a specific loading place, and may have null fields to
skip the revision of certain columns. The SPEEDFOR and CAPACITYFOR functions can be
used to obtain values for these tables.
Network Program > Control statements > SPDCAP > Example
Exam ple
;Set entire table to 50,
; then revise the values for 20,21, and 24 for lanes 1,3,8
SPDCAP CAPACITY=99*50, LANES=1,3,8, CAPACITY[20]=300,400,,,700
SPDCAP LANES=2,4-9, SPEED=20.5,30.3,50.6,,,88.2, LANES=5,SPEED[15]=15
SPDCAP SPEED=30, LANES=2-8; Inappropriate; the LANES will not be used.
Network Program > Theory
Theory
This section describes the theory used by the Network program. Topics include:
• Phase descriptions
• Variable referencing
• Output variables
• Plotting
Network Program > Theory > Phase descriptions
Phase descriptions
The program processes the input files in separate phases, which are listed below. For
most applications, the user need not be concerned with process phases; they are used
only when special processing is to be undertaken. In general, the user must code
operational statements within a PROCESS PHASE block defined for each phase. There
may be only one block for each phase, and the order of the blocks in the input is not
crucial. It is suggested that for readability and ease of editing, the phase blocks be
defined in the normal process order. Only statements that specifically apply to the phase
should be coded within the block. However, statements that are not dynamic operations,
but that appear within a phase block will be recognized as such and will be processed
properly. A block should be terminated with an ENDPROCESS statement. If another
PROCESS PHASE statement is encountered before an ENDPROCESS statement, the
previous block is terminated, and the new block is begun.
The basic phases are:
• INPUT phase — Read ASCII, Network, GIS and DBF files, re-code values from any input
files specifically designated.
• LINKMERGE phase — Read all link data and process it (main phase)
IN PUT phase
All ASCII, Network, GIS and DBF files must pass through this phase. The records are
processed and edited for errors and duplication. The user may specify selections and
computations to be applied to each record as it is processed. It is possible to re-code
node numbers in this phase. Binary input files are processed in this phase only if the
user has specifically designated the file through the use of a PROCESS
PHASE=INPUT block. Any file (or file segment) that passes through this phase, is no
longer used in its original format after this phase is completed; but its data are used in
subsequent phases in a revised internal format. The file segment records are sorted in
appropriate order (node or link) before being stored in the revised format.
Network Program > Theory > Phase descriptions > NODEMERGE phase
N ODEMERGE phase
The node based records from all the NODEI files must pass this phase. As in the INPUT
phase, the user may specify computations and/or selections to be applied to each node
record as it is processed. It is not permissible to re-code node numbers in this phase.
The resulting record for each unique node is written to the output network, and saved for
subsequent referencing in the LINKMERGE phase.
NODEMERGE Phase Keywords - network topology.
Ke y wo rd D e s c rip tio n
Ke y wo rd D e s c rip tio n
SUMMARY phase
In this phase, certain post-processing operations can be performed. This is generally
restricted to computations on working variables, usually to obtain averages, etc.
Every record is processed according to the purpose of the current phase. If there are
operations to be performed in the phase, the record is processed against the operation
statements designated by the user. Operation statements are generally expressed in the
standard IF/ELSEIF/ELSE block and COMP statements. These and other operations
available to the user are described in “Control statements” on page 420. In the
NODEMERGE phase, a node record is processed for each unique node from the
NODEI files. If a node is re-coded in the INPUT phase, the re-coded node number is
included. In the LINKMERGE phase, a link record is processed for each unique link
found from the LINKI files. If a link is recoded in the INPUT phase, the recoded link is
included.
Network Program > Theory > Network Topology Functions
• _N I._R _A N GLE [ #] - Get inbound link angle relative to the current leg, in degrees.
• _N O._R _A N GLE [ #] - Get outbound link angle relative to the current leg, in degrees.
• _L.S _A ng le - Get link angle for the current link, at the start of the link.
• _L.E _A ng le - Get link angle for the current link, at the end of the link.
• _A .Co nne c tio ns / _B .Co nne c tio ns - Get number of connecting nodes to A/B. Refer to
_N .Co nne c tio ns .
• _A .Inb o und s / _B .Inb o und s - Get number of inbound links at A/B. Refer to _N .Inb o und s .
• _A .Outb o und s / _B .Outb o und s - Get number of outbound links at A/B. Refer to _N .Outb o und s .
• _A .Curre ntLe g / _B .Curre ntLe g - Get the leg number of the current link at A/B.
• _A I._A ng le [ #] / _B I._A ng le [ #] - Get inbound link angle in degrees, [#] is the leg number at A/B.
Refer to _N I._A ng le [ #] .
• _A I._R _A N GLE [ #] / _B I._R _A N GLE [ #] - Get inbound link angle relative to the current link. Refer to
_N I._R _A ng le [ #] .
A movement number of 0 means the leg being considered is the current leg.
• - Get the movement number of an outbound leg relative to the
_A O._MOV E [ #] / _B O._MOV E [ #]
current leg. The movement number is the direction to which, a leg is departing the current
leg. The direction angles are calculated as relative angles from the current leg. The below
table shows the movement number, the angles for the movement number, the direction
from which the leg is approaching from and the corresponding turn movement.
A movement number of 0 means the leg being considered is the current leg.
Variable referencing
The main logic of the program involves processing variables. A variable name may be
up to 15 characters in length, and may consist of only letters, digits, and the underscore
character. The first character of the name may not be a digit. If the first character of a
name is an underscore (_), the variable is only a local working variable, and will not be
included in the network. Variables are usually classified as either node or link based.
Classification depends upon the process phase in which the variable is referenced. If a
new variable is computed (NEWVAR=...), it will be attached as either a node or link
variable. During any INPUT phases, the variables will be associated with the type of file
being processed. During the NODEMERGE phase, the variables are node based.
During the LINKMERGE phase, variables are link based, but node variables can be
referenced. A node variable is referenced during LINKMERGE as either A.name or
B.name.
If a variable from an input file is to be referenced during NODEMERGE or LINKMERGE,
the associated NODEI or LINKI file number must precede the variable name. For
NODEMERGE the prefix is NI.#., and for LINKMERGE the prefix is LI.#. For example:
LI.3.ABC references the variable ABC from the LINKI[3] file. The program establishes a
buffer for a record from each input file for every record in the phase, and the prefix allows
access to each of those buffers. If there is no input record for the current working record,
the values are all zero. The formal designation for the prefix is LI.#., but the program
allows the following variations:
NOTE: Insome situations, a PRINT LIST variable may not be recognized if it is cross-
referenced. For example: LIST=A,B,A.X,B.X may not be accepted. To be sure, node
based variables to be listed should be set into temporary variables and then listed with
that name. (See “Examples and FAQ” on page 496 for an illustration.)
Network Program > Theory > Variable referencing > Example
Exam ple
_vdiff = L1.vol - L2.vol; get assignment differences
_vcnt = _vcnt + 1
if (_vdiff != 0) _sumsqdiff = _sumsqdiff + _vdiff*_vdiff
.
.
Phase=SUMMARY
if (_vcnt > 1)
RMSV = sqrt(_sumsqdiff / _vcnt); possibly (_vcnt-1)
list = 'RMSV =', RMSV
endif
Phase=LINKMERGE
_ax = a.x ; get the Node variable named X for Node A
_ay = a.y
LIST=a,b,_ax,_ay
EndPhase
Network Program > Theory > Output variables
Output variables
During the merge phases, a work record is generated for each unique record that
appears in all the input files (depending upon the value of the MERGE RECORD keyword).
Each work record will contain all the unique variables that are defined in/for all the input
files and any COMP statements for the phase. The value that is stored for each variable is
controlled by the MERGE control statement. If all the variables are not to be included in
the output network, the variable list can be modified on the FILEO statement.
Network Program > Theory > Plotting
Plotting
The network that is formed during the LINKMERGE phase can be plotted by sending
information to a standard Windows printer device. There must be an appropriate printer
device driver for the media where the network is to be plotted. Typical types of drivers
are available for printers, faxes, raster plotters, and pen plotters. The Network program
uses the Windows driver to perform the actual formatting of the network information.
Many default drivers come with Windows and provide considerable capabilities. This
process provides for current and future flexibility. It is possible to directly fax a network
plot to a facsimile machine. Windows operating systems are geared towards more
recent technology, so pen plotters are being left somewhat behind. They do cause some
problems.
Pen plotter problems: The standard Windows drivers for pen plotters do not seem to
function properly; in particular, they do not always write text at the proper location and
angle. There are third-party software drivers available that correct this problem, but
deficiencies have been reported in these systems, as well. With one driver (WinPlus), if
legends are used, the link posting will be oriented properly, but mis-positioned. This
release of the program does not address these driver deficiencies; perhaps later
versions will internally rectify them. Plotting pens are selected by RGB (RedGreenBlue)
standards, so it becomes the responsibility of the user to ensure that the colors that are
selected correspond with the pens on the plotter. If standard colors are used (red, green,
blue, yellow, etc.), there should be no problems. If esoteric colors are requested, color
correspondence is not guaranteed. If roll size is selected in the device driver, the
program may not be able to properly scale the plot. In those cases, the user must
specify the desired plate size.
It is recommended that if pen plotters are to be used that the WinPlus driver be obtained
and installed as a printer driver and that the PLOTTER statement contains no LEGEND
keywords.
A PLOTTER control statement is used to define the plotting system and the parameters for
performing the plot. PLOT statements processed during LINKMERGE determine what will
be plotted from the network. If there are PLOT statements, but no PLOTTER statement, the
program will fatally terminate; the opposite is not an error. The PLOTTER statement
contains information about:
• The plotting device name, and whether the output is to be sent directly to the plotting
device, or to a file.
• The logical layout of the plot plate on a sheet of the plotter device: the desired size, if
different than the driver provided size, and the margins to place the plate within the driver
provided dimensions.
• The optional network window for selection, and optional scaling.
• The link variables that are to be posted when a link is selected for posting.
• The node variables that are to be posted, when a node is selected for posting.
In general, all text that is to be plotted can have its font, color and size specified by the
user. The default values for each of these are: ARIAL, black, 0.10. All sizes are
specified in inches, so that if a different driver is used, the text would still be readable.
Link posting (writing text along a link) can not be varied by link; if a link is posted, its
posting will contain the same type of information at the same size and font as any other
link that is posted. The user controls the color of link posts; individual variables can not
be colored differently. Node posting (writing text near a node) will always post the same
variables, but the size and color is controlled by PLOT statements.
Before performing a plot, the device driver must be properly installed. This is done by left
clicking the Windows Start button and choosing Printers and Faxes . In the Printers and Faxes
window, click Add a printer and follow standard installation processes. The orientation of
the plot, (portrait, landscape) is set in the device. If a device is not attached directly to the
computer, the driver should have the file option specified, and the PLOTTER DEVICE FILE
value (filename) should be specified. Files are generally processed by copying them
directly to the plotter port.
PLOT statements control actual plotting. If a PLOT statement is processed in
LINKMERGE, the current link is flagged for processing by the plotting process. The
following processes are considered:
P ro c e s s D e s c rip tio n
These values can be specified multiple times for each link; the values that are current at
the end of the link are used for plotting. For node processing, the values that are current
following the last link outbound from a node are used. If the PLOT statement is invoked by
the use of one of these trigger keywords, it may be placed on a short IF statement.
Example: IF (...) DrawLink=red, LinkPost=red.
If a keyword specifies plotting, but then later conditions determine that it should not really
be plotted, the keyword can be nullified by setting its value to -1. Example: NodePost=-1.
Many times a link posting may be too long for the link. You can deal with these situations
by specifying the fourth value for PLOTTER POSTLINKVAR FONT.
Network Program > Examples and FAQ
• Example 3: Dumping link and node records to DBF files excluding select fields
• Transposing matrices
• Generating matrices
Almost any and all of the above processes can be performed in a single application.
There are some restrictions when used as a special function (Fratar, Distribution, and
Generation programs).
The program processes within an overall origin zone loop controlled by the variable
named I. The remainder of this document refers to this loop as the I-loop. The I-loop
begins with I set to one and continues monotonically until the highest zone number is
processed. When the Distribution program calls the Matrix program, I-loops are nested
within iteration loops. (See Chapter 10, “Distribution Program” for details.)
The standard input is comprised of definition, computational, reporting, and flow control
statements (illustrated below). Definition statements are those that define the input and
out files, and are, in most cases, processed outside of the I-loop. Computational
statements are those that cause data to be revised. Flow control statements provide the
capability to iterate through portions and conditionally or unconditionally branch to a
different place, within the I-loop.
When all control statements have been checked for basic syntax, and have been stored
in the control stack, the program builds a list of required variables. The input files are
opened; zonal data files are read and stored, and other housekeeping is performed. If
any input matrices need to be transposed, they are transformed to a single file and made
ready for subsequent retrieval. It then starts the I-loop, reads the matrices for I, and
processes the control stack from the beginning. When the end of the stack is reached,
the program performs some end-of-zone summaries, and writes any matrices
requested. When the I-loop completes (or is terminated), any requested reports are
printed, and the program exits.
All variables are initialized to zero (or blank) before the I-loop, and are thereafter altered
only by computational statements or internal processing. In addition to any variables
explicitly specified by the users, there are certain built-in variables that can be
referenced. The built-in variable are usually protected; the user is not allowed to alter
their values.
Subsequent topics discuss:
• Built-in variables
• Built-in functions
• Transposed matrices
Matrix Program > Using the Matrix program > Introduction to the Matrix program > Built-in variables
Built-in variables
Ma trix p ro g ra m b uilt-in v a ria b le s
Z A copy of I.
Built-in functions
Described in more detail in “COMP” on page 576.
Ma trix p ro g ra m b uilt-in func tio ns
T ransposed matrices
A copy of a transposed input is obtained by referencing a variable with a name of
MI.n.name.T. In Matrix program terminology, a transposed matrix is one that has had its
rows and columns switched. See “COMP” on page 576 for details.
Matrix Program > Using the Matrix program > Control statement types in Matrix program
For more details about control statements, see “Control statements” on page 545.
Matrix Program > Using the Matrix program > Working with intrazonal cells of a matrix
where x indicates the appropriate working matrix number. When such commands are
executed, all elements of the matrix which lie off the diagonal are left unchanged.
Note that it is invalid to use the above forms of calculation with a JLOOP (as JLOOP implies
varying the J, or column, whereas INTRAZONAL or INTRA fixes it to I, or the row index).
Neither can it be used with the INCLUDE or EXCLUDE subkeywords of the M[] statement,
which are used to select destination zones.
Such commands may be used in conjunction with the LOWEST function set an intrazonal
cost based on the cost to the nearest zone(s). As an example:
INTRAZONAL mw[10] = 0
INTRAZONAL mw[10] = LOWEST(10, 1, 0.01, 99999)
sets the intrazonal cost to the cost from the origin to the nearest destination, but ignoring
destinations with costs less than 0.01 or more than 99999. The preceding setting of
MW[10]’s intrazonal cell to zero ensures that any starting value in that cell does not
become the result of the LOWEST function.
The INTRAZONAL or INTRA keywords may be used to access the diagonal element of a
matrix during calculations. This keyword is coded in a similar manner to the j (or column)
position when a matrix is referenced in an arithmetic expression. Examples are:
MW[1] = MW[1][INTRA]
which copies the intrazonal (or diagonal) element of the first working matrix into all
column positions, and:
var1 = MW[10][INTRAZONAL]
which sets a scalar variable var1 to the intrazonal element of working matrix ten, taken
from the current row of the matrix.
Matrix Program > Using the Matrix program > Working with lists of zones
• Working with list of zones using the substitution method — Defines lists in the Pilot program,
then uses the substitution facility to work with them; it is less easy to define the required
lists, but they may be used in a wider range of contexts.
Matrix Program > Using the Matrix program > Working with lists of zones > Working with lists of zones using the INLIST
function
defines the list of zones in the CBD, then adds a parking cost of 10 units into the skim
(or level of service) matrix for destination zones in that area.
The defined list may contain individual zone numbers and / or ranges of zone numbers;
the latter are specified in the form 1-10 with neither space or ',' (comma) between the
start and end values. To ensure that the list is generally acceptable, it should be written
with commas between items. (Although Cube Voyager scripting allows spaces to be
used as delimiters between items of a list, this form is not accepted by the conditional or
IF statement which requires commas, and so use of commas is recommended.)
A further example changes that part of a matrix which corresponds to origins in the
suburbs and destinations in the CBD, dividing these matrix cells by 1.05:
...
suburbs = '100-145,148-191,194-224,227-341'
CBD = '1-12,15-20'
...
RUN PGM = MATRIX
...
if(i = @suburbs@)
jloop
if(j = @CBD@)
mw[1]=mw[1]/1.05
endif
endjloop
endif
...
...
ENDRUN
or even:
The following illustrates the case where the calculation applies to all destination zones
for selected origins:
...
CordonZones = '540-578'
...
RUN PGM = MATRIX
...
if(i = @CordonZones@)mw[5]=mw[5] * 1.27
...
ENDRUN
Matrix Program > Using the Matrix program > Working with logit choice models
• Destination choice
• General notes
Matrix Program > Using the Matrix program > Working with logit choice models > Introduction to choice modeling
Existing choice models that use the CHOICE statement will continue to run as scripted.
However, Citilabs recommends modifying existing models to use the XCHOICE
command statement and take advantage of the improvements in run time. Note that
some of the keywords are different with the XCHOICE command statement. When
converting a logit model that uses CHOICE to use XCHOICE, you must make additional
changes at the keyword level. For more information please refer to “XCHOICE” on
page 565.
Logit choice models have a number of distinct possible outcomes (for example mode of
travel), and the model estimates the probability of choosing each particular outcome.
The alternatives are evaluated using either their costs or their utility values. Costs and
utilities are related. As the utility of an alternative increases the alternative becomes
more attractive, but an increase in cost makes the alternative less attractive. Apart from
sign, the other difference is that a utility directly measures the users benefit, whereas the
cost has to be multiplied by an appropriate coefficient (or scale parameter) before use in
choice models.
The simplest choice model splits total travel demand between two alternatives (or
modes); it is known as the binary choice model. This may be extended by adding further
alternatives, so forming a multinomial model.
In practice when several alternatives exist, the alternatives are not always independent
of each other. To overcome this hierarchic choice models are used which sub-divide the
choice process into a sequence of decisions. Alternatives which are similar are grouped
together to form sub-nests. Typical examples of sub-nests are public transport (which
brings together various transit modes), or car use (which includes through-trip by car
and park-and-ride). These sub-nests are then brought together in the main (or top-level)
choice process. The choice process may be viewed as initially choosing between sub-
nests (representing types of travel), and then choice at the sub-nest level which decides
the mode used.
The simple choice and hierarchic models described above are forms of the “absolute”
logit choice model.
An alternative form is the Incremental model (also known as the Pivot Point model)
which has a different methodology. It uses data for demand (by alternative) in the base
situation together with changes in costs (or utilities) between the base and forecast
scenario, in order to re-allocate the demand between the alternatives in response to
those cost changes.
The destination choice model is an extension to the logit choice concept where the
alternatives are not modes of travel, but destination zones which the traveler chooses
between. It may be combined with mode choice to form complex models, and may be
used in absolute or incremental form.
The section uses a number of examples to illustrate use of the CHOICE command and to
explain the underlying theory. The examples start at the simplest level and increase in
complexity. They are:
• Absolute logit model
• Destination choice
Each model is described in the context of a typical problem, supported with the relevant
theory. Then the method for implementing a solution in the Matrix program is shown,
with example scripts. For some models, alternative strategies or more complex
variations are also illustrated. Finally, any practical issues related to setting up such a
model are discussed.
At the end of the section there are some general notes concerning coding of demand
models.
For a detailed description of the demand modeling function syntax see “XCHOICE” on
page 565.
Matrix Program > Using the Matrix program > Working with logit choice models > Absolute logit model
Intro ductio n
The process begins by calculating the generalized cost of travel between each origin
and destination by either mode. Usually, this cost is a linear combination of the monetary
cost (fare, fuel, etc.) and time (walk, wait, interchange, in-vehicle-time, etc.). There may
also be an additive constant to approximate those elements of the cost that cannot be
readily quantified, for example the convenience of bus services, or the quality of railway
rolling stock. Let’s call the cost of travel by car, Ccar, and by PT, Cpt. Suppose that
there is a total demand, D, that make such a journey in a given period.
For the sake of clarity, subscripts relating to the origin and destination zone have been
omitted.
The Absolute Logit Model states that the probabilities of choosing car, Pcar, and PT,
Ppt, are given by the equations below.
The model also calculates a composite cost (C) that represents the cost of
the combined choice (in this case, car and public transport), where:
Where utilities are used instead of costs, this simple choice model does
not require a distinct scale parameter, as its effects have already been incorporated into
the utility values. Using utilities, the probabilities of choosing car, Pcar, and Ppt, are:
The behavior of the model is determined by a positive constant known as the scale
parameter, called λ in the equations above. The graph below illustrates the model
sensitivity with different values of λ.
If λ=0 the model is completely insensitive to cost, and demand is shared equally
between each of the available choices. Notice that Pcar=½ and Ppt=½ when λ=0.
As λ increases, the sensitivity of the logit model increases, progressively allocating more
demand to the choice with the lower cost. The figure “Logit model sensitivity” on
page 521 shows how the model becomes more responsive to the difference in cost for
λ =0.01, 0.02 and 0.04.
Finally, as λ approaches infinity, the model will allocate all the demand to the alternative
with the lowest cost.
The value of the scale parameter will depend on the nature of the choice, characteristics
of the demand and the units of cost. The examples used here are for illustrative
purposes and should not be adopted as default values.
Lo git m o del sensitivity
This section describes how this example can be implemented using the XCHOICE
command. The fragment of script below will run this model. Variable names have been
chosen to match those used in the preceding equations.
; Absolute logit model
XCHOICE,
; List choices
ALTERNATIVES = car, pt,
; Input total demand
DEMANDMW = 10,
; Input costs
COSTSMW = 3, 4,
; Forecast demand
ODEMANDMW = 15,16,
; Model structure
SPLIT = TOTAL 0.02 car pt,
; Forecast composite cost
SPLITCOMP = 19,
; Working matrices
STARTMW = 30
The XCHOICE command comprises a number of clauses of the form keyword = value(s)
each of which defines some aspect of the logit choice model. These specify what
alternatives may be chosen, the inputs to the calculations, the resulting outputs, and the
structure of the logit choice model.
The block begins with the ALTERNATIVES clause listing of the names of the alternatives. In
this case the choices are car and PT. These names will be used later to define the
model structure.
The model inputs are specified, starting with the total demand which is coded in the
DEMANDMW clause. The specified input may represent a matrix of true demand (in trips),
as shown here using MW[10], or it may be set to 1, in which case the output “demand”
will be the probabilities associated with each alternative. Next, the generalized costs are
specified for car, as matrix MW[3], and PT, as matrix MW[4]. These should be listed in
the same order as the modes in the ALTERNATIVES clause.
Now the output variables are specified. These are forecast demand for each alternative,
again specified in the same order as the ALTERNATIVES clause, so MW[15] will contain
car trips and MW[16] PT trips.
Finally the structure of the choice model is defined. In this example the choice is
between two modes, car and PT, but this may be extended to three or more alternatives.
The SPLIT clause defines the model’s structure in terms of the scale parameter (or
coefficient of generalized costs) and the choices given in the ALTERNATIVES clause. The
word TOTAL indicates that the entire input demand is to be split between the alternatives
listed in this specification. The scale parameter has a value of 0.02 (or λ=0.02 in the
above equations) and the choice is between the car and PT alternatives. In this script,
the scale parameter is given as a numerical value but it is equally valid to use a variable
instead. The forecast composite cost is output as MW[19] with the SPLITCOMP
keyword. Both the forecast demand and composite cost are optional outputs, and either
clause may be omitted from the script.
The calculations performed by the logit choice model require a number of working
matrices (or MWs) to be allocated for the use of the XCHOICE command. The STARTMW
clause specifies a working matrix number which is higher than that of any other working
matrix referenced in the script. Working matrices from the STARTMW value upwards are
used by the XCHOICE command, and should not be used elsewhere in the script. Where
a Matrix program script contains several XCHOICE commands, the same STARTMW value
may be used in all instances.
Matrix Program > Using the Matrix program > Working with logit choice models > Absolute logit model > Matrix script for
utility-based model
This section describes how this example can be implemented using the XCHOICE
command. The fragment of script below will run this model. Variable names match those
used in the preceding equations.
; Absolute logit model
XCHOICE,
; List choices
ALTERNATIVES = car, pt,
; Input total demand
DEMANDMW = 10,
; Input utilities
UTILITIESMW = 5, 6,
; Forecast demand
ODEMANDMW = 15,16,
; Model structure
SPLIT = TOTAL car pt,
; Forecast composite utility
SPLITCOMP = 18,
; Working matrices
STARTMW = 40
The XCHOICE command comprises a number of clauses of the form keyword = value(s),
each of which defines some aspect of the logit choice model. These specify what
alternatives may be chosen, the inputs to the calculations, the resulting outputs, and the
structure of the logit choice model.
The block begins with the ALTERNATIVES clause listing of the names of the alternatives. In
this case the choices are car and PT. These names will be used later to define the
model structure.
The model inputs are specified, starting with the total demand which is coded in the
DEMANDMW clause. The specified input may represent a matrix of true demand (in trips),
as shown here using MW[10], or it may be set to 1, in which case the output “demand”
will be the probabilities associated with each alternative. Next, the utilities for car, as
matrix MW[5], and PT, as matrix MW[6]. These should be listed in the same order as
the modes in the ALTERNATIVES clause.
Now the output variables are specified, as working matrix (MW) numbers. These are
forecast demand for each alternative (MW[15] for car trips and MW[16] for PT, again
specified in the same order as the ALTERNATIVES clause).
Finally the structure of the choice model is defined. In this example the choice is
between two modes, car and PT, but this may be extended to three or more alternatives.
The SPLIT clause defines the model’s structure in terms of the choices given in the
ALTERNATIVES clause; here the choice is between the car and PT alternatives. The word
TOTAL indicates that this split divides the entire input demand between the specified
alternatives. The forecast composite utility is output as MW[18] with the SPLITCOMP
keyword. Both the forecast demand and composite utility are optional outputs, and either
clause may be omitted from the script.
The calculations performed by the logit choice model require a number of working
matrices (or MWs) to be allocated for the use of the XCHOICE command. The STARTMW
clause specifies a working matrix number which is higher than that of any other working
matrix referenced in the script. Working matrices from the STARTMW value upwards are
used by the XCHOICE command, and should not be used elsewhere in the script. Where
a Matrix script contains several XCHOICE commands, the same STARTMW value may be
used in all instances.
Matrix Program > Using the Matrix program > Working with logit choice models > Incremental logit model
Intro ductio n
This example returns to the structure of the absolute choice example, but now forecasts
the change in demand based on the change in cost from a known base situation. This is
known as the incremental form of the logit model. The structure of the model shown
below in Figure 1.
This model is developed, both using costs and utilities below.
Matrix Program > Using the Matrix program > Working with logit choice models > Incremental logit model > Incremental logit
choice model
The model inputs are base demand by mode (Dcar, Dpt), base costs by mode (Ccar,
Cpt) and forecast costs by mode (C’car, C’pt). The change in cost is denoted by DCcar
and DCpt where:
The choice model now takes the form of the equation below where P’
denotes the forecast choice probability and λ is the scale parameter.
So that the forecast demand by mode (D’car, D’pt) is:
Comparing the example code below with the first example (same structure, but an
absolute logit model), one can see that only the model inputs change to construct an
incremental model. The model requires base demand, base costs and forecast costs for
both modes as input. The output composite cost is the incremental change in composite
cost.
; Incremental logit model
XCHOICE,
; List choices
ALTERNATIVES = car, pt,
; Input base demand by mode
BASEDEMANDMW = 10, 11,
; Input base costs by mode
BASECOSTSMW = 20, 21,
; Input forecast costs by mode
COSTSMW = 30, 31,
; Forecast demand
ODEMANDMW = 2,3,
; Model Structure
SPLIT = TOTAL 0.02 car pt,
; Forecast incremental composite cost
SPLITCOMP = 7,
; Working matrices
STARTMW = 40
Matrix Program > Using the Matrix program > Working with logit choice models > Incremental logit model > Alternative script
using cost differences
The XCHOICE command allows cost changes to be given instead of base and forecast
costs. This variant is particularly useful when the costs do not change for all modes. For
example, suppose that the car cost is constant and that a series of tests are to be
conducted for different PT scenarios. In this case, there is no need to calculate the car
cost for each test. Instead, the change in car cost, DCcar, can be set to zero. Where the
cost difference is zero, the numeric value may be specified as the cost difference for the
alternative (rather than needing to construct a matrix of zero values).
The example excludes the calculation of incremental composite costs.
; Incremental logit model (specifying cost differences)
; Specify scale parameter (or cost coefficient)
lambda = 0.02
XCHOICE
; List choices
ALTERNATIVES = car, pt,
; Input base demand by mode
BASEDEMANDMW = 10, 11,
; Input CHANGE in cost (= ForecastCost - BaseCost)
DCOSTSMW = 24, 25,
; Forecast demand
ODEMANDMW = 2,3,
; Model Structure
SPLIT = TOTAL lambda car pt,
; Working matrices
STARTMW = 30
Matrix Program > Using the Matrix program > Working with logit choice models > Incremental logit model > Matrix script for
utility-based models
Comparing the example code below with the first example (same structure, but an
absolute logit model), one can see that only the model inputs change to construct an
incremental model. The model requires base demand, base costs and forecast costs for
both modes as input. The output composite cost is the incremental change in composite
cost.
; Incremental logit model
XCHOICE,
; List choices
ALTERNATIVES = car, pt,
; Input base demand by mode
BASEDEMANDMW = 10, 11,
; Input base costs by mode
BASEUTILSMW = 20, 21,
; Input forecast costs by mode
UTILITIESMW = 30, 31,
; Forecast demand
ODEMANDMW = 2,3,
; Model Structure
SPLIT = TOTAL car pt,
; Forecast incremental composite utilities
SPLITCOMP = 7,
; Working matrices
STARTMW = 50
Matrix Program > Using the Matrix program > Working with logit choice models > Incremental logit model > Alternative script
using differences in utilities
The XCHOICE command allows changes in utility to be given instead of base and
forecast utilities. This variant is particularly useful when the costs do not change for all
modes. For example, suppose that the car cost is constant and that a series of tests are
to be conducted for different PT scenarios. In this case, there is no need to calculate the
car utility for each test. Instead, the change in car utility, DCcar, can be set to zero.
Intro ductio n
The second example splits the PT mode of the first example into two distinct sub-
modes; bus and train. This is an example of a Hierarchical Logit Model, which can be
implemented in Absolute or Incremental form.
Structure o f hierarchical lo git m o del
As before the total demand is specified together with generalized costs for each choice
(car, bus and train).
A scale parameter must be associated each nest. In this example, the scale parameters
are λ=0.02 in the upper nest (consistent with the previous example) and μ=0.03 in the
lower nest. It is a result of the model theory that the value of the parameters must
increase (or at least not decrease) as one moves down the hierarchy. That is to say, the
model’s sensitivity to cost increases down the hierarchy.
M atrix script
The example below shows how the earlier absolute-choice example can be extended to
include the lower nest in the hierarchy:
; Absolute hierarchical logit model
; Specify scale parameters
lambda = 0.02
mu = 0.03
XCHOICE,
; List choices
ALTERNATIVES = car bus train,
; Input demand
DEMANDMW = 1,
; Input costs
COSTSMW = 4, 5, 6,
; Forecast demand
ODEMANDMW = 14,15,16,
; Model Structure
; Top level nest
SPLIT = TOTAL lambda car pt,
; Forecast composite cost top level
SPLITCOMP = 19,
; PT nest
SPLIT = PT mu bus train
; Forecast composite cost PT level
SPLITCOMP = 20,
; Working matrices
STARTMW =70
First the modes (car, bus and train) are declared with the ALTERNATIVES clause. Notice
that PT is not declared as an alternative; this is the name given to the combined choice
of bus and train.
Then the model inputs and outputs are specified. The input total demand and costs for
the three distinct modes are given first, followed by the output forecast demand by mode.
The hierarchical structure is specified by moving down the tree describing each nest.
Beginning at the top of the tree, the first split command divides TOTAL (the total
demand) into car and (all) PT with scale parameter λ=0.02. Notice that a scalar variable
called lambda has been used to represent the scale parameter in this case. PT is not
considered as an individual mode now, but as a link with the lower nest. The SPLITCOMP
keyword computes the composite costs for the nest associated with this SPLIT, in this
case the top level.
The second split command sub-divides PT trips between the bus and train alternatives
using a scale parameter μ=0.03. The name pt is used as the first value in the SPLIT
clause, and this acts as a link to the next level up the tree (where total demand was
divided between car and PT). Another SPLITCOMP keyword for this SPLIT keyword
computes the composite costs specific to the PT nest.
M o re co m plex abso lute hierarchical m o dels
The hierarchy can be extended with additional nests on either side of the tree. For
example, a large absolute hierarchical logit model structure might have six choices: car,
park and ride, bus, heavy rail, light rapid transit (LRT), and metro.
Structure o f a large abso lute hierarchical lo git m o del
This example may be codes as an absolute model as below, with park and ride
abbreviated as pandr, and heavy rail as hrail:
; Extract from a large absolute logit model
XCHOICE,
; List choices
ALTERNATIVES = car pandr bus hrail lrt metro,
; Input demand
DEMANDMW = 1,
; Input costs
COSTSMW = 11, 12, 13, 14, 15, 16,
; Forecast demand
ODEMANDMW = 21,22,23,24,25,26,
; Model Structure
; Top level nest
SPLIT = TOTAL 0.02 allcar allpt,
; All car nest
SPLIT = allcar 0.05 car pandr,
; All PT nest
SPLIT = allpt 0.03 bus train,
; Train nest
SPLIT = train 0.04 hrail lrt metro,
; Working matrices
STARTMW = 45
Matrix Program > Using the Matrix program > Working with logit choice models > Hierarchical logit model > Utility-based
examples of hierarchic logit models
The hierarchic choice model comprises a main choice nests, and a number of sub-
nests. As with cost-based models, there is a requirement that higher level nests are less
sensitive to cost differences than any sub-nests which lie below them.
In the estimation of the utility equations used in the choice model coefficients are
estimated for individual cost-terms (such as travel time, and fare) and for scale
parameters. The scale parameter is a factor which is applied to the composite utility of a
sub-nest before it is used in the choice process of the parent choice nest. To meet the
sensitivity requirements noted above, the scale parameter must be greater than 0, and
must not exceed 1.0.
Thus, the scale parameters of utility-based models are viewed as part of the
specification of the output of a split process, and different values may apply to each sub-
nest in a choice nest. Where the scale parameter for a sub-nest is 1.0 there is no need
to specify its value as this the assumed default. Where a scale parameter applies to two
or more sub-nests, it may be specified once and brackets used to group the relevant
sub-nests, so avoiding repetition of the parameter.
M atrix script illustrating two -level hierarchy
Using the tree structure shown in “Structure of hierarchical logit model” on page 531 as
the basis of an absolute choice model, the total demand is specified together with the
utility of each choice (car, bus and train).
A scale parameter of 0.6 is applied to the PT sub-nest when its composite (or logsum)
utility is used in the calculations of the higher-level nest.
; Absolute hierarchical logit model
XCHOICE,
; List choices
ALTERNATIVES = car bus train,
; Input demand
DEMANDMW = 1,
; Input costs
UTILITIESMW = 4, 5, 6,
; Forecast demand
ODEMANDMW = 14,15,16,
; Model Structure
; Top level nest. PT sub-nest has scale parameter 0.6
SPLIT = TOTAL 1.0 car 0.6 pt,
; Forecast composite cost for the top level
SPLITCOMP = 19,
; PT nest
SPLIT = PT bus train
; Forecast composite cost for the PT nest
SPLITCOMP = 20,
; Working matrices
STARTMW =70
First the modes (car, bus and train) are declared with the ALTERNATIVES clause. Notice
that PT is not declared as an alternative; this is the name given to the combined choice
of bus and train.
Then the model inputs and outputs are specified. The input total demand and utilities for
the three distinct modes are given first, followed by the output forecast demand by mode.
The hierarchical structure is specified by moving down the tree describing each nest.
Beginning at the top of the tree, the first split command divides TOTAL (the total
demand) into car and (all) PT, and specifies a scale parameter of 0.6 which applies to
the PT sub-nest. PT is not considered as an individual mode now, but as a link with the
lower nest. The composite costs for this SPLIT are output with SLITCOMP.
The second split command sub-divides PT trips between the bus and train alternatives,
but no scaling parameters are used. The name pt is used as the first value in the SPLIT
clause, and this acts as a link to the next level up the tree (where total demand was
divided between car and PT). The composite cost for this SLIT are output with another
SPLITCOMP keyword.
M atrix script illustrating the co m plex exam ple
A more complex utility-based example uses the model structure illustrated in “Structure
of a large absolute hierarchical logit model” on page 534. The example below is coded
below in incremental form using utility differences:
; Extract from a large absolute logit model
XCHOICE,
; List choices
ALTERNATIVES = car pandr bus hrail lrt metro,
; Base demand
BASEDEMANDMW = 1, 2, 3, 4, 5, 6,
; Utility differences
DUTILSMW = 11, 12, 13, 14, 15, 16,
; Forecast demand
ODEMANDMW = 21,22,23,24,25,26,
; Model Structure
; Top level nest
SPLIT = TOTAL 0.4 allcar 0.667 allpt,
; All car nest
SPLIT = allcar car pandr,
; All PT nest
SPLIT = allpt 1.0 bus 0.75 train,
; Train nest
SPLIT = train hrail lrt metro,
; Working matrices
STARTMW = 45
In this example a scale parameter of 0.4 is applied to the all-car sub-nest; also 0.667 to
the all-PT sub-nest and 0.75 to the train sub-nest.
Matrix Program > Using the Matrix program > Working with logit choice models > Destination choice
Destination choice
This section describes the destination-choice model. Topics include:
• Introduction
• Matrix script
Matrix Program > Using the Matrix program > Working with logit choice models > Destination choice > Introduction
Intro ductio n
This section shows how a logit model can be used to forecast destination choice.
Suppose that an aggregate demand model has 100 zones. Associated with each origin
zone (denoted i) there is a total demand of Di that is to be distributed between the 100
possible destinations (denoted j) according to the cost of the trip Cij. The figure
“Structure of destination choice model” illustrates the structure, where d1, d2,... denote
the choice of destination 1, destination 2 and so on.
Structure o f destinatio n cho ice m o del
For the absolute choice model, the probability of choosing destination zone j from origin
zone i is given by Pij:
M atrix script
The destination choice model described above is coded in the script below.
;Simple destination choice model
;Specify choice parameter
lambda = 0.01
XCHOICE,
; Alternatives (only one, as doing destination choice)
ALTERNATIVES = all
; Input demand from each origin
DEMAND = TripsFromI[i],
; Input cost matrix
COSTSMW = 3,
; Forecast demand from each origin to each destination
ODEMANDMW = 7
; Model Structure
DESTSPLIT = TOTAL lambda all,
; Working matrices
STARTMW = 20
The extract begins with the specification of alternatives, which comprises just one
alternative as we have no choice between modes. This is followed by the model inputs,
in this case the demand is an array of trips from each zone and the generalized cost is
matrix MW[3]. The outputs are a forecast demand matrix, MW[7].
The structure of this model is defined by the DESTSPLIT clause which defines a
destination choice process. A scale parameter of λ=0.01 has been chosen for this
example. The output from the split clause is the alternative “all,” as listed on the
ALTERNATIVES keyword.
The main differences for utility-based scripts are use of utility keywords (UTILITIESMW
being used in place of COSTSMW), and no use of lambda, the scale parameter, so that the
DESTSPLIT clause now becomes DESTSPLIT = TOTAL all.
Matrix Program > Using the Matrix program > Working with logit choice models > Mode and destination choice
Intro ductio n
Consider this example of mode followed by destination choice. The figure illustrates a
system with two modes, car and PT, and 100 destination zones (labelled d1, d2,...,
d100).
Here the total demand is split first by mode (into two vectors
representing car and PT demand for each origin) then by destination
(giving car and PT matrices).
M atrix script
The script extract below is similar to previous examples shown in “Incremental logit
model” on page 525 and “Destination choice” on page 537.
The model structure specification splits the total demand by mode first with scale
parameter λ=0.01, then across destinations for each mode individually. The parameters
for destination choice are μ=0.02 and θ=0.03 for car and PT respectively.
; Mode choice above destination choice model
; Specify choice parameters
lambda = 0.01
mu = 0.02
theta = 0.03
XCHOICE,
; List choices
ALTERNATIVES = car pt,
; Base Demand
BASEDEMANDMW = 1,2,
; Base Costs
BASECOSTSMW = 11,12,
; Forecast costs
COSTSMW = 21,22,
; Forecast demand matrices by mode
ODEMANDMW = 31,32,
; Model Structure
; Mode choice
SPLIT = TOTAL lambda destcar destpt
; Car destination choice
DESTSPLIT = destcar mu car,
; PT destination choice
DESTSPLIT = destpt theta pt,
; Working matrices
STARTMW=110
Matrix Program > Using the Matrix program > Working with logit choice models > General notes
General notes
This section provides general notes about logit choice models:
• Availability of choices
Within a demand model, it is often useful to make certain choices unavailable. For
example, a rail mode might not be a practical alternative for travel between all zones in
the study area. To make a choice unavailable you should give that choice a large
positive generalized cost (or large negative utility). Large in this context is 100 times
greater than typical costs. For example, if costs are up to 400 generalized minutes, try
using a cost of 40000 minutes to make a particular choice unavailable.
Matrix Program > Using the Matrix program > Working with logit choice models > General notes > Applying choice models to
selected parts of matrices
There are instances when it is desirable to apply choice models to selected parts of a
matrix, rather than the entire matrix. These typically arise when matrices can be broken
down into distinct segments (such as trips entirely within study area, through trips etc.),
and different choice models apply to these different segments. In some instances the
model structure is common to all segments, but the sensitivity (and so cost-coefficient)
varies between segments. Under these conditions, the cost coefficient may be specified
as a matrix (such as MW[5], or mi.1.coefficient) rather than a scalar value. Where the
model structure varies between segments, or the user wishes to apply the choice model
separately for each segment, the following provides guidance on techniques used.
When a XCHOICE control statement occurs in the Matrix program it will typically be
applied to all cells (or origin-destination pairs). The XCHOICE control statement may be
coded inside a conditional test which selects the origin zones it is applied to:
; test to see if model applies to this origin zone
if (i < 45)
; if so, then apply the model
XCHOICE,
; subsequent clauses of XCHOICE statement, as needed
; ...
endif
For simple choices between alternative modes, this may be extended, by use of the
JLOOP command, to select particular rows and columns of the matrix where the choice
model is applied:
;apply the model to trips from zones 1-45 to zones 46-53
if (i < 45)
JLOOP INCLUDE = 46-53
XCHOICE,
; subsequent clauses of XCHOICE statement, as needed
; ...
ENDJLOOP
endif
Where the choice model applies to a segment which is not a regular set of rows and
columns, but is determined by some other matrix attribute (such as distance from origin
to destination), a script may be coded as follows:
;start a JLOOP to process each origin-destination pair in turn
JLOOP
; test to see if O-D meets selection criteria for the segment
if (mi.1.distance > 50)
; if so, then apply the model
XCHOICE,
; subsequent clauses of XCHOICE statement, as needed
; ...
endif
ENDJLOOP
Where a model seeks to use destination choice, this cannot be coded inside a JLOOP
construct. If only selected destinations are valid for the destination choice, then the
INCLUDE or EXCLUDE sub-keyword should be specified immediately after the DESTSPLIT
keyword in order to include or exclude the required zones.
Matrix Program > Using the Matrix program > Working with logit choice models > General notes > Practical considerations:
Incremental models
In an incremental model, if the base demand for a choice is zero, the forecast demand
for that choice will always be zero.
This is made clear if one examines the equation in the “Incremental logit model” on
page 525, where, if Pcar=0 then P’car=0 whatever costs are given. If this effect is a
problem, then the modelling approach should be reviewed.
Matrix Program > Using the Matrix program > Working with logit choice models > General notes > Practical considerations:
Scale parameters
Control statements
The following control words are available in the Matrix program.
Co ntro l
wo rd D e s c rip tio n
ABORT
Programs : Distribution, Fratar, Generation, Matrix
Aborts the entire run. Keywords include:
• MS G
Use ABORT to terminate the program and return a fatal code to Cube Voyager. Though
not normally used, you can use this statement to terminate processing due to some
detectable conditions. For example, suppose that during a mode-split process, the
program detects walk access and drive access between the same zone pair, but you
know that this should not occur. You can create a test to find this and abort if it occurs.
Ke y wo rd D e s c rip tio n
Exam ple
IF (MW[1][I] != 0) ABORT ; Intrazonal present in MW[1]
INTRA = MW[1][I]
IF (! INTRA)
LIST='No intrazonal value for MW[1] at Zone ', I
ABORT
ENDIF
Matrix Program > Control statements > ARRAY
ARRAY
Programs : Distribution, Fratar, Generation, Matrix
Declares user single and multi-dimension arrays. Keywords include:
• A R R A Y N A ME =n (or =n1[,n2[,n3]...]]])
• T YPE= t
Beginning in version 5.1, multi-dimension arrays can be specified. This has caused the
standard ARRAY statement to take on a new format. The previous format for specifying
string arrays (StringArray=arraysize-stringsize) is no longer valid and must be modified
to the new format. The keyword TYPE is used to specify the size and mode of the array
elements for the arrays that follow it. Multi-dimension arrays provide considerably more
capability – the user can specify up to 9 dimensions for a single array. However, multi-
dimension arrays can take up a significant amount of memory so their usage must be
carefully planned. For example, a double precision array of 1000x1000x100 will take up
800 MB of memory.
Use ARRAY to allocate user arrays. An array is different from a variable in that it
represents vectored data. Values stored to arrays in this program can be numeric or
string. When an array is referenced in an expression, it must include all the indices [ ],
and if any index exceeds its corresponding size, the program will fatally terminate.
Arrays can be useful for different processes; a common use may be to store information
for specific zones. ARRAY statements are not dynamic (stack oriented); they are
allocated prior to any stack operations. When a single dimensioned array appears in a
SET statement, all the cells in the array are set to the same value. Multi-dimensioned
arrays can also be specified with the AUTOMDARRAY keyword on the FILEI MATI|DBI
statements, but the use of those arrays is somewhat different.
A R R A Y k e y wo rd s
Ke y wo rd D e s c rip tio n
Additional system variables are available so the properties of an array can be accessed
in the script:
• a rra y na me .ty p e — a string that is the same as in the TYPE keyword
Exam ple
ARRAY sum_mat=10, cbd2ext=500
IF (M <= 10) sum_mat[M] = sum_mat[M] + rowsum(M)
IF (I=1-10,51-58,63,96) cbd2ext[I] = cbd2ext[i] + MW[1] include=501-535
ARRAY row_total=zones
; example of defining a string array
ARRAY TYPE=C5 StrArray=1000; defines a string array with size of 1000 and a
character width of 5.
ARRAY array1=zones,50; Array1 is a double precision (8 byte) array dimensioned
[zones][50]
COMP array1[#1][#2] = expression, #1=1,3,8-10, #2=20-max....
Matrix Program > Control statements > BREAK
BREAK
Programs : Distribution, Fratar, Generation, Matrix
Use BREAK to break out of a loop. When encountered, control immediately passes to the
stack statement after the associated end of loop. If BREAK is within a LOOP or JLOOP
block, control passes to the statement following the associated ENDLOOP (loop variable
remains intact) or ENDJLOOP (J will be reset to 1). Otherwise, stack processing for the I
zone is terminated but output and zonal reporting statistics will not be bypassed.
Matrix Program > Control statements > BREAK > Example
Exam ple
LOOP L1=1,3
IF (condition)
statements
ELSE
BREAK ; jump to IF statement
ENDIF
ENDLOOP
IF (condition) BREAK ; no more processing for this origin zone
LOOP L2=K1,K2,KINC
JLOOP EXCLUDE=25-50,88
IF (condition) BREAK ; jump to LOOP L3=
ENDJLOOP
LOOP L3=L2,L2+5
IF (condition) BREAK; ; jump to ABC=
ENDLOOP
ABC=...
ENDLOOP
Matrix Program > Control statements > BSEARCH
BSEARCH
Program: Matrix
Performs a binary search to find a key or set of keys in a sorted array or series of sorted
arrays. The format is:
BSEARCH ARRAY=value, ARRAY=value, ...
ARRAY |N| is the name of a user array that is in ascending sort. The routine will do a
binary search to expedite the search for the key. If there are multiple arrays specified,
the search will begin at the first array and then proceed through the remaining arrays for
matching keys (at the same record level as the first array). All arrays must be in
ascending sort.
If the array is a string (C) array, any constant value must be placed within quotes. If the
value is an expression, the result of the expression must be a string.
BSEARCH stores results in the variable _BSEARCH. Possible values in _BSEARCH are:
• +n — Indicates an exact match was found at the nth location in the array
• -n — Indicates that no match was found, but the nth location is where one would insert the
key (that is, the nth location is higher than the key, and the n-1 location is lower than the
key).
• 0 — Indicates that the key is greater than the value in the highest location in the array.
Matrix Program > Control statements > BSEARCH > Example
Exam ple
ARRAY MYARRAY=100, YOURARRAY=100
some code to populate the arrays
SORT ARRAY=MYARRAY,YOURARRAY
BSEARCH MYARRAY=32, YOURARRAY=(MYARRAY[j]*3)
Matrix Program > Control statements > BSEARCH > Example
Exam ple
FILEI DBI[1]=MYDBF, AUTOARRAY=FIELD1 SORT=FIELD1
ARRAY MYARRAY=100, YOURARRAY=100
BSEARCH DBA.1.FIELD1='875'
Matrix Program > Control statements > CALL
CALL
Programs : Distribution, Fratar, Generation, Matrix
Executes an external routine. Keywords include:
• D LL
Use CALL to execute an external process. To use this statement, there must be an
external file that is a dynamic link library (DLL), which contains the entry point that is
desired to be used at this location. The DLL file may have multiple entry points, and they
can all be accessed by this run of the Matrix program.
Ke y wo rd D e s c rip tio n
The routine is called with one argument: the address of a structure that contains: I, J,
Zones, Iteration, address of MW, address of a routine to obtain address of any variables,
and address of a routine to print messages. The calling process adheres to standard
“C” notation. The C structure is illustrated in the sample code section below. I, J, Zones,
and Iteration are passed as integers. The addresses of these variables could be found
by using the pfFindVar routine, but because these variables must be protected,
pfFindVar will return NULL if the routine tries to obtain their addresses.
MW is the address of an array of pointers to the individual MW arrays. MW[1] is the
address of the first cell for MW[1]. Note that this is the cell for column 0, NOT column 1.
MW[1][1] would be the correct notation to address the cell for zone 1 in MW[1]. MWs
are allocated individually, rather than as a single block. In Fortran (without pointers), the
access to MW[1][1] would NOT be the typical MW(1,1). Instead, the address of each
MW would have to be obtained individually, and passed through an interface to a
separate routine for actual use of the MW. The routine would probably declare the array
as: DOUBLE PRECISION MW1(0:*).
The MW array can be accessed in several ways:
• — the suggested way if MWs need not be
S a v ing the MW v a lue fro m the p a s s e d s truc ture
allocated, and there are many references to MWs.
• S a v ing the a d d re s s re turne d fro m p fV a rFind (”MW ”...) — the required way if MWs need to be
allocated.
The pfFindVar routine is used to obtain the pointer to any variables that are to be made
available to the external process. All variables (with a few isolated exceptions) are
stored as double precision values. Calls to pfFindVar need to be made only during the
first entry into the procedure; the returned addresses can be stored in static cells so that
pfFfindVar need not be called on every entry. The Matrix program allocates MW arrays
only when it is necessary, so the routine has to make sure that any MWs that it wishes
to use are allocated. This can be done by calling pFfindVar for MW, and appending the
integer numbers of the MWs that the procedure will use. If this is not done, and the
routine accesses an MW that has not been allocated, the routine will access a dummy
array. If the user is sure that all the desired MWs have been previously allocated by the
Matrix program, pfFindVar need not be used at all.
The pfPrnLine function is called, with two arguments, to print a message:
• nCtl — The control word for print the message. It has the format SFEN where,
m
F is a 1 if the message is to be written to the error file
m
E is the level of the message (0,1,2=Message, Warning, Fatal),
m
N is the number of new lines to print before printing the message.
• — The message string (ASCIIZ) to be printed; it may contain any normal printer
sMmessage
characters, including \n, \r,\f,\t etc.
Matrix Program > Control statements > CALL > Example
Exam ple
CALL DLL=user(_User1) ; call the following code in user.dll
// Sample of user function code in C
/*TITLE: User1 -- user function*/
#include <stdio.h>
typedef struct { int I, J, Zones, Iteration;
double** MW;
void* (*pfFindVar)(char*,...);
void* (*pfPrnLine)(int, char*);
} CallStack;
int _export User1 (CallStack* Stack)
{
char message[100];
static double** MW=NULL; /* store the address of MW array */
int m,j;
/*
* At first entry (when MW==NULL),
* establish MW and insure that MW[1-5] have been allocated
*/
if (MW == NULL) {
MW = (*Stack->pfFindVar)("MW",1,2,3,4,5);
/* Example of forming a message */
sprintf(message,"User1 Call I=%i, J=%i, Zones=%i",
Stack->I, Stack->J, Stack->Zones);
/* Example of printing a message */
(*Stack->pfPrnLine)(1,message);
}
/* Sample to fill in MW[1-5] */
for (m=1; m<=5; m++)
for (j=1; j<=Stack->Zones; j++)
MW[m][j] = Stack->I*100 + m*10 + j;
/* Stack->MW[m][j] is a similar way to reference MW[m][j] */
return 0;
}
Matrix Program > Control statements > CHOICE
CHOICE
Program: Matrix
Implements a logit-choice model.
Use the CHOICE command to implement logit-choice models, which can be based either
on generalized costs or utilities. The actual keywords supported depend on whether you
use cost-based or utility-based models:
• CHOICE keywords: Cost-based models
• B A S E COS T S
• B A S E D E MA N D
• COS T S
• D COS T S
• D E MA N D
• D E S T S P LIT
m
COEFF
m INCLUDE
m EXCLUDE
m SPLITINTO
• OCOMP COS T
• OD E MA N D
• S P LIT
m COEFF
m SPLITINTO
• S T A R T MW
CH OICE k e y wo rd s : Co s t-b a s e d mo d e ls
Ke y wo rd S ub k e y wo rd D e s c rip tio n
• B A S E D E MA N D
• B A S E U T ILS
• D E MA N D
• D E S T S P LIT
m INCLUDE
m EXCLUDE
• D U T ILS
• OCOMP U T IL
• OD E MA N D
• S P LIT
• S T A R T MW
• U T ILIT IE S
CH OICE k e y wo rd s : U tility -b a s e d mo d e ls
Ke y wo rd S ub k e y wo rd D e s c rip tio n
XCHOICE
Program: Matrix
XCHOICE implements a logit choice model. XCHOICE replaces the CHOICE command
statement, resulting in improved run times. Though you can continue to use CHOICE,
Citilabs recommends using the XCHOICE command statement for logit choice models.
Usage is similar with XCHOICE, but there are some differences in keyword usage and in
value formats for keywords. See “Summary of syntax usage differences between
XCHOICE and CHOICE” on page 574.
Use the XCHOICE command to implement logit choice models, based on either
generalized costs or utilities. The actual keywords supported depend on whether you
use cost-based or utility-based models:
• XCHOICE keywords: Cost-based models
• B A S E COS T S MW
• B A S E D E MA N D MW
• COS T S MW
• D COS T S MW
• D E MA N D
• D E MA N D MW
• D E S T S P LIT
m COEFF
m INCLUDE
m EXCLUDE
m SPLITINTO
• OD E MA N D MW
• S P LIT
m COEFF
m SPLITINTO
m SPLITCOMP
• S T A R T MW
Ke y wo rd S ub k e y wo rd D e s c rip tio n
• A LT E R N A T IV E S
• B A S E D E MA N D MW
• B A S E U T ILS MW
• D E MA N D
• D E MA N D MW
• D E S T S P LIT
m INCLUDE
m EXCLUDE
• D U T ILS MW
• OD E MA N D MW
• S P LIT
• S T A R T MW
• U T ILIT IE S MW
Ke y wo rd S ub k e y wo rd D e s c rip tio n
DEMANDMW is only available to pure mode choice models where input demand is a
matrix. In destination-choice or mixed mode- and destination-choice models, use
DEMAND instead. DEMAND in XCHOICE can be any of these values:
• Constant
• Variable
For example:
....
array tripsfromi=5
if(i==1)
tripsfromi[1]=100
tripsfromi[2]=200
tripsfromi[3]=300
tripsfromi[4]=400
tripsfromi[5]=500
endif
myvar=100
myindex=3
...
DEMAND =100,
.OR.
DEMAND =myvar,
.OR.
DEMAND =tripsfromi,
.OR.
DEMAND =tripsfromi[1],
.OR.
DEMAND =tripsfromi[myindex],
For mixed mode- and destination-choice models, DESTSPLIT must start with alternatives
prefixed with “dest” (for example, destx), and end with corresponding alternative name,
for example “x.” Here is an example:
ALTERNATIVES=car b c,
SPLIT = TOTAL 0.01 destcar destpt,
DESTSPLIT = destcar 0.02 car,
DESTSPLIT = destpt 0.03 pt,
Both “x” or “destx” are acceptable in the higher level SPLIT clause. In previous example,
both of these two following cases work:
SPLIT = TOTAL 0.01 destcar destpt,
Or
SPLIT = TOTAL 0.01 car pt,
For utility-based model, if one alternative has a scalar, all others must also have scalars,
example:
split=total,0.5,auto,1.0,pt,
COMP
Programs : Distribution, Fratar, Generation, Matrix
Computes a variable, matrix, or matrix element. Keywords and sub-keywords include:
• MW
m EXCLUDE
m INCLUDE
• VAR
Usage is:
VAR=expression
MW[]=expression (INCLUDE EXCLUDE)
The COMP statement is probably the most important of all the statements in the program.
It is used to compute variable and work matrix values.
COMP k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
If a COMP statement includes any INCLUDE or EXCLUDE filters, the filters apply to all MW[]=
values, and special matrix functions on the statement, no matter where they appear on
the statement. EXCLUDE is processed after INCLUDE. INCLUDE and EXCLUDE may not be
specified within a JLOOP block.
Matrix Program > Control statements > COMP > Supported expressions
The expression may contain the following special matrix row processing functions:
ROWSUM() ROWCNT() ROWMIN() ROWMAX() ROWAVE() ROWFIX()
ROWFAC() LOWEST() ROWADD() ROWMPY() ROWDIV() ROWREAD()
In addition to the standard numeric expression functions (abs, exp, int, ln, log, max, min,
round, sqrt—see “Expressions” on page 33 for more details), some special purpose
functions are available. The matrix oriented functions process all cells in a matrix
(subject to the restrictions of any INCLUDE and EXCLUDE lists), and should not be used
within JLOOP blocks and MW[]= expressions.
Most of these functions could be duplicated with a combination of MW[]= statements.
The function format has two advantages: coding is much easier, and processing is more
efficient. Combining functions on a single statement is permissible; they will be
processed in appropriate order. Example: DUMMY = ROWFAC(3,1.5) + ROWFIX(3) will factor
matrix 3 and then integerize it.
In the following matrix function descriptions, the first argument (mw) indicates the work
matrix to process, and must be specified. If “lo,hi” is allowed, and lo is supplied, and hi is
not, hi will be set to lo. Lo and hi are inclusive values. If an invalid argument is detected
by a function, the function will return a zero, without any diagnostics.
Ma trix func tio n d e s c rip tio ns
Exam ple
MW[2]=J
MW[K]=MW[2] * MW[5] / SQRT(A*MW[3][MW[22]])
A=1, B=2, MW[A]=A+B INCLUDE=1-5,8,47-93
MW[3]=5*A, MW[4]=MW[3]*2, MW[K][I%10+1]=ODD,
INCLUDE=1-100,401-500, EXCLUDE=90,93,452; will apply to all MW[]s=
ABC=LOOKUP(DEF)*3
; move input matrices to work areas
MW[11]=MI.1.1, MW[12]=MI.1.2, MW[13]=MI.1.3
MW[21]=MI.2.1, MW[22]=MI.2.2, MW[23]=MI.1.3
JLOOP J=I
MW[6]=J ; store only at intrazonal column
ENDJLOOP
set var=sumaf1,rowsum1 ; clear variables
lookup name=f1, file=f1.txt
JLOOP
rowsum1 = rowsum1 + mw[1] ; get total for mw[1]
mw[2] = zi.1.attr[j] * f1(mi.12.1) ; A * F's
sumaf1 = sumaf1 + mw[2] ; sum A*F
endjloop
; Next line is same process done with functions:
rowsum1=ROWSUM(1) mw[2]=zi.1.attr[j]*f1(MI.12.1) sumaf1=ROWSUM(2)
Matrix Program > Control statements > CONTINUE
CONTINUE
Programs : Distribution, Fratar, Generation, Matrix
Jumps to end of loop.
Use CONTINUE to immediately jump to the end of a loop, bypassing all stack statements
between it and its associated end of loop. If it is within a LOOP or JLOOP block, control
passes to the appropriate ENDLOOP or ENDJLOOP statement. Otherwise, stack
processing for the I zone is terminated but output and zonal reporting statistics will not be
bypassed.
Matrix Program > Control statements > CONTINUE > Example
Exam ple
LOOP L1=1,3
IF (!(condition)) CONTINUE
ENDLOOP
IF (condition) CONTINUE ; no more processing for this origin zone
LOOP L2=K1,K2,KINC
JLOOP EXCLUDE=25-50,88
IF (condition) CONTINUE ; jump to ENDJLOOP
.
ENDJLOOP
LOOP L3=L2,L2+5
IF (condition) CONTINUE ; jump to ENDLOOP for L3
.
ENDLOOP
ENDLOOP
Matrix Program > Control statements > EXIT
EXIT
Programs : Distribution, Fratar, Generation, Matrix
Exit the program before the end of zone processing
Upon encountering EXIT, the program immediately terminates stack processing, and
goes to the end of I-loop processing.
Matrix Program > Control statements > EXIT > Example
Exam ple
IF (expression) EXIT
Matrix Program > Control statements > FILEI
FILEI
NOTE: See “FILEI” on page 50 for general information about FILEI and for important
limitations when using Application Manager.
• DBI • ZD A T I
m AUTOARRAY m AVE
m AUTOMDARRAY m AVEX0
m DELIMITER m CNT
m FIELDS m DEFAULT
m JOINTODBI m FIRST
m JOINTOFIELDS m LAST
m MAXRECS m MAX
m NAME m MIN
m SORT m NAME
• LOOKU P I m SELECT
• MA T I m SUM
m AUTOMDARRAY m Z
m FIELDS
m PATTERN
m SKIPRECS
• R E CI
m DELIMITER
m FIELDS
m LISTERRS
m MAXERRS
m MAXRECS
m MAXSCAN
m NAME
m SORT
FILEI input data is normally entered in either matrix format or zonal vector format. Matrix
data is read dynamically (at the start of each I-loop), and must be in origin zone (I) order,
whereas zonal data is read prior to the initiation of the I-loop, and need not be in any
specified order. Data from these files is accessed via COMP statements, and are
identified as MI.n.name and ZI.n.name. The n designates subscript of the file, name
designates the matrix name or number. Cube Voyager matrices can have names and/or
numbers, other matrices have only numbers, and zonal data files have names only.
Example: MI.1.3 indicates matrix number 3 on the MATI[1] file. ZI.6.POP indicates the
POP variable from ZDATI[6] file. Valid matrix names contain only alphanumeric
characters, spaces, and underscores (_). If matrix names have spaces, then you must
include the entire MI matrix reference in double quotes to recognize the name. For
example:
MW[1]="MI.1HBW TRIPS"
On the FILEI statement the subscript is either explicitly, or implicitly, specified. MATI=...
defaults to MATI[1], and MATI[3]=name3,name4,name5 sets up MATI[3], MATI[4], and
MATI[5]. Since it is required that ZDATI files have variables explicitly defined for them,
the vector form of ZDATI (ZDATI=file1, file2...) will be treated as an error.
When an input file is used in an expression, it may have an additional subscript
appended to it to specify a zone number. For matrices, the subscript references the
column within a row, and for zonal data, it references the nth item in the vector. Zonal
data can be viewed as having zones rows with one column per zone, or as one row
having zones columns (user’s choice, it doesn’t matter). If there is no subscript specified,
the current value of J is used. J will always be in the range 1-zones. Example: MI.6.3[I]
accesses the intrazonal cell. ZI.1.TRMTIME[I] and ZI.1.TRMTIME[J] reference the origin
and destination terminal times, respectively.
Matrices can be input as either binary matrices or as data on ASCII or DBF type
records. In the latter case, PATTERN and FIELDS must be specified. ASCII type records are
more subject to variation (empty fields, invalid values, etc.), and the program is a bit
more tolerant with them. If a J or M is out of range, the values for the field are ignored.
On the other hand, if the field contains non-numeric data, it is treated as an error, and
further processing of the record is terminated.
The FILEI file keywords ZDATI, RECI, and DBI can point to elements in a multidatabase
(MDB) file by designating the filename followed by a backslash and the element name.
The program will generate a temporary file of records, each record containing all the
variables in the element. If the FILEI file keyword value is followed by variable definitions,
those definitions are ignored, or in some cases, cause a fatal termination. On a ZDATI file
name, you can specify a definition for Z to indicate which MDB element represents the
zone number. Z= is not necessary if one of the element variables has an appropriate
name for the zone number (see description of ZDATI for details).
NOTE: Cube 6.4 does not support EMME/2 data bank files.
FILE I k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
DBI JOINTODBI |I| Specifies the number of the input DBI file to
join this DBI file to. If JOINTODBI is
specified for a DBI file, then the SORT
keyword must also be specified. The field
names referenced by the SORT keyword
define the join key. You must also specify
the JOINTOFIELDS subkeyword.
You can use the DBI.#.JOINCOND
variable to check the status of the join
action, i.e. when the "Join To" DBI file is
moved to a different record. Please see
“DBI” on page 591.
DBI MAXRECS |I| Limits the number of records read from the
DBI file. If the DBI is not a DBF file, the
program treats both zero length and blank
records as legitimate records. If the file is
a DBF file, deleted records (flagged with a
“*”) are not counted as records.
For example:
FILEI DBI[1] = "{FixedFormat}",
DELIMITER=' ', FIELDS=1(8),
SORT=FIELD3
(continued)
RECI MAXSCAN |I| Allows the user to limit the file sampling for
text records in order to reduce front end
time on very large files. The program
normally scans the entire file to obtain the
longest record, the number of records, the
maximum length of each field, etc. That
could be quite time consuming, and not
really productive for very large files such
as the census files. If the user is certain
that all the records are the same length,
the use of this keyword can reduce front
end time. This value will be used only if the
format is fixed, and there is no SORT
specified. The value must be >= 10, if
specified. This control should not
generally be used and was added
primarily for internal Citilabs use. I maybe
save time if processing very large data
files.
For example:
FILEI RECI = "{FixedFormat}",
DELIMITER=' ', FIELDS=1(8),
SORT=FIELD3
(continued)
ZDATI If the file is a DBF, MDB, or a Cube
(continued) Voyager network, it is not necessary to
name the fields to be extracted. All fields
will be extracted and can be referenced, in
the script, by existing field names from the
input file. (DBF field names up to 11
characters long may be input). The
specification of zone number field is
optional for those two file formats. If 'Z=' is
present, the specified field will be used to
extract zone number. Otherwise, the
program will try to determine the zone
number field based on file type. For DBF
or MDB files, the program will go through
all field names to find a match with one of
the following possible zone field names, in
the given order: {Z, I, J, ZONE, ZONA,
TAZ}. The first matched name will be used
to extract zone number. (Note: For files with
more than one possible zone field from the
list above, it is recommended to specify
zone number field explicitly to ensure the
correct field is used.) For Cube Voyager
network files, node numbers (N) will be
used as zone numbers by default.
ZDATI can contain string data fields.
Where fields cannot have their type
automatically determined such as NET,
MDB or DBF files, require the type to be
specified with the parameters. Character
fields must have the "(C)" suffix appended
to be treated as string input. E.g. FILEI
ZDATI[2] = "EITrips.csv",
OID_=#1,Z=2,EITRIPS=3,NAME(C)=4
ZDATI DEFAULT |R| Value with which to initialize the array for
the named variable. Then, if there are no
records for a zone, or the field is blank on
a record, this value will be used.
The following keywords indicate a
process to use in obtaining the value for
the variables that are listed following the
keyword when there is more than one
record per zone. The values for the
variables will be obtained only from file
records that contain the variable. A
variable may appear in only one keyword
list; any variables that are not in any list will
be set to LAST.
ZDATI FIRST |SV| Directly from the record from the FILEI with
the lowest index [].
ZDATI LAST |SV| Directly from the record from the FILEI with
the highest index [].
Caveat: The program establishes a buffer to read file records into. It has to know how
long a buffer is required. With DBFs and fixed format records, the required length is
known, but with delimited format, the required length can not be estimated exactly. For
delimited files, the record length is estimated by multiplying the highest field number by
10. If the estimated length is inadequate, a dummy variable with a high field number can
be specified to generate a larger record length.
Matrix Program > Control statements > FILEI > More on DBI
M o re o n DBI
DBI files are not automatically processed. You must write scripts to read the records.
Several functions are available to read the records. Use these functions in a COMP
statement with the form: N=DBIfunc(DBI#,...). DBI# must always be the first argument.
All the functions return a value to indicate the success of the operation. A return value of
0 indicates a successful operation; any other value indicates the read was not 100%
successful. You must check the return code. The functions are:
• DBIReadNext(#,R) where R indicates the record to read, specified relative to the current
record. A negative R means prior to the current record, and a positive R means after the
current record. Write sequential reads as DBIReadNext(#,1), though DBIReadNext(#) is
also allowed. A return code of 1 indicates any of the following errors: bad #, R<1, or
R>DBI.#.NUMRECORDS.
• DBISeek(#, R,...) where R is a value to search for in the field specified as SORT[1]. In
order to use this function, there must be at least as many SORT values as there are R
arguments. There may be fewer R values than there are SORT fields, but not more. This
function searches for the record that matches all the specified R values. The return values
are:
m
0 — A match was found.
m
1 — An error in setup occurred.
m
2 — A match was not found, and DBI.#.RECNO is set to the record that is above the R
selections.
m
3 — The R values are greater than the last record and DBI.RECNO is set to the last
record.
In all cases, the DI.#.field values are extracted from the record indicated by
DBI.#.RECNO, and the record pointer points to that record.
See “Example 5: DBI processing using JOINTODBI” on page 659 and “Example 6:
DBI processing using AUTOARRAY” on page 659 for examples of DBI processing.
NOTE: Youcan create and populate arrays with just a FILEI DBI statement; you do not
need DBIRead functions.
Matrix Program > Control statements > FILEI > More on MATI PATTERN
M o re o n M ATI PATTERN
Example for MATI[1]
PATTERN Data record fields I M [J] Values
IJ:V 1 15 21 22 23 24 I=1 MI.1.1[15-18] 21,22,23,24
IMJ:V 1 6 18 100 101 105 I=1 MI.1.6[18-20] 100,101,105
I:JMV 5 12 1 8 14 2 90 I=5 MI.1.1[12] 8
I=5 MI.1.2[14] 90
IJM:V 5 12 3 8 14 2 90 I=5 MI.1.3[12] 8
I=5 MI.1.4[12] 14
I=5 MI.1.5[12] 2
I=5 MI.1.6[12] 90
The above PATTERNS do not provide for the situation where the record contains I, J,
then multiple values to represent matrix 1, 2, 3… In this case, the PATTERN IJM:V, with
the FIELD value of M set to zero, can be used to describe the input data. The matrix
number is implied and always starts with 1 on each record. The following example
illustrates the specification of PATTERNS and FIELDS for input data with implied matrix
number:
Example (implied matrix number)
The above PATTERNs also do not provide for the situation where the record contains I,
then multiple values to represent J values 1, 2, 3... for a single matrix (implied matrix
number M=1). In this case, the PATTERN IJ:V, with the FIELDS value of J set to zero,
can be used to describe the input data. The J value is implied and always starts with 1
on each record. The following example illustrates the specification of PATTERN and
FIELDS for input data with implied J number:
Example (implied j index number)
M o re o n RECI
Example of usage: to sum all the housing units in a record (even if the exact names are
not known, but we do know that all units fields are named xxUNITS):
TotUnits=0
Loop k=1,RECI.NUMFIELDS
If (RECI.TYPE[K] = 'N' && substr(RECI.NAME[k],3,5) = 'UNITS') TotUnits = TotUnits +
RECI.NFIELD[K]
EndLoop
Example:
In a record processing run of matrix
VAR1TOTAL=VAR1TOTAL+VAR1
IF (I=0)
VAR1AVG=VAR1TOTAL/RECI.NUMRECORDS
PRINT LIST=RECI.NUMRECORDS,VAR1TOTAL,VAR1AVG
ENDIF
would sum the values of the variable VAR1 and once all records have been read (I=0)
compute the average value of VAR1 and print to the report file the number of records,
the total of VAR1 and the average of VAR1
Example:
RUN PGM=MATRIX
FILEI RECI=network_link.dbf
PARAMETERS MAXSTRING=100
if (RI.A>25 & RI.B>25)
print, list=ri.A,',',ri.B,',',ri.ROAD_TYPE,',',
ri.IMPORTANCE,',',ri.ROAD_NAME,',',
ri.CLASS,',',ri.SPEED,',',
ri.PICTUREFIL file=tmp1.csv
endif
if (I=0)
print list='Number of link records=',
RECI.NUMRECORDS file=tmp2.dat
endif
ENDRUN
Example:
copy file = junk.txt
11 22 33 44 55 66 77 88 99 aa bb cc dd 56 78 90 12
aa bb cc dd 56 78 90 12
endcopy
RUN PGM=MATRIX
;get 1st 5 data fields as numeric fields and also as character fields
FILEI RECI = junk.txt,Fields=1(c5),1(n5)
FILEO RECO[1]=junkout.dbf FIELDS=reci.allfields
FILEO PRINTO[1]=junkprn.prn
write reco=1
reci.nfield[6],'..',reci.nfield[7],'..',reci.nfield[8],'..',
reci.nfield[9],'..',reci.nfield[10],'..\nri.field1..5 =',
ri.field1,'..',ri.field2,'..',ri.field3,'..',
ri.field4,'..',ri.field5,'..\nri.field6..10=',
ri.field6,'..',ri.field7,'..',ri.field8,'..',
ri.field9,'..',ri.field10,'..'
endrun
These statements show an example of getting I-J values from a delimited file:
RUN PGM=MATRIX
RECI = myfile, org=1, dest=2
MATI[1] = mymat; contains time and distance matrices in 1 and 2
If (RI.ORG > 0 && RI.DEST>0)
Time = matval(1,1,RI.ORG,RI.DEST,0)
Dist = matval(1,2,RI.ORG,RI.DEST,0)
Else
Time=0, dist=0
Endif
print file=outfile, list=reci, time(6.2LR), dist(8.2LR)
; duplicate RECI and append time and dist in delimited format
ENDRUN
Matrix Program > Control statements > FILEO
FILEO
Programs : Distribution, Fratar, Matrix
Outputs data files. Keywords include:
• MA T O
m DEC
m DELIMITER
m FIELDS
m FORMAT
m MAXFIELDS
m MO
m NAME
m PATTERN
• P R IN T O
m APPEND
• R E CO
m CFORM
m EXCLUDERECI
m FIELDS
m FORM
m NAME
m REPORT
m Z
Use FILEO to specify the type and number of output files for the program to produce.
Cube Voyager writes matrix type output files at the end of each I zone.
PRINT statements write formatted print files to the PRINTO file. WRITE statements write
RECO files to the referenced DBF file or can point to elements in a multidatabase (MDB)
file by designating the file name followed by a backslash and the element name.
NOTE: Cube 6.4 does not support EMME/2 data bank files.
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
MATO FIELDS |IV4| Field width for data values when DELIMITER
is not specified. The number of values
specified with FIELDS must match the
number of letters in PATTERN (the “base”
portion precedes the colon, and the
“repeating” portion follows the colon). The
first FIELDS value always sets the length for
I. After exhausting the list of FIELDS values,
the program reverts to the FIELDS value that
corresponds to the repeating portion of
PATTERN. If the FIELDS value that
corresponds to a base portion of PATTERN
is set to 0, the program omits the
corresponding data.
Examples:
PATTERN=IJ:V FIELDS=4,4,6
• I will always be in 1-4
• J will always be in 5-8
• V will be in 9-14,15-20,21-26 ...
PATTERN=I:JVM FIELDS=4,4,6,2
• I will always be in columns 1-4
• J will be in 5-8, 17-20, 29-32 ...
• V will be in 9-14, 21-26, 33-38 ...
• M will be in 15-16, 27-29, 39-40 ...
PATTERN=IJM:V FIELDS=4,4,0,8
• I will always be in columns 1-4
• J will always be in 5-8
• M will not be written to the data
records
RECO CFORM |I| Length of field for all character variables that
follow it on the statement, and do not have a
specific format associated with it. A later
occurrence of CFORM will reset the value
for character variables following it. The
allowed range is 1-255; the default is 15.
FILET
Programs : Distribution, Fratar, Matrix
Sets temporary file paths. Keywords include:
• PAT H
Ke y wo rd D e s c rip tio n
PATH |KS| Specifies the path(s) to the disk area where any
temporary files are to be written. When transposing is
required, the transposed matrices are written to a
temporary file and then recalled during stack
processing. Up to two files are required for this process.
The first file is the actual transposed data, and the
second file is an index to the data file. The index file
may not be necessary, and if it is, it will be relatively
small. It may speed retrieval somewhat if the two files
are on different physical drives. If there is a ram disk
installed, then the index file might fit on it. The index file
size will be zones * chunks * transposes * 4 bytes.
Chunks depends upon the amount of RAM that is
available for the transposing processing; it could be
none.
Assume a 1000 zone system, 20 matrices to be
transposed, and 2 Mb of RAM available. The actual
RAM requirement would be 1000 * 1000 * 20 * 4, or 80
Mb. The number of chunks would be 40 (80 Mb / 2 Mb).
The index file would require 800,000 bytes of RAM. The
amount required for the data would be something less
than 80 Mb, depending upon how well it compresses. In
most cases, the compressed data would require about
30 Mb.
The values for PATH are entered as standard
operating system paths. If PATH[1] is specified, and
PATH[2] is not, or vice-versa, the non-specified path is
set equal to the specified one. If neither is specified,
they both will default to the path in the environment
variable named TMP, or TEMP. The logic for
determining the appropriate path, and opening the files
is:
• If the PATH=' ', use current directory.
• If the PATH is specified, use the PATH.
• If not specified, and TMP is specified in the
Operating System environment, use the
TMP.setting. (Same logic for TEMP.)
• If the open fails, Fatal.
Matrix Program > Control statements > FILET > Example
Exam ple
PATH=' ' ; use current directory for both
PATH=..\,R: ; up a directory for data, drive R: for index
PATH=c:\ d ; root of c: for data, current directory on d: for index
Matrix Program > Control statements > FILLMW
FILLMW
Programs : Distribution, Fratar, Matrix
Fill work matrices. Keywords include:
• MW
This statement is used to speed up the process of filling matrices with values from other
matrices. Because of its structure, matrices can be very easily moved from input
matrices to work matrices or from work matrices to other work matrices. Multiple matrices
can be easily filled on one specification. The beginning MW target is the keyword and
the values are the matrices that are to be moved into the target matrices. After the first
value, the following values may be unqualified (they do not have to have MI.#. prefixed
to their names/numbers). This is also true for MW sources.
MI sources may have .T affixed to indicate that they shall be transposed (see Example 2
below).
Everything that can be done on a FILLMW statement can be accomplished by COMP
statements, but FILLMW sets up very fast moves in contrast to internal computational
solutions performed by COMP statements.
FILLMW k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple 1
; The following five statements all do the same thing
FILLMW MW[1]=mi.1.1(3)
FILLMW MW[1]=mi.1.1,mi.1.2,mi.1.3
FILLMW MW[1]=mi.1.time,mi.1.distance,mi.1.cost
FILLMW MW[1]=mi.1.1,2,3
FILLMW MW[1]=mi.1.time,distance,cost
; The next two statements illustrate the simplicity of FILLMW vs. COMP
FILLMW MW[11]=mw[1],2,3,9,6
COMP MW[11]=mw[1], mw[12]=mw[2], mw[13]=mw[3], mw[14]=mw[9], mw[15]=mw[6]
Exam ple 2
;--- FILLMW using transposed inputs
RUN PGM=MATRIX
MATI=TEST_FILLMW.MAT
MATO=TEST_FILLMW_2.MAT MO=1-2, 11-12
ENDRUN
Matrix Program > Control statements > FREQUENCY
FREQUENCY
Program: Distribution, Fratar, Matrix
Stratifies one matrix’s values based upon the values of another. Keywords include:
• B A S E MW
• R A N GE
• R E P OR T
• T IT LE
• V A LU E MW
Ke y wo rd D e s c rip tio n
Exam ple
FREQUENCY BASEMW=1,VALUEMW=2,RANGE=1-100,
TITLE='Work Trips vs. Minutes'
FREQUENCY BASEMW=1,VALUEMW=2,RANGE=0-100-0.5, REPORT=99
Matrix Program > Control statements > GOTO
GOTO
Program: Distribution, Fratar, Generation, Matrix
Use GOTO to jump to statement named :label.
When GOTO is processed, flow immediately branches to the statement named label.
Label can be within IF and LOOP blocks; but care should be taken if this is to be done.
label is a character string that must have a matching LABEL statement. The leading colon
”:” is removed from label when determining the qualified name of the statement to
branch to.
NOTE: The placement of a :label inside a JLOOP is not allowed. This prevents using
GOTO from jumping into a JLOOP. A GOTO may be used inside a JLOOP to jump to a
:label that is outside the JLOOP but not to one that is inside the JLOOP.
Matrix Program > Control statements > GOTO > Example
Exam ple
GOTO buildhwy
GOTO :buildhwy
A statement that begins with : is a label statement, that has meaning with only GOTO
statements. A label statement can be within IF and LOOP blocks; care should be taken if
this is done. The leading ”:” is ignored.
Matrix Program > Control statements > GOTO > Example
Exam ple
GOTO buildhwy
.
.
:buildhwy
IF (expression) GOTO :buildhwy ; It is permissible to go backwards.
Matrix Program > Control statements > IF ... ELSEIF ... ELSE ... ENDIF
Exam ple
IF (time_to_bcd < 20) simple statement ;single IF with process
IF (expression) EXIT
IF ( ( j=3-5,6-30,57 & k=(2*j-4) ) || ((J*k) = 14-20,56) )
.
ELSEIF (loop_cntr > 10)
.
ELSEIF (loop_cntr > 5 && diff.time < 32)
.
ELSE
.
ENDIF
; The above IF example is rather esoteric,
; and probably can not be aided by a filter.
; The J selection could have been filtered, but that might have caused
; conflicts with the use of J in other parts of the expression.
; The following illustrates a more efficient process for using IF for
; lengthy zonal selections within JLOOPs
; ***** Inefficient *****
JLOOP
IF (I=i_ranges... && J=j_ranges...) statement
ENDJLOOP
; ***** More efficient *****
IF (I=i_ranges...)
JLOOP INCLUDE=j_ranges...
statement
ENDJLOOP
ENDIF
Matrix Program > Control statements > JLOOP ... ENDJLOOP
• E XCLU D E
• IN CLU D E
JLOOP ENDJLOOP blocks are used primarily to control computations on matrices that
a single COMP MW[]= can not properly control. A JLOOP block causes the program to
loop between the JLOOP statement and its ENDJLOOP varying J from Jbeg to Jend by
increments of Jinc. The logic for JLOOP and ENDJLOOP processing is:
• at JLOOP:
m
If J is specified, establish values for J, Jend, and Jinc.
m
Else set J=1, Jend=Zones, Jinc=1.
m
If (J < 1 or J > Zones or Jend <1 or Jend > Zones) fatal termination.
m
If (INCLUDE, and J fails INCLUDE) go to ENDJLOOP.
m
If (EXCLUDE, and J meets EXCLUDE) go to ENDJLOOP.
m
Next statement.
• at ENDJLOOP:
m
Add Jinc to J.
m
If (Jinc > 0 and J <= Jend) go to statement following JLOOP.
m
If (Jinc < 0 and J >= Jend) go to statement following JLOOP.
m
If (INCLUDE, and J fails INCLUDE) go to ENDJLOOP.
m
If (EXCLUDE, and J meets EXCLUDE) go to ENDLOOP.
All statements between the JLOOP and ENDJLOOP statements are processed with the
current value of J. JLOOP blocks may not be nested, and may not overlap other
JLOOP, LOOP or IF blocks. COMP MW[]= statements are processed only for the
current value of J. Only the following statements are valid within a JLOOP block:
BREAK CALL COMP CONTINUE EXIT
GOTO IF ELSEIF ELSE ENDIF
PRINT REPORT SET
NOTE: The placement of a :label inside a JLOOP is not allowed. This prevents using
GOTO from jumping into a JLOOP. A GOTO may be used inside a JLOOP to jump to a
:label that is outside the JLOOP but not to one that is inside the JLOOP.
Ke y wo rd D e s c rip tio n
If Jbeg is not specified, Jend and Jinc can not be, and the values 1,Zones,1 are used. If
Jend is not specified, Jinc can not be, and the values Jbeg and 1 are used. If Jinc is not
specified, it is set to 1 ( -1, if Jbeg > Jend). Because all these values can be
expressions, they must be separated by commas; if an expression contains any
commas, it must be enclosed within ().
Matrix Program > Control statements > JLOOP ... ENDJLOOP > Example
Exam ple
JLOOP J=I EXCLUDE=500-535 ;process only intra zonal values
. ; but exclude externals
ENDJLOOP
ROWSUM1 = 0 ROWSUM3=0
JLOOP ; get rowsums for matrices
ROWSUM1 = ROWSUM1 + MW[1]
ROWSUM3 = ROWSUM3 + MW[3]
ENDJLOOP
Matrix Program > Control statements > LOOP ... ENDLOOP
LOOP ENDLOOP blocks are used to repeat of a series of statements. LOOP initializes
a variable; ENDLOOP compares the contents of the variable to another value, and
branches back to the statement following the LOOP statement if the comparison fails.
LOOP blocks may be nested; they may not overlap IF blocks. The process differs
considerably from JLOOP. The logic is as follows:
• at LOOP:
m
Initialize LVAR to Lbeg.
m
Proceed to next statement.
• at ENDLOOP:
m
If Lend not specified, jump to next statement.
m
Compute Lend.
m
If Linc not specified:
m
Set Linc to 1 or -1 (if Lbeg and Lend are constants, and Lbeg > Lend)
m
Else compute Linc.
m
Add Linc to LVAR.
m
Compare LVAR to Lend.
m
If (Linc > 0 and LVAR > Lend) jump to statement after ENDLOOP
m
If (Linc > 0 and LVAR <= Lend) jump to statement after LOOP
m
If (Linc < 0 and LVAR < Lend) jump to statement after ENDLOOP
m
If (Linc < 0 and LVAR >= Lend) jump to statement after LOOP
Because of the flexibility of this logic, unpredictable results and/or endless loops can
occur if care is not taken. This would only happen if the Lend and/or Linc values are
expressions that contain variables which could be altered during the loop. On the other
hand, the flexibility provides for powerful control. The loop will be processed at least one
time regardless of Lend and Linc values. Most uses will involve constants. Because
LVAR values can be expressions, Lbeg, Lend, and Linc must be separated by commas
(standard white space delimiting can not be interpreted properly).
LOOP & E N D LOOP k e y wo rd s a nd e xp re s s io ns
Ke y wo rd D e s c rip tio n
Exam ple
LOOP iter=1,10 ; perform 10 iterations
.
ENDLOOP
LOOP xyz=abc*def,ghi+jkl,mno/pqr
LOOP abc=xyz,xyz+2,2 ; nested LOOP
ENDLOOP
ENDLOOP
LOOP jj=10,3,-2.5 ; 10, 7.5, 5.0
ENDLOOP
Matrix Program > Control statements > PARAMETERS
PARAMETERS
Program: Matrix
Sets general parameters. Keywords include:
• MA T V A LCA CH E
• MA XMW
• MA XS T R IN G
• T RAM
• ZON E MS G
• ZON E S
P A R A ME T E R S k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
ZONES=3000
Matrix Program > Control statements > PRINT
PRINT
Programs : Distribution, Fratar, Generation, Matrix
Format and print a line of information. See “PRINT” on page 69 for details about the
standard Cube Voyager statement.
Matrix Program > Control statements > PRINT > Example
Exam ple
PRINT FORM=0 LIST=I,J,TOTAL(6.2CS) 'ABCDE'(6.3), FORM=LRCD,
LIST=N,JLOOP_J ;Note this line is a continuation
LIST= I(6) J(6) TOTAL1, TOTAL2, TOTAL3 FILE=PRINTFIL.001
PRINT FORM=6.0CDLR LIST=I,J,TOTAL1,TOTAL2 FILE=PRINTFIL.002
Matrix Program > Control statements > PRINTROW
PRINTROW
Program: Distribution, Fratar, Matrix
Prints row of matrices. See “PRINTROW” on page 77 for details about the standard
Cube Voyager statement.
Matrix Program > Control statements > PRINTROW > Example
Exam ple
Resulting Output:
J: I=1 PRINTROW MW[1] form=LRD Tot=5,050
1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27: 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
50: 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
73: 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96: 96 97 98 99 100
J: I=1 PRINTROW MW[2] form=LRD Tot=2,390
1: 1 2 3 4 5 - - - - - -- - - - - - - - - - -- - - - - - - - - - 31 32
33: 33 34 - 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
57: 57 58 59 60 -- - - - - - - - - - -- - - - - - - - - - -- - - - - - -
90: 90 91 92 93 94 95 96 97 98 99 100
J: I=1 PRINTROW MW[1] form=6D base1= Tot=5,050
1: 1 2 3 4 5 6 7 8 9 10
11: 11 12 13 14 15 16 17 18 19 20
21: 21 22 23 24 25 26 27 28 29 30
31: 31 32 33 34 35 36 37 38 39 40
41: 41 42 43 44 45 46 47 48 49 50
51: 51 52 53 54 55 56 57 58 59 60
61: 61 62 63 64 65 66 67 68 69 70
71: 71 72 73 74 75 76 77 78 79 80
81: 81 82 83 84 85 86 87 88 89 90
91: 91 92 93 94 95 96 97 98 99 100
J: I=1 PRINTROW MW[2] form=6D base1= Tot=2,390
1: 1 2 3 4 5 -- -- -- -- --
31: 31 32 33 34 -- 36 37 38 39 40
41: 41 42 43 44 45 46 47 48 49 50
51: 51 52 53 54 55 56 57 58 59 60
81: -- -- -- -- -- -- -- -- -- 90
91: 91 92 93 94 95 96 97 98 99 100
Matrix Program > Control statements > RENUMBER
RENUMBER
Programs : Fratar, Matrix
Renumbers (aggregate, split) zones for output matrices. Keywords include:
• FILE
• FILE S
• MIS S IN GZI
• MIS S IN GZO
• ZON E O
• ZON E S
RENUMBER causes the program to assign new zone numbers to all values in the output
matrices. This causes an extra layer of processing, because the matrices must be
saved, and then retrieved and combined after all normal processing is completed. Each
input zone must be assigned a new output zone number, and a pair of percentages
(ROWPCT and COLPCT) to indicate how the outgoing matrix zonal values are to be
allocated to the renumbered zones. These equivalencies are obtained from records in
the designated FILE. The records may have from one to four fields to specify the
renumbering. A semi-colon (;) terminates data on a record; anything following the ; is a
comment.
The standard fields are:
If the list of IPZONEs is large, and the length of the record would exceed 250 characters,
the record must be broken into several records. Each record must begin with the District
string, and may not terminate with a dash.
Matrix Program > Control statements > RENUMBER > Example
Exam ple
Ke y wo rd D e s c rip tio n
Exam ple[1]
FILEI MATI=IN.MAT
FILEO MATO=OUT.MAT, MO=1
MW[1]=MI.1.1 ; must load values into MW[1], else OUT.MAT will be all zeros
; renumber OUT.MAT according to 2005ZON.EQ
RENUMBER FILE=2005ZON.EQ, MISSINGZI=M, MISSINGZO=W
Matrix Program > Control statements > RENUMBER > Example[2]
Exam ple[2]
FILEI MATI=IN.MAT,
ZDATI=ZDATIN.DAT, Z=#1, DIST=2
FILEO MATO=OUT.MAT, MO=1
MW[1]=MI.1.1 ; must load values into MW[1], else OUT.MAT will be all zeros
; renumber OUT.MAT according to ZDATIN.DAT
RENUMBER ZONEO=ZI.1.DIST
Matrix Program > Control statements > RENUMBER > Example[3]
Exam ple[3]
/* This is a two step process to show an example of using RENUMBER to split an
existing pair of trip tables for a new disaggregate zone system. A typical process
might be to split zones into fully nested sub zones in ArcView. This example
assumes such a spatial procedure has been preformed and the resulting dbf file has
the zonal area of both the parent zones and the new split zones. This first step
uses MATRIX to compute split factors based on the ratio of the new zone-to-old zone
area and writes out the zonal equivalency file for use in the subsequent renumbering
step.
*/
;STEP 1
RUN PGM=MATRIX
FILEI ZDATI[1] = TAZDATA1.DBF
; Data structure of TAZDATA1.DBF is:
;Z NEW_Z1 NEW_Z2 Z_AREA Z1_AREA Z2_AREA
;1 1 2 6.40 2.22 4.18
;2 3 4 6.42 3.18 3.24
;3 5 6 6.44 3.78 2.66
;4 7 8 6.46 2.58 3.88
;5 9 10 6.48 3.75 2.73
; . . .
PARAMETERS ZONES=2999
; establishes a split factor based on the new zone geography
; the split factor is the ratio of the area of the new zone to the area
; of its parent. This set up assumes all input zones are split into two output
zones
; and that the total area of the new zones is equal to the area of the parent zone.
SPLIT1=100*(ZI.1.Z1_AREA/ZI.1.Z_AREA)
SPLIT2=100-SPLIT1
; writes the split factors to the PRN file
PRINT LIST=SPLIT1,SPLIT2
; write the zonal equivalency file
PRINT LIST=I,ZI.1.NEW_Z1,SPLIT1,
FILE = EQUIV_1.DAT"
PRINT LIST=I,ZI.1.NEW_Z2,SPLIT2,
FILE = EQUIV_1.DAT"
; data structure of EQUIV_1.DAT is :
; 1.00 1.00 34.69
; 1.00 2.00 65.31
; 2.00 3.00 49.53
; 2.00 4.00 50.47
; 3.00 5.00 58.70
; 3.00 6.00 41.30
; 4.00 7.00 39.94
; 4.00 8.00 60.06
; 5.00 9.00 57.87
; 5.00 10.00 42.13
; . . .
ENDRUN
;STEP 2 – split input trip table to new zonal system
RUN PGM=MATRIX
FILEO MATO[1] = TRIPS2.MAT,
MO=1-2, NAME=AUTO, TRANSIT
FILEI MATI[1] = TRIPS1.MAT
mw[1]=mi.1.1 ; fill work matrix 1 with AUTO trips from input matrix 1
mw[2]=mi.1.2 ; fill work matrix 2 with TRANSIT trips from input matrix 2
RENUMBER,
FILE = EQUIV_1.DAT
; the zonal equivalency file has the fields IPZONE, OPZONE and ROWPCT
; the default when no COLPCT is specified is to set the COLPCT=ROWPCT.
; if different COLPCT factors are desired they would need to be specified in the
; fourth column of the file.
ENDRUN
Matrix Program > Control statements > REPORT
REPORT
Program: Matrix
Request reports and establish tracing. Keywords and sub-keywords include:
• MA R GIN R E C
m CFORM
m FILE
m FORM
m LIST
m PRINT
• MA R GIN S
• MA T S T A T
• T R A CE
• ZD A T
m DEC
R E P OR T k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
SET
Programs : Distribution, Fratar, Generation, Matrix
Stores numeric values into one, or more, variables. Keywords include:
• VAL
• VARS
Use SET to set any number of variables to some value. All variables are set to zero at the
beginning of the I-loop, and are then changed only by the user. Most changes are the
result of COMP statements. A COMP statement can accomplish all that SET does, but it is
not as efficient, and is somewhat wordier.
S E T k e y wo rd s
Ke y wo rd D e s c rip tio n
VAL |R| Numeric value that the VARS that follow will
be set to. VAL is initialized to zero when the
statement is started, and then reset as this
keyword is encountered. If there is no VAL,
the coded VARS are all set to zero.
Exam ple
SET VAL=0, VARS=TOT1,TOT2,COUNTER
COMP TOT1=0 TOT2=0 COUNTER=0 ; is the same as previous statement
SET VARS=TOT1 TOT2 COUNTER ; is also the same (VAL defaults to 0)
SET VAL=123 VARS=C123, VARS=TOT1, TOT2, TOT3 ; sets all to 123
ARRAY SUMS=50
SET VAL=100, VARS=SUMS ; sets all 50 cells of SUMS to 100
SET VARS=SUMS ; sets all 50 cells of SUMS to 0
Matrix Program > Control statements > SORT
SORT
Programs : Distribution, Fratar, Generation, Matrix
Sort user-defined arrays. Keywords include:
• ARRAY
• N U MR E CS
See “SORT” on page 81 for details about the standard Cube Voyager statement.
Matrix Program > Control statements > SORT > Example
Exam ple
ARRAY ZONENO=ZONES, HH=ZONES, INCOME=ZONES
.
.
ZONENO[I] = I
HH[I] = ZI.1.HH[I]
INCOME[I] = ZI.1.INCOME[I]
.
.
SORT ARRAY=-INCOME,-HH,ZONENO, NUMRECS=ZONES
LIST=’ Zone Income HHs’
JLOOP
PRINT FORM=8, LIST=ZONENO[J], INCOME[J], HH[J]
ENDJLOOP
Matrix Program > Control statements > WRITE
WRITE
Programs : Distribution, Fratar, Generation, Matrix
Output record data files to DBF format. Keywords include:
• R E CO
Use WRITE to specify the record files that are to be written at the end of each I zone.
W R IT E k e y wo rd
Ke y wo rd D e s c rip tio n
RUN PGM=MATRIX
mati[1]=tripfile.mat
zdati[1]=socoecon.dat,z=#1, pop=#2, area=#3, income=#4, hh1=#5, hh2=#6, hh3=#7
zdati[2]=employ.dat, z=#1, gov=#2, retail=#3, other=#4
ARRAY pop=10, area=10 totemp=10, tothh=10 ; this is a 10 zone problem
area[i]=zi.1.area
totemp[i]=zi.2.gov + zi.2.retail + zi.2.other
tothh[i]=zi.1.hh1 + zi.1.hh2 + zi.1.hh3
jloop include=1-5,38,56-100,145-150 ;cbd zones
cbdtrips[j] = cbdtrips[j] + mi.1.tottrips[j]
endjloop
if (i==zones) ; at last zone
jloop ; write a file of zonal records
print file=newzdat.zda form=6 list=j(3) pop[j] area[j] totemp[j] tothh[j]
cbdtrips[j]
endjloop
endif
ENDRUN
Matrix Program > Examples and FAQ > Example 2: Obtain I-J values
RUN PGM=MATRIX
mati=hwytime.mat,trntime.mat
reci=tours.dat, org=23, dst=26
ENDRUN
Matrix Program > Examples and FAQ > Example 3: RECI/RECO processing
RUN PGM=MATRIX
ENDRUN
Matrix Program > Examples and FAQ > Example 4: CHOICE command
RUN PGM=MATRIX
ENDRUN
Matrix Program > Examples and FAQ > Example 5: DBI processing using JOINTODBI
RUN PGM=MATRIX
ZONES=1
LOOP k=1,DBI.1.NUMRECORDS
x=DBIReadRecord(1,k)
RO.ZONE_=DI.1.ZONE_
RO.ALFA=DI.1.ALFA
RO.BETA=DI.2.BETA
WRITE RECO=1
ENDLOOP
ENDRUN
Matrix Program > Examples and FAQ > Example 6: DBI processing using AUTOARRAY
RUN PGM=MATRIX
ZONES = 1
LOOP L3=1,DBI.1.NUMRECORDS,1
RO.ZONE_ = L3
RO.ALFA = DBA.1.ALFA[L3]
RO.BETA = DBA.2.BETA[L3]
WRITE RECO = 1
ENDLOOP
ENDRUN
Matrix Program > Examples and FAQ > Example 7: Simple logit model using XCHOICE
MW[1] = MI.3.1
MW[3] = MI.1.1
MW[4] = MI.2.1
ENDRUN
Matrix Program > Examples and FAQ > Example 8: Cost-based nested logit model using XCHOICE
MW[1] = MI.4.1
MW[4] = MI.1.1
MW[5] = MI.2.1
MW[6] = MI.3.1
XCHOICE,
; List choices
ALTERNATIVES = car bus rail,
; Input demand
DEMAND = 1,
; Input costs
COSTSMW = 4, 5, 6,
; Forecast demand
ODEMANDMW = 14,15,16,
; Model Structure
; Top level nest
SPLIT = TOTAL lambda car pt,
; Forecast composite cost top level
SPLITCOMP = 19,
; PT nest
SPLIT = PT mu bus rail,
; Forecast composite cost PT level
SPLITCOMP = 20,
; Working matrices
STARTMW =70
ENDRUN
Matrix Program > Examples and FAQ > Frequently asked questions
• Multiple purposes
Overview
Trip distribution is the process of estimating the number trips that will travel between all
the zones in the system. Usually the process uses the number of trip ends in each zone
as the starting point. These margin totals are distributed to the rows and column of a
generated matrix. Usually, additional information about some measure of travel between
each zone pair should be included in the process. The most commonly used distribution
process is the “gravity” model, but other processes are also employed. Cube Voyager
does not have any automatic, or default, trip distribution process. The Matrix program
provides a framework that allows the user to perform distribution in a variety of ways. In
some cases, the Matrix program does have some built-in functions that aid in the
implementation of the more popular distribution processes.
A gravity model distribution can be easily implemented within Matrix, but it does need
some help, and the user has to follow certain guidelines for proper implementation. A
brief illustration of a typical gravity distribution follows. The gravity model equation is:
TRIPi-j = Pi * Aj * func(Ti-j) / Sz=1..n (A * func(T)).
where:
P = the number of trip productions for a zone.
A = the number of trip attractions for a zone.
T = the travel impedance factor between zones.
i = the production zone.
j = the attraction zone.
z = any zone.
n = the number of zones.
In simple terms this states that the trip productions in zone I will be distributed to each
zone J according to the relative attractiveness of zone J. Each J’s attractiveness is
determined by the product of its attractions and some function of the spatial separation
between I and J. The sum of the these products for all Js (relative to I) is obtained and
often referred to as the accessibility index for I. Each J will then be given a prorata share
of the productions for I based upon its attractiveness relative to the accessibility index for
I.
The function of spatial separation (func(T)) is the indefinite portion of the equation. It is
believed to be best described by an expression of the form of e^bT, where b is the curve
factor, and T is the travel time. Experience has shown that often a single curve does not
suffice, and it difficult to estimate what b should be used. To facilitate application, most
gravity model processes use a lookup function to obtain empirical values for the function
based upon the impedance. These curves are usually called friction factor curves.
Numerous applications have shown that friction factor curves tend to follow the same
patterns for similar conditions. Many agencies share the same curves when their regions
are similar in nature.
To implement the gravity model in Matrix, several guidelines must be followed:
• There must be a set of Ps and As for each purpose to be estimated. They are established
by the presence of a SETPA control statement.
• The gravity model equations must be executed in a specific order. At least three
expressions are required. One to compute attractiveness for each J, one to sum them to
form the accessibility index for I, and one to distribute the productions based upon the
values and the accessibility index. Obviously, these expressions must be executed in the
proper order.
Exam ple 1
/* given:
The impedances are in the first matrix of file: IMP.MAT
The productions and attractions are in file: PA.ZDA
The friction factors are in file: FF.DAT
*/
FILEI MATI[1] = IMP.MAT,
ZDATI[1] = PA.ZDA,Z=#1,P1=#2,A1=#3
FILEO MATO[1] = OUT.MAT, MO=1
LOOKUP NAME=FF,LOOKUP[1]=#2,RESULT=#1,
FILE=FF.DAT, INTERPOLATE=Y
SETPA P[1]=ZI.1.P1, A[1]=ZI.1.A1
MW[1] = A[1] * FF(1,MI.1.1), PAF=P[1]/ROWSUM(1), MW[1]=PAF * MW[1]
GRAVITY PURPOSE=1, LOS=MI.1.1, FFACTORS=FF ; faster process
Distribution Program > Introduction to the Distribution program > Convergence: Iteration control
There really is no matrix yet. The totals are the values as obtained from the SETPA
control statements. The model goal is to fill in the matrix with values so that the totals will
match the totals shown. The row totals shown are the Desired Ps for each zone, and the
column totals are the Desired As. A set of A values internally named Used are set equal
to the Desired values. An iteration is performed and the Estimated results appear as:
After Iteration 1:
Zone 1 2 3 Total
1 57 24 19 100
2 64 106 30 200
3 102 61 137 300
Total 223 191 186 600
Use2 258 210 138
As dictated by the formulation, the row totals are correct. But, the Estimated column
totals do not quite match the Desired. The As for each zone are adjusted by a factor that
is computed as: Desired * Used / Estimated. Another iteration is performed, and the
results appear as:
After Iteration 2:
Zone 1 2 3 Total
1 60 24 16 100
2 67 108 25 200
3 113 66 121 300
Total 240 198 162 600
Use3 258 212 136
The Estimated column totals are still not exactly what is desired, so adjustments are
made to the used As, and another iteration is performed.
After Iteration 3:
Zone 1 2 3 Total
1 60 24 16 100
2 66 109 25 200
3 114 67 119 300
Total 240 200 160 600
Now the Estimated totals and the Desired totals match for all zones. The model is
completed. Further iterations would be useless; nothing would change.
In the real world, with many zones, it is not likely that all the Estimated totals would match
exactly with the Desired totals. As a matter of fact, in this simple three zone problem, the
totals did not match exactly (there were some slight differences in the decimal places).
But, the floating point values were close enough to be accepted as having matched.
How does the program decide when it should stop? There are two parameters that can
be used for controlling cutoff: MAXITERS and MAXRMSE.
MAXITERS specifies that no more than a specified number of iterations are to be
performed. The default is MAXITERS=3; this is usually sufficient for most gravity model
applications. Additionally, the program computes the root mean square error of the
differences in Estimated vs. Desired attractions (sqrt (Sum(diff^2) / (n-1)). If the
computed RMSE is less than MAXRMSE, a completion flag is set. The default is
MAXRMSE=10, but that may not always be a good choice for certain applications. In
the sample three zone problem the RMSEs for each iteration were computed as: 22.78,
2.08, and 0.26. The final value of 0.26 indicates that there were still some slight
differences in the Estimated and Desired, but as noted above, they were insignificant. If
the default MAXRMSE value had been used, the process would have cutoff after two
iterations.
Distribution Program > Introduction to the Distribution program > Multiple purposes
Multiple purposes
Usually a given application will consist of more than one purpose. Traditionally, at least
three internal purposes are estimated, with the most commonly used purposes being:
Home Based Work (HBW), Home Based Other (HBO), and Non Home Based (NHB).
There are other popular purpose stratification, but these are the most commonly used.
Often Internal-External and External-Internal and truck and taxi purposes are also
estimated; some analysts prefer to estimate them in a separate application, and some
prefer to do them all at once. With the Cube Voyager process, all the purposes can be
estimated in one application because the user has the ability to specify different gravity
equations for each of the purposes. Each purpose can have its own impedance matrix
and different formulation (functions, expressions, friction factors, etc.). The Ps and As
and lookup functions can be obtained from different sources.
There is one caveat: If convergence has not been reached for any purpose, and
MAXITERS has not been reached, another iteration will be processed with adjusted As
for all purposes. That is no concern; the results will not get worse. The MAXRMSE
parameter applies to the highest RMSE of all purposes. MATO files are written only on
the last iteration. If the iteration number is equal to the PARAMETERS MAXITERS
value, the program knows when the last iteration is being processed. But, convergence
could be obtained at some lower iteration. In that case the program will perform another
iteration, similar to the one just completed, but this time writing the MATO files. In other
words, if convergence is reached before MAXITERS, an additional iteration will be
performed in order to obtain the matrices. The use of PARAMETERS MATOEVERY will
preclude an additional iteration, but at the cost of additional time to write matrices during
each iteration.
The number of purposes is determined by the highest P[] or A[] index established via
the SETPA control statement. The program assumes that there will be purposes from
one, monotonically, through that highest index. Other COMP MW[]= statements may be
specified, but they will not be involved in any internal purpose editing. If the estimates
follow the same formulation, the set up is only slightly different from what is depicted,
above. Example 2 illustrates a typical setup for a three purpose application.
Distribution Program > Introduction to the Distribution program > Multiple purposes > Example 2: Three purpose - same P/A
and FF file for all purposes
Exam ple 2: Three purpo se - sam e P/A and FF file fo r all purpo ses
LOOKUP FILE=FF.DAT, INTERPOLATE=Y, NAME=FF,
LOOKUP[1]=1,RESULT=2,
LOOKUP[2]=1,RESULT=3,
LOOKUP[3]=1,RESULT=4
SETPA P[1]=ZI.1.P1, A[1]=ZI.1.A1,
P[2]=ZI.1.P2, A[2]=ZI.1.A2,
P[3]=ZI.1.P3, A[3]=ZI.1.A3
LOOP PURP=1,3
MW[PURP] = A[PURP] * FF(PURP,MI.1.1)
PAF=P[PURP]/ROWSUM(PURP)
MW[PURP]=PAF*MW[PURP]
ENDLOOP
In Example 3, purposes 1-3 are the same as in Example 2, and two internal-external
purposes (with entirely different formulation) are to also be included. Purpose 4 uses an
equation for distribution, and purpose 5 uses a simple lookup curve, with only three
points in it.
Distribution Program > Introduction to the Distribution program > Multiple purposes > Example 3
Exam ple 3
LOOKUP FILE=FF.DAT, INTERPOLATE=Y, FAIL=12000,1,0, NAME=FF,
LOOKUP[1]=1,RESULT=2,
LOOKUP[2]=1,RESULT=3,
LOOKUP[3]=1,RESULT=4
LOOKUP NAME=XIFF, FAIL=500,100,
R= '500 1-20', ; read the data directly
'400 20-30',
'300 30-40',
'200 40-50'
SETPA P[1]=ZI.1.P1, A[1]=ZI.1.A1,
P[2]=ZI.1.P2, A[2]=ZI.1.A2,
P[3]=ZI.1.P3, A[3]=ZI.1.A3
SETPA P[4]=ZI.2.PI, A[4]=ZI.3.STACNT_OB,
P[5]=ZI.2.AI, A[5]=ZI.3.STACNT_IB
LOOP PURP=1,3
IF (PURP <= 3)
MW[PURP] = A[PURP] * FF(PURP,MI.1.1)
ELSEIF (PURP==4)
JLOOP INCLUDE=1-500
IMP = MI.2.IMPEDNACE
IF (MI.2.DISTANCE < 3) IMP = MI.2.SHORTIMP
MW[4] = A[4]*EXP(-B * IMP)
ENDJLOOP
ELSE
MW[5] = A[5] * XIFF(MI.2.IMPEDANCE) INCLUDE=501-535
ENDIF
PAF=P[PURP] / ROWSUM(PURP),
MW[PURP]=PAF*MW[PURP]
ENDLOOP
Of course, there are different ways that this distribution could have been written. Most
likely, the purpose 4 and 5 Ps and As would not sum to the same total because they
were derived from separate sources. If there is a difference in the totals for a purpose,
the program issues a message and adjusts the As to match the P total. Differences in
the totals would preclude convergence via RMSE calculations because there would
always be differences.
Distribution Program > Introduction to the Distribution program > Referencing productions and attractions
This statement indicates that the first four values from each record will be used. Field 1
will be the travel time value, and fields 2, 3, and 4 are the values for purpose 1, 2, and 3,
respectively. The friction factor for purpose 1 for 1 minute would be 9000, and the friction
factor for purpose 2 would be 8000. The friction factor for purpose 1 for a time value of
1.5 could be either 9000 or 8500, depending upon the options specified on the
LOOKUP statement. If SETUPPER=T is specified, the friction factor will be 9000, and if
SETUPPER=F and INTERPOLATE=T, the friction will be 8500. This capability allows
for compatibility with other model systems.
In this example, a time value of 0.5 will result in the value 9000, because there is no
explicit FAIL[1] specified. The friction for any value greater than 51 will be 0; no
distribution. If the record for 51 were not in the file, the friction factor for any time greater
than 50 would be 1. However, if FAIL[2]=0 were used, any time greater than 50 would
be 0. It is recommended that a final value of 0 be used to preclude distribution to zones
where the I-J time exceeds a certain value. This can also be controlled by use of the
LOSRANGE keyword on the GRAVITY statement.
Distribution Program > Control statements
Control statements
Most of the standard Matrix program statements are valid in the Distribution program,
and a few additional ones are available.
Since the Distribution program is a subset of the Matrix program, it is assumed that the
user is familiar with the Matrix-program control statement set. Only the differences
between the Matrix and Distribution control statements are included in this section. For
descriptions of other control statements see “Control statements” on page 545 under the
Matrix program.
Matrix program statements no t allowed in the Distribution program:
• RENUMBER
• GRAVITY
• REPORT ACOMP=
Distribution Program > Control statements > GRAVITY
GRAVITY
Performs a standard gravity model. Keywords include:
• FFA CT OR S
• KFA CT OR S
• LOS
• LOS R A N GE
• P U R P OS E
This statement is used to have the program compute a distribution based upon
traditional gravity model formulation for a single purpose. It is more efficient than using
multiple COMP statements to formulate the same process.
GR A V IT Y k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
lookup fail=12000,1,0, list=n, file=tstff1, name=ff,
lookup[1]=1,result=2,
lookup[2]=1,result=3,
lookup[3]=1,result=4,
lookup[4]=1,result=5,
lookup[5]=1,result=6,
interpolate=y,setupper=n
gravity purpose=1, los=mw[11], ffactors=ff
gravity purpose=2, los=mw[11], ffactors=ff, losrange=11-48
gravity purpose=3, los=mw[11], ffactors=ff
gravity purpose=4, los=mw[11], ffactors=ff
gravity purpose=5, los=mw[11], ffactors=ff, Kfactors=MI.1.K5
Distribution Program > Control statements > PARAMETERS
PARAMETERS
Sets general parameters. Keywords include:
• MA T OE V E R Y
• MA XIT E R S
• MA XR MS E
• ZON E S
Ke y wo rd D e s c rip tio n
REPORT
Specifies Matrix program reports. Keywords and subkeywords include:
• A COMP
m ITERATIONS
R E P OR T k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
REPORT ACOMP=1-3,5 ITERATIONS=5,10,99 ; specified purposes and iterations
REPORT ACOMP=6 ; for all iterations
Distribution Program > Control statements > SETPA
SETPA
Establishes base productions and attractions. Keywords include:
• A
• E XCLU D E
• IN CLU D E
• P
The SETPA statement is required; if it is not included, the program will fatally terminate.
The statement defines to the program how the desired productions and attractions are to
be obtained, and how many purposes are to be processed. There should be a P[]= and
A[]= expression for every purpose beginning with 1 and continuing, monotonically, until
all purposes are defined. The highest index encountered establishes the number of
purposes.
If there are any holes in the purpose scheme, the program will issue a warning
statement. The total of the As should match the total of the Ps for each purpose. If the
totals differ by more than five percent of the P total, a message is issued. If the totals
differ by any amount, the As are scaled so that the A total will match the P total.
The Ps and As are computed from the expressions that are supplied. In most cases, the
expression will simply point to a ZDATI file variable. Complex expressions are allowed,
but the use of any variables in the expression could cause unpredictable results. In a
purpose where the Ps and As are the same for each zone, (NonHomeBased is a typical
example), it is acceptable to set the Ps, and then set the As equal to the Ps. The
SETPA expressions are computed in the order in which they appear in the control
stream, and they are computed only one time -- prior to the first iteration. For each array,
the expression is solved in a loop of J=1-Zones, and the results are stored in the A[n][J]
or P[n][J] cells. A and P may not have a zone index in the SETPA statement.
If the same purpose is referenced more than one time (this is acceptable), the
subsequent values will replace the prior values. Duplication of purposes might be helpful
if values for different zones for a purpose are to be obtained from different sources, or if
different INCLUDE/EXCLUDE filters are to be used (separate SETPA statements must be
used for different filters).
S E T P A k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
SETPA INCLUDE=1-500, ; internal zone data only
P[1]=zi.1.p1, A[1]=zi.1.a1,
P[2]=zi.1.p2, A[2]=zi.1.a2,
P[3]=zi.1.nhb, A[3]=P[3],
P[4]=zi.2.cnt, A[4]=10 ; equal attraction for all zones
SETPA EXCLUDE=1-500, ; get only external data
P[1]=zi.1.p1, A[1]=zi.2.cnt, ; merges with prior SETPA
P[5]=sqrt(A[3]), A[5]=A[1]+A[2]+A[3] ; weird, but will work
Distribution Program > Examples and FAQ
• Example 2
•
Distribution Program > Examples and FAQ > Example 1
Example 1
RUN PGM=DISTRIBUTION
REPORT ZDAT=Y
ZDATI[1] = TSTPA1,Z=#1,P1=2,P2=3,P3=4,P4=5,P5=6,A1=7,A2=8,A3=9,A4=10,A5=11
MATI = IMPEDE.MAT
MATO = GMTRIPS, MO=1-5, NAME=HBW, HBO, NHB, IX, XI
LOOKUP FAIL=12000,1,0, LIST=N, FILE=TSTFF1, NAME=FF,
LOOKUP[1]=1, RESULT=2,
LOOKUP[2]=1, RESULT=3,
LOOKUP[3]=1, RESULT=4,
LOOKUP[4]=1, RESULT=5,
LOOKUP[5]=1, RESULT=6,
INTERPOLATE=N, SETUPPER=Y
MAXITERS=3 MAXRMSE=10
SETPA P[1]=ZI.1.P1 P[2]=ZI.1.P2 P[3]=ZI.1.P3 P[4]=ZI.1.P4 P[5]=ZI.1.P5
SETPA A[1]=ZI.1.A1 A[2]=ZI.1.A2 A[3]=ZI.1.A3 A[4]=ZI.1.A4 A[5]=ZI.1.A5
LOOP PURP=1,5 ;DO PURPOSES 1-5
MW[PURP] = A[PURP][J] * FF(PURP,MI.1.1)
SUMAF = ROWSUM(PURP)
IF (SUMAF > 0) MW[PURP] = P[PURP]/SUMAF * MW[PURP]
ENDLOOP
ENDRUN
Distribution Program > Examples and FAQ > Example 2
Example 2
This is Gravity application illustrating several ways to do a gravity model.
RUN PGM=DISTRIBUTION
REPORT ZDAT=Y
ZDATI[1]=TSTPA1,Z=#1,
P1=2, P2=3, P3=4, P4=5, P5=6,
A1=7, A2=8, A3=9, A4=10, A5=11
MATI[1]=C:\DEMO\DEMO11.DAT
SETPA P[1]=P1 P[2]=P2 P[3]=P3 P[4]=P4 P[5]=P5
SETPA A[1]=A1 A[2]=A2 A[3]=A3 A[4]=A4 A[5]=A5
LOOKUP FAIL=12000,1,0, LIST=N, FILE=TSTFF1, NAME=FF,
LOOKUP[1]=1, RESULT=2,
LOOKUP[2]=1, RESULT=3,
LOOKUP[3]=1, RESULT=4,
LOOKUP[4]=1, RESULT=5,
LOOKUP[5]=1, RESULT=6,
INTERPOLATE=Y, SETUPPER=N
MAXITERS=20 MAXRMSE=35
MW[11]=MI.1.1
LOOP PURP=1,5 ; distribute with user equation (Results in MW[6-10])
PP = PURP+5
MW[PP] = A[PURP][J]*FF(PURP,MW[11])
SUMAF = P[PURP]/ROWSUM(PP)
MW[PP] = SUMAF*MW[PP]
ENDLOOP
/* Now do same distribution with gravity statements(more efficient) */
GRAVITY PURPOSE=1, LOS=MW[11], FFACTORS=FF
GRAVITY PURPOSE=2, LOS=MW[11], FFACTORS=FF
GRAVITY PURPOSE=3, LOS=MW[11], FFACTORS=FF
GRAVITY PURPOSE=4, LOS=MW[11], FFACTORS=FF
GRAVITY PURPOSE=5, LOS=MW[11], FFACTORS=FF
ENDRUN
Distribution Program > Examples and FAQ > Distribution example 3 - HBW gravity model using gamma impedance function
Exam ple
A[1] = 1 ; sets only 1 cell
P[1] = A[1] ; sets only 1 cell
/* Adjustment Phase — Set A[1] to total to P[1] total
Move A[1] to P[1] (maybe NHB)
fac = ptot(1) / atot(1) a[1]=fac * a[1] ; would be the same
*/
PHASE=ADJUST
A[1] = P[1][0] / A[1][0] * A[1]
P[1] = A[1]
The FILEO PAO keyword is used to write the computed P and A values to file records.
Generation Program > Control statements
Control statements
Most of the standard Matrix program statements are valid in the Generation program,
and a few additional ones are available. Since the Generation program is a subset of the
Matrix program, it is assumed that the user is familiar with the Matrix control statement
set. Only the differences between the Matrix and Generation control statements are
included in this section. For descriptions of other control statements see “Control
statements” on page 545.
Matrix statements no t allowed in Generation:
• FREQUENCY
• PRINTROW
• RENUMBER
• FILEO MATO=
• COMP MW=
• PARAMETERS MAXMW=
• COMP A= P=
• PARAMETERS MAXPURPS =
BALANCE
This statement is used to specify how the trip ends are to be adjusted in the
Phase=Adjust process. Keywords include:
• A 2P =list
• N H B =list
• P 2A =list
This statement makes the adjustment process much simpler. Typically, most users
adjust the Attraction totals to match the Production Totals.
B A LA N CE k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
BALANCE A2P=1,2,4-7 NHB=3
Generation Program > Control statements > COMP
COMP
Computes a variable, P/A row, or P/A row element. Keywords include:
• V A R =expression (see Matrix “COMP ” o n p a g e 576)
• A[n][I]=expression
• P[n][I]=expression
The COMP statement is probably the most important of all the statements in the program.
It is used to compute variable and P and A array values. The reader is advised to read
“Introduction to Generation program” on page 689 for information concerning the
differences in array computation within the ILOOP and ADJUST phases. The major
difference between the Generation and Matrix programs for COMP statements is in the
use of P/A[] and MW[]. First of all, MW[] is not valid in the Generation program.
Secondly, COMP P[]=, A[]=, and MW[]= expressions automatically imply a loop based
upon J from 1 to zones in the Matrix program. While in the Generation program, when
P[]= or A[]= is specified in the ILOOP phase, the J loops from I to I (a single iteration).
Within the ADJUST phase, the J loops from 1 to zones. See “COMP” on page 576 for
details of COMP statements.
The COMP statement may contain INCLUDE and EXCLUDE to cause selective processing.
COMP k e y wo rd s
Ke y wo rd D e s c rip tio n
Expressions may contain the functions ATOT (#) and PTOT (#), which return the attraction
and production totals for purpose #.
Generation Program > Control statements > COMP > Example
Exam ple
COMP P[1]= ZI.1.P1
COMP A[2]=0.90*ahbo
IF (I=38-49) P[1]=ZI.4.SPECIAL
Generation Program > Control statements > FILEO
FILEO
Generates trip-end records. Keywords and subkeywords include:
• PAO
m CFORM
m DBF
m FORM
m LIST
m NAMES
m PRINT
The PAO keyword is used to request that a file containing trip end records be written at
the end of all stack processing. There may be multiple PAO specifications; each one
should reference a different file. They will be processed in the order in which they appear
in the input stream. The flexibility of the statement can allow records to be written in
almost any format that other software systems might require. Within Cube Voyager, the
most likely place where this data would be read would be in any program that accepts
ZDATI files; usually it should be written in a format such that the Distribution process can
read it as the distribution trip ends. Although other data can be placed on these records,
normally, the records should contain only the zone number (I), and the various trip ends
such as P[1], a[1], etc.
For consistency, the PAO processing uses the Cube Voyager General PRINT control
statement processor. The PRINT processor is called one time for each zone in a loop
where Z=1-Zones. The major difference between PAO and PRINT statement is that
PAO specifies the output file by definition, and the FILE keyword is not allowed. Full
documentation about the sub-keywords can be found in “PRINT” on page 69.
PAO can be optionally written as a DBF by setting DBF=T or to an MDB by designating
the output MDB file name followed by a backslash and the element name.
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
PAO = OUTPUT.DAT, FORM=8.0,
LIST = Z(2) P[1] P[2] P[3] P[4] P[5] A[1] A[2] A[3] A[4] A[5] PRINT=N
PAO[2] = OUTPUT2.DAT, FORM=SL, Z P[1] A[1] P[2] A[2] (P[3]+P[4]) (A[3]+A[4])
Generation Program > Control statements > PARAMETERS
PARAMETERS
Set general parameters. Keywords include:
• MA XP U R P S
• ZON E S
P A R A ME T E R S k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
ZONES=3000 MAXPURPS=5
Generation Program > Control statements > PROCESS ... ENDPROCESS
• ENDPHASE
A user process phase stack is defined by a PROCESS statement that designates its
beginning and an ENDPROCESS statement that designates its ending. To simplify coding,
the PROCESS control word is not necessary; PHASE=name may be used directly. And, to
further simplify coding, the ENDPROCESS statement is not necessary; the occurrence of
another PROCESS statement acts as the ENDPROCESS statement. If ENDPROCESS is used, it
may be coded as either ENDPROCESS or ENDPHASE. In the Generation program, normally,
only the PHASE=ADJUST statement is all that is needed to differentiate between the normal
ILOOP statements and the ADJUST statements that are used to balance the final Ps and
As.
P R OCE S S k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
RUN PGM=GENERATION
.
P[1]=….
.
.
PHASE=ADJUST
; the following statements are used to balance Ps and As
RUN PGM=GENERATION
.
PHASE=ILOOP
P[1]=….
.
PHASE=ADJUST
; the following statements are used to balance Ps and As
Generation Program > Control statements > REPORT
REPORT
Requests reports and establishes tracing. Keywords include:
• AC
• A
• PC
• P
• T R A CE
R E P OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
REPORT AC=y A=y P=y
Generation Program > Examples and FAQ
• Example 2
Example 1
RUN PGM=GENERATION
ID=DEMO TRIP GENERATION
pagewidth=80
zones=19
zdati[1]=c:\demo\demo08.dat,z=#2,select=1-1,
hh1=#3,hh2=#4,hh3=#5,hh4=#6,hh5=#7,hh6=#8,hh7=#9,
hh8=10,hh9=11,hh10=12,hh11=#13,hh12=#14,hh13=#15
zdati[2]=c:\demo\demo08.dat,z=#2, select=2-1, emp1=3,emp2=4
zdati[3]=c:\demo\demo08.dat,z=2-4,select=3-1, p3a=21-25,p4a=31-35
zdati[4]=c:\demo\demo08.dat,z=2-4,select=4-1, xicnt=6-10,ixcnt=11-15
report zdat=y
tothh = zi.1.hh1 + zi.1.hh2 + zi.1.hh3 + zi.1.hh4 + zi.1.hh5 + zi.1.hh6 +
zi.1.hh7 + zi.1.hh8 + zi.1.hh9 + zi.1.hh10 + zi.1.hh11 + zi.1.hh12 +
zi.1.hh13
totemp = zi.2.emp1 + zi.2.emp2
phbw = .21 * 4.5 * zi.1.hh1 + .21 * 6.8 * zi.1.hh2 +
.18 * 8.4 * zi.1.hh3 +
.18 * 10.2 * zi.1.hh4 + .18 * 11.9 * zi.1.hh5 +
.16 * 13.2 * zi.1.hh6 + .16 * 14.4 * zi.1.hh7 +
.16 * 15.1 * zi.1.hh8 + .15 * 16.4 * zi.1.hh9 +
.14 * 17.7 * zi.1.hh10 + .13 * 18.0 * zi.1.hh11 +
.13 * 19.0 * zi.1.hh12 + .13 * 19.2 * zi.1.hh13
phbo = .57 * 4.5 * zi.1.hh1 + .57 * 6.8 * zi.1.hh2 +
.57 * 8.4 * zi.1.hh3 + .59 * 10.2 * zi.1.hh4 +
.59 * 11.9 * zi.1.hh5 + .61 * 13.2 * zi.1.hh6 +
.61 * 14.4 * zi.1.hh7 + .68 * 15.1 * zi.1.hh8 +
.62 * 16.4 * zi.1.hh9 + .62 * 17.7 * zi.1.hh10 +
.62 * 18.0 * zi.1.hh11 + .62 * 19.0 * zi.1.hh12 +
.62 * 19.2 * zi.1.hh13
pnhb = .22 * 4.5 * zi.1.hh1 + .22 * 6.8 * zi.1.hh2 +
.22 * 8.4 * zi.1.hh3 + .23 * 10.2 * zi.1.hh4 +
.23 * 11.9 * zi.1.hh5 + .23 * 13.2 * zi.1.hh6 +
.23 * 14.4 * zi.1.hh7 + .23 * 15.1 * zi.1.hh8 +
.23 * 16.4 * zi.1.hh9 + .24 * 17.7 * zi.1.hh10 +
.25 * 18.0 * zi.1.hh11 + .25 * 19.0 * zi.1.hh12 +
.25 * 19.2 * zi.1.hh13
pix = 0.03 * 1.03 * (phbw+phbo+pnhb)
pxi = zi.4.xicnt
ahbw = 1.81 * ( 1.7 * totemp)
ahbo = 1.90 * (10.0 * zi.2.emp1 + 0.5 * zi.2.emp2 + tothh)
anhb = 1.49 * ( 2.0 * zi.2.emp1 + 2.5 * zi.2.emp2 + 0.5*tothh)
axi = 0.08*ahbw + 0.10*ahbo + 0.03*anhb
aix = zi.4.ixcnt
p[1]=phbw, p[2]=phbo, p[3]=pnhb, p[4]=pix, p[5]=pxi
a[1]=0.92*ahbw a[2]=0.90*ahbo a[3]=0.97*anhb a[4]=aix, a[5]=axi
phase=adjust
a[1] = p[1][0] / a[1][0] * a[1]
a[2] = p[2][0] / a[2][0] * a[2]
a[3] = p[3][0] / a[3][0] * a[3]
p[3] = a[3]
a[4] = p[4][0] / a[4][0] * a[4]
p[5] = a[5][0] / p[5][0] * p[5]
pao=out.dat,form=8.0 list=z(2),p[1],p[2],p[3],p[4],p[5],a[1],a[2],a[3],a[4],a[5]
ENDRUN
Generation Program > Examples and FAQ > Example 2
Example 2
RUN PGM=GENERATION
FILEI ZDATI[1]=zonedata.dbf ; dbf data structure is Z, V1, V2,...., V254
FILEI ZDATI[2]=zonedata.dbf ; External PA file. dbf data structure is Z,
; Xprod1,Xprod2,Xprod3,Xattr1,Xattr2,Xattr3 for example
; These fields could also be fields on your zone data
file
; ZDATI[1] as well.
FILEO PAO[1] = "TRIPENDS.DBF",
FORM=6.0, DBF=T, LIST=Z, P[1] P[2] P[3] A[1] A[2] A[3]
; lets say system has 1000 zones with 901-1000 being the externals
; and we have 3 trip purposes
PARAMETERS ZONES=1000
PROCESS PHASE=ILOOP
; define trip rates by purposes
; purpose = home based
hbp_p = 0.2 ; production trip rate per person (population) per day
hbp_ia = 0.5 ; production trip rate per industry/agricultural worker per day
hbp_s = 0.6 ; production trip rate per service worker per day
hbp_r = 40.0 ; production trip rate per retail worker per day (incl shoppers)
hbp_sc = 0.1 ; production trip rate per pupil/student per day
hba_p = 1.8 ; attraction trip rate per person (population) per day
hba_ia = 0.6 ; attraction trip rate per industry/agricultural worker per day
hba_s = 0.6 ; attraction trip rate per service worker per day
hba_r = 45.0 ; attraction trip rate per retail worker per day (incl shoppers)
hba_sc = 0.1 ; attraction trip rate per pupil/student per day
; purpose = non-home based
nhbp_p = 1.5 ; production trip rate per person (population) per day
nhbp_ia = 0.3 ; production trip rate per industry/agricultural worker per day
nhbp_s = 0.25 ; production trip rate per service worker per day
nhbp_r = 12 ; production trip rate per retail worker per day (incl shoppers)
nhbp_sc = 0.1 ; production trip rate per pupil/student per day
nhba_p = 1.3 ; attraction trip rate per person (population) per day
nhba_ia = 0.3 ; attraction trip rate per industry/agricultural worker per day
nhba_s = 0.3 ; attraction trip rate per service worker per day
nhba_r = 14.0 ; attraction trip rate per retail worker per day (incl shoppers)
nhba_sc = 0.1 ; attraction trip rate per pupil/student per day
; purpose = school
schp_p = 0.15 ; production trip rate per person (population) per day
schp_ia = 0 ; production trip rate per industry/agricultural worker per day
schp_s = 0.005 ; production trip rate per service worker per day
schp_r = 0.005 ; production trip rate per retail worker per day
schp_sc = 0.95 ; production trip rate per pupil/student per day
scha_p = 0.15 ; attraction trip rate per person (population) per day
scha_ia = 0 ; attraction trip rate per industry/agricultural worker per day
scha_s = 0.005 ; attraction trip rate per service worker per day
scha_r = 0.005 ; attraction trip rate per retail worker per day
scha_sc = 0.95 ; attraction trip rate per pupil/student per day
IF (I<=900) ; define P/A functions for internal zones
; ----- calculate productions per day by purpose
; zi.1.vnames are just the filed names in the dbf file
P[1] = (hbp_p*zi.1.pop_2002 + hbp_ia*zi.1.inag_2002 + hbp_s*zi.1.serv_2002 +
hbp_r*zi.1.ret_2002 + hbp_sc*zi.1.sch_2002)
P[2] = (nhbp_p*zi.1.pop_2002+ nhbp_ia*zi.1.inag_2002+ nhbp_s*zi.1.serv_2002+
nhbp_r*zi.1.ret_2002+ nhbp_sc*zi.1.sch_2002)
P[3] = (schp_p*zi.1.pop_2002+ schp_ia*zi.1.inag_2002+ schp_s*zi.1.serv_2002+
schp_r*zi.1.ret_2002+ schp_sc*zi.1.sch_2002)
; ----- calculate attractions per day by purpose
; zi.1.vnames are just the filed names in the dbf file
A[1] = (hba_p*zi.1.pop_2002 + hba_ia*zi.1.inag_2002 + hba_s*zi.1.serv_2002 +
hba_r*zi.1.ret_2002 + hba_sc*zi.1.sch_2002)
A[2] = (nhba_p*zi.1.pop_2002+ nhba_ia*zi.1.inag_2002+ nhba_s*zi.1.serv_2002+
nhba_r*zi.1.ret_2002+ nhba_sc*zi.1.sch_2002)
A[3] = (scha_p*zi.1.pop_2002+ scha_ia*zi.1.inag_2002+ scha_s*zi.1.serv_2002+
scha_r*zi.1.ret_2002+ scha_sc*zi.1.sch_2002)
ELSE ; define P/A for external zones
P[1]=zi.2.Xprod1
P[2]=zi.2.Xprod2
P[3]=zi.2.Xprod3
A[1]=zi.2.Xattr1
A[2]=zi.2.Xattr2
A[3]=zi.2.Xattr3
ENDIF
PROCESS PHASE=ADJUST
; adjust zonal attractions so total attractions match total productions
BALANCE A2P=1,3 NHB=2 ; balance attrs to prods for purposes 1, 3
; prods set to attrs for purpose 2
ENDPHASE
ENDRUN
Generation Program > Examples and FAQ > Frequently asked questions
Overview
The Public Transport program is the Cube Voyager program that lets you prepare public
transport data and model public transport systems. This section provides an overview of
the Public Transport program, listing the program’s primary capabilities, required inputs
and generated outputs, and discussing how you can use the program to prepare data
and model public transport systems. This section also discusses terminology used
within this document.
Topics include:
• Summary of facts
• Preparing data
• Modeling
• Heuristic Process
• Terminology
Public Transport Program > Overview > Summary of facts
Summary of facts
The Public Transport program offers:
• User control over all aspects of the Public Transport model
• True multirouting between zone pairs, or alternatively single best-path routes may be used
• Demand stratification by user class with variations in the behavior of classes represented
by different cost functions
• Generation of the nontransit element of the public transport network (that is, access,
egress, transfer and park and ride legs)
• Skimming, network-wide and mode specific, composite and average travel costs, and
components of costs
• Reporting of input data, model infrastructure, multiple routes with probability of use, line
and link loads, secondary analyses
• Line data
• Fare data
• Demand
• Enumerated routes
• Skim and select-link matrices
• A public transport network that can be displayed by Cube and used as an input network for
further modeling
Public Transport Program > Overview > Preparing data
Preparing data
You can use the Public Transport program to prepare data that supports public transport
modeling. You can prepare:
• A network, produced by Network or Public Transport, containing characteristics of zones,
nodes and links (that is, node coordinates, walk and transit link times, distance, and so
forth), over which the public transport system operates.
• System information used to describe the characteristics of the public transport system such
as modes, operators and wait curves.
• Service or line data, defining the characteristics of the lines and nodes traversed.
• Nontransit legs, presenting opportunities to access the public transport system, egress
from it and transfer between services during the course of a trip. Nontransit legs may be
determined externally and/or generated by Public Transport under user control.
Modeling
You can use the Public Transport program to model public transport. The model has
several parts:
• Route enumeration and evaluation
• Loading (assignment)
• Reporting
Public Transport Program > Overview > Modeling > Route enumeration and evaluation
• Waiting time, derived from the combined frequency of services at stop nodes
• Value of choice
• Average, perceived, and actual trip costs and components (that is, nontransit, in-vehicle
and wait times, boarding and transfer penalties, fares)
The model can extract network-wide trip costs, or the model can stratify them, where
appropriate, by modes.
Public Transport Program > Overview > Modeling > Loading (assignment)
Loading (assignment)
During loading, the Public Transport model loads demand, in the form of trips between
zone pairs. The model uses a series of models at the different decision points in a trip:
• The walk-choice model allocates trips between attractive choices at access, egress, and
transfer points. Where walk and transit choices are available, it also determines the transit
share.
(Strictly, these models determine the probability of use of the alternative routes; trips are
then loaded on the routes based upon these probabilities.)
Two forms of loading are supported, multirouting and best-path. The best-path method
does not use walk or alighting choice models, and loads demand using the service-
frequency model.
Public Transport Program > Overview > Modeling > Reporting
Reporting
During reporting, the Public Transport model produces reports you can use to analyze
different aspects of passenger loadings:
• Passenger transfers between all modes
Heuristic Process
The Public Transport modeling algorithm implements a sequence of rules (network
simplification > minimum path > enumeration > evaluation (decision points probabilistic
models > combination of probabilities at the different decision points) / iterative route
evaluation step in case of crowding) to find an "approximate/feasible solution" close to
the optimal solution. This approach can be defined an heuristic process.
It is therefore important that once the model is defined in terms of the system, lines and
parameters, this fundamental structure of the Public Transport model is kept consistent
with the analysis that needs to be undertaken in different scenarios. The results from the
model could be sensitive to major changes in the inputs due to the heuristics in network
simplification, route enumeration and evaluation.
This consistency between the base scenarios and the forecasting scenarios is a general
rule that should be followed, referring to the attributes coded to describe the Public
Transport model (modes numbering system, etc.). In particular, the line ordering should
be defined in the base scenario, and the model should be calibrated accordingly. This
line ordering, consolidated in the base scenario, should be kept consistent in forecasting
scenarios, whilst new lines should be added at the end of the line file or in a new line file.
Public Transport Program > Overview > Terminology
Terminology
This document uses the following sets of terms interchangeably:
• ”transit” and “public transport.” In particular, “transit” is used in this document to describe a
type of link over which a public transport service can run, namely “transit link” as opposed
to “nontransit link.”
Processes
The Public Transport program performs the following processes:
• Network development
• Route enumeration
• Route evaluation
• Loading
• Select link
• Loading analyses
• Crowd modeling
Some processes have associated phases which allow you to augment the task with
additional context-sensitive computations.
You control the main processes and their associated phases, within a prescribed
hierarchy.
Public Transpo rt pro gram pro cesses and asso ciated phases
(With multiple user classes, processes in the blue boxes are performed separately for
each class.)
See “Phases” on page 747 for a description of the phases in the Public Transport
program.
You configure the Public Transport program to run through a specific combination of
control statements and phases.
Control statements are either static or dynamic. Static statements may be present
anywhere in the job stream; the program evaluates them once. Dynamic statements
may be present only within phases; the program evaluates them as encountered, during
the execution of the phases.
Only context-sensitive dynamic control statements are available to the phases; the
description of each phase lists valid control statements (see “Phases” on page 747).
Only code phases that contain control statements; do not code empty phases.
Public Transport Program > Processes > Network development
Network development
During network development, the Public Transport program:
• Reads in the input network from FILEI N E T I.
• Develops a comprehensive public transport network from the basic network, public
transport system data, lines, nontransit leg, and control information. This includes stringent
validation and consistency checks to ensure that the different components of the public
transport network are compatible.
The DATAPREP phase is mandatory for public transport network development. The
phase provides the control statements for nontransit leg generation and/or input.
Either the Network program or the Public Transport program can produce the input
network. However, only zone, node, and link information are taken from networks
produce by the Network program; you must provide public transport system, line, and
control data.
The components of the public transport network are common to all user classes, except
for route-enumeration and route-evaluation control information, which may be provided
separately for each class.
See “Public transport network development” on page 1017 for examples of this task.
Inp uts re q uire d fo r P ub lic T ra ns p o rt ne two rk d e v e lo p me nt
The Public Transport network is made available to any other processes in the job
stream that require it. If trips are loaded in the run creating the public transport network,
all output files can optionally contain the results of the loading.
The saved Public Transport network may be used in subsequent runs of the Public
Transport program for route enumeration, route evaluation, skimming, loading and
loading analyses. It contains all information required for these processes apart from
fares data which may optionally be read later, so allowing it to vary between program
runs.
You can use Cube to display but not edit the Public Transport network.
Public Transport Program > Processes > Network development > Associated phases
• DATAPREP (mandatory)
Public Transport Program > Processes > Route enumeration
Route enumeration
During route enumeration, the Public Transport program identifies sets of discrete routes
between zone pairs, which have some probability of being used by passengers to travel
between the zones. Route enumeration is a heuristic process, which you control with the
FACTORS statement.
This set of discrete routes may be pruned at the route-evaluation stage, in compliance
with further user specified controls.
A ROUTEO file in the job stream invokes route enumeration. You can save an
enumerated routes file and input the file to a subsequent run with ROUTEI.
When modeling multiple user classes, provide separate FACTORS statements for each
class to produce enumerated route files for each class.
By default, Public Transport enumerates routes for all zone pairs. However, you can use
ROUTEI and ROUTEO statements to select zone pairs separately for route enumeration
and reporting.
See “Route-enumeration process” on page 959 for theory about route enumeration.
Inp uts re q uire d fo r P ub lic T ra ns p o rt ro ute e nume ra tio n
NOTE: Vast quantities of data can be required to define a public transport system. To
improve performance of the main algorithms and minimize memory and temporary disk
storage, the data is organized in a highly compressed form for processing and storing
routes. The line data is converted into transit legs and the network data into nontransit
legs. The simplified network, which is described in “Network simplification” on page 947,
can be examined through a series of reports specified on the REREPORT statement.
Public Transport Program > Processes > Route enumeration > Associated phases
• None
Public Transport Program > Processes > Route evaluation
Route evaluation
During route evaluation, the Public Transport program:
• Examines enumerated routes
• Eliminates any illogical ones that have crept in due to network simplification
• Identifies routes that have, at the minimum, a user specified probability of use or more, at
every decision point along the route
The route-evaluation process is a prerequisite for the skimming, select-link, loading, and
loading-analyses processes. Selecting one or more of these processes automatically
invokes the route-evaluation process.
This is because only enumerated routes are saved; they are evaluated as required.
(Enumerated routes produced by an earlier run may be input with ROUTEI for evaluation
or generated by specifying a filename with ROUTEO).
Evaluated routes may be reported with ROUTEI and ROUTEO.
See “Route-evaluation process” on page 965 for the theory supporting route evaluation.
Inp uts re q uire d fo r P ub lic T ra ns p o rt ro ute e v a lua tio n
NOTE: Any previously built NETI and ROUTEI files that you input must be compatible.
1 Produced for each zone pair. Can be reported by zone pair, but not saved.
The skimming, select-link, loading, and loading-analyses processes are performed on
the fly. Indeed, these are by-products of the route-evaluation process, but described
separately, as they report on different aspects of the Public Transport model.
Public Transport Program > Processes > Route evaluation > Associated phases
• MATI
• SELECTIJ
Public Transport Program > Processes > Skimming (level of service)
• “Public transport skimming” on page 1022 for a comprehensive example of the skimming
process.
NOTE: All skim matriceshave their intrazonal cells on the diagonal, and the cells for
unconnected IJ pairs, set to zero. These can be reset to large values, either in the
MATO phase or outside the Public Transport program, for modeling demand.
Skimming overview
Inp uts re q uire d fo r P ub lic T ra ns p o rt s k imming
NOTE: If previously built files are input with NETI and ROUTEI, the files must be
compatible.
• SKIMIJ (mandatory)
• MATO
Public Transport Program > Processes > Skimming (level of service) > Skimming arguments and syntax
• SkimName(Arg1, Arg2)
• SkimName
where:
• SkimName includes an explicit prefix, or a default, that denotes its type:
m
COMP for composite skims
m
CWD for crowded skims
m
BEST for best skims
m
All other skims are average skims
• Arg1 is the route set number and currently supports one route set, or Arg1=0. In this case
the attribute skimmed is the total for the zone pair.
Example 1 : Shows how skims requiring one argument are invoked.
MW[2]=COMPCOST(0)
MW[3]=ValOfChoice(0)
MW[4]=IWAITA(0)
The result is the skim for the route set which is also the overall skim for the OD pair
(route set).
• Arg2 is a list of modes for which the skim is required. For example, Arg2= 3 would provide
a skim for mode 3 while Arg2=1,2,3,4,5 would produce one skim for modes 1 through 5.
This could also be written as 1,-5.
Note that range specification for skim functions is different from the standard
specification for Cube Voyager. The arguments in skim functions are evaluated as
expressions. So, the standard way of specifying ranges, Arg2=1-5 would result in
Arg2=-4. Combinations such as 1,3,-5,7,9,-12 are valid.
Example 2 :
Shows how skim functions requiring two arguments are invoked. The
second argument is a single number or a list of single numbers and pairs specifying
ranges. MW[7] will contain a DIST skim for mode 1, MW[8] will contain a TIMEA
skim for modes 1,7,8,9,11,31,32,and 33, MW[9] for modes 1,7,8,9,11 which happen
to be the transit modes in the system and MW[10] for modes 31,32,33 which are
nontransit modes.
MW[7] = DIST(0,1)
MW[8] = TIMEA(0,1,7,-9,11,31,-33)
MW[9] = TIMEA(0,1,7,-9,11)
MW[10] = TIMEA(0,31,-33)
If skims are required for all, transit or nontransit modes, an alternative way to specify
Arg2 is ALLMODES, TMODES or NTMODES (case insensitive).
Example 3 :
Shows an alternative method for invoking skim functions requiring two
arguments. Here, Arg2 is text rather than a list; MW[8] will contain a TIMEA skim for
all modes, MW[9] for transit modes and MW[10] for nontransit modes.
MW[11] = TIMEP(0,ALLMODES)
MW[12] = TIMEP(0,TMODES)
MW[13] = TIMEP(0,NTMODES)
Subsequent sections describe the types of skims that can be extracted and their
contents.
Public Transport Program > Processes > Skimming (level of service) > Wait-time skim functions
M o netary units
FAREA(RouteSet, Mode)
Generalized co st units
FAREP(RouteSet, Mode)
• Boardings
• Composite cost
• Distance
• Excess demand
• Value of choice
Public Transport Program > Processes > Skimming (level of service) > Other skim functions > Best trip time
• Boarding penalties
NOTE: The
route followed by this best actual trip may differ from that found using
BESTPATHONLY as the latter route is selected on cheapest perceived travel cost.
Public Transport Program > Processes > Skimming (level of service) > Other skim functions > Boardings
Bo ardings
BRDINGS(RouteSet, Mode)
Co m po site co st
COMPCOST(RouteSet)
• Boarding time
• Transfer time
Distance
DIST(RouteSet, Mode)
• “Skimming arguments and syntax” on page 721 for detailed information on the functions
and syntax.
Loading
During the loading process, the Public Transport program assigns passenger demand,
in the form of trips, to the attractive routes between zone pairs. These routes have their
probability of use determined by the route evaluation process with a series of models:
• Walk-choice model
• Alternative-alighting model
The model theory is described in “Route-evaluation process” on page 965 and the
loading theory is described in “Loading process” on page 981.
Demand may be stratified by user class and loaded to enumerated routes generated
either by class or for the whole Public Transport network.
Loading is invoked by assigning, either input or generated trip matrices to TRIPSIJ[#], or
trips for individual zone pairs to the variable TRIPSIJ in the SELECTIJ phase.
The results of loading, passenger flows on lines, may be reported with the REPORT
statement. This can be done either in the run in which loading was performed or by
saving the loaded public transport network and reporting the loads in a subsequent run
of the program.
See “Public transport loading” on page 1024 for an example of this function.
Inp uts re q uire d fo r P ub lic T ra ns p o rt lo a d ing
• MATI
Public Transport Program > Processes > Select link
Select link
During the select-link process, the Public Transport program produces output matrices
of demand matching selection criteria, and can also perform select-link loading.
When you model multiple user classes, this process can produce select link outputs for
each class from the individual enumerated route files.
You can also use Cube Analyst to estimate Public Transport demand matrices. See
INTERCEPTO and SCREENLINEO in “FILEO” on page 825 for more information.
NOTE: If you input previously built NETI and ROUTEI files, they must be compatible.
• SKIMIJ (mandatory)
• MATO
Public Transport Program > Processes > Select link > Select-link functions
Select-link functions
The select-link function provides a range of facilities to identify travel demand using
particular links, lines, or nodes in the network. Lines may be identified explicitly or
selected based on their mode or operator attributes. Throughout this section the
functionality is referred to by the generic term “select link” although in practice it offers a
wider range of selection mechanisms.
The select-link function outputs a matrix, containing that demand which satisfies the
selection criteria. In a run, you may specify a series of selection criteria, each one being
associated for output purposes with a different working matrix. You can save the
resulting matrices to the FILEO MATO[n] where n is the user class being evaluated
(that is, select link results are saved to the same matrix file as skim outputs).
The process normally considers just transit legs using the link/line, or passing the node.
However, if required nontransit legs may be considered, or for nodes the activity may be
restricted to specific movements (for example, boarding a transit line).
The select-link criteria are defined as expressions, which allows compound conditions
(using and / or / not operations) to be specified.
You may specify additional keywords in the expression to obtain either percentage or
proportion of demand (rather than actual demand flow) satisfying the criteria. These
allow you to obtain results when demand flows for an I-J pair are zero.
The demand flows loaded onto the network may be restricted to just that demand which
meets the selection criteria. This permits the display of demand and loadings which use
the selected link. Where several select link functions are used in a run only one of them
may contain the keyword which triggers select-link based loading.
The general form of the select-link function is:
SELECTLINK (expression)
where the expression defines the selection criteria. This general form typically appears
on the right hand side of a COMP (compute) statement which sets the value of cells in a
particular working matrix, for example:
MW[MatrixNumber] = SELECTLINK (expression)
• Select line
• Select node
• Select mode
• Select operator
This identifies all demand traversing the link in the direction from the given A-node to the
B-node. To identify demand in either direction along the link a “*” is appended to the
specification:
L = ANode-BNode*
Examples:
MW[1] = SELECTLINK(L=1023-1027)
selects demand traversing the link 1023 to 1027 in that direction, whereas:
MW[2] = SELECTLINK(L=1025-1028*)
selects demand if one of the links 101 to 102, 104 to 105, 105 to 104 or 107 to 109 is on
the path. The use of comma between link specifications is optional, and may be
replaced by a space character.
Selection criteria which require the use of two or more links are described below.
Public Transport Program > Processes > Select link > Select-link functions > Select line
Select line
To select demand using a particular line, the expression takes the form:
LINE = LineName
Use of two or more line names in a list is permitted, and when used the selection criteria
is true if any one of the listed lines is used.
Line names may contain masks of a single trailing “*” or one or more trailing “?.” The
leading nonmasked portions will then be compared for selection purposes. Use the “*”
for multiple columns. For example:
LINE = MUNI*
matches line names such as MUNI, MUNICENTRAL, and MUNINORTH. Use the “?” for
single characters. For example:
LINE = MUNI-??
Select no de
To select demand passing through a particular node, the expression takes the form:
N=NodeNumber
Lists of nodes may be used, and ranges of nodes may be specified using ‘-‘.
Examples:
MW[1] = SELECTLINK(N=107,200-208)
selects demand which passes through node 107 or any of the nodes in the range 200 to
208. The selection considers transit legs which start at, pass through, or finish at the
specified node(s).
Public Transport Program > Processes > Select link > Select-link functions > Select mode
Select m o de
To select demand which uses a particular mode, the expression takes the form:
MODE = ModeNumber
The mode number may be a transit mode (in which case demand using lines of that
mode are selected) or can be a nontransit mode. Lists and ranges may be used when
specifying the required modes. Tests using not equals (!= or <>) are permitted with
mode conditions.
For example:
MW[5] = SELECTLINK(MODE=3,5,7-9)
Select o perato r
To select demand which uses lines from a particular operator, the expression takes the
form:
OPERATOR = Number
Lists and ranges of numbers may be used when specifying the required operators.
Tests using not equals (!= or <>) are permitted with operator conditions.
Example:
MW[7] = SELECTLINK(OPERATOR=3)
selects all demand on lines run by the operator having an identification number of 3.
Public Transport Program > Processes > Select link > Select-link functions > Combining selection criteria together
You can combine two or more select-link criteria to form compound conditions. Use the
“and” operator (& or &&) and “or” operator (| or ||) to combine simple conditions.
The use of | (or) operators may sometimes be avoided when the same data type is
referred to in both tests. The example:
MW[5] = SELECTLINK(L=401-402 | L=421-422)
Two tests based on link-selection criteria may readily be combined using the “and”
operator. For example:
MW[3] = SELECTLINK(L=101-103 & L=108-109)
selects demand which travels along both link 101 to 103 and 108 to 109. In evaluating
this test it does not matter which of the links is traversed first; it is use of both of them
which sets the selection to “on.”
In a similar manner:
MW[4] = SELECTLINK(LINE=RED2 & LINE=BLUE7)
selects demand which uses both line RED2 and also line BLUE7. Again, which is used
first does not matter.
When combining tests using two data types it is also necessary to consider how the
conditions interrelate. As an example, consider how you might combine a test on a link
with a test on a line. You might wish to specify that the link was used (somewhere in the
trip) and that the line was also used (at some point in the trip). These conditions are
independent of each other. Alternatively the requirement may be that the line was used
to traverse the specified link; this is a “simultaneous condition” where two or more
conditions must all apply at one point in the trip, and such conditions are considered in
the following section.
Where the selection criteria are independent, use of the “and” operator is appropriate.
For example:
MW[6] = SELECTLINK(L=211-234 & LINE=GREEN)
treats the two conditions as independent tests, so that demand is selected if the link 211
to 234 is traversed and also (but not necessarily at the same time) the GREEN line is
used.
Public Transport Program > Processes > Select link > Select-link functions > Using simultaneous selection criteria
Where two conditions apply simultaneously the operator, use “+” to combine them.
Such simultaneous conditions are combined together before any “&” and “|” operators
are evaluated.
For example:
MW[2] = SELECTLINK((L=101-102 + LINE=RED) &
(L=201-202 + LINE=BLACK))
selects demand which uses line RED on link 101 to 102 and also uses line BLACK on
link 201 to 202. The use of brackets around each simultaneous condition is optional;
brackets ease reading of the condition groups, and may be omitted without affecting the
results.
The “+” operator is typically used to combine:
• Link conditions with line, mode, or operator conditions
• Any condition with criteria determining type of movement or leg considered (as described
below)
Public Transport Program > Processes > Select link > Select-link functions > Use of the “not” and “not equals” operators
Use care with negated conditions. The “not equals” operator (!= or <>) is not permitted
in link or node expressions (that is, L or N expressions).
When using negated tests with line conditions, it is often appropriate to use an
expression of the form !(LINE=RED) which means “did not use line RED.”
Use of “not equals” may give results which do not exactly match your intentions. For
example, the condition LINE != RED means “used lines other than RED.” If considering a
two-leg trip where line RED used on the first leg, then this condition would be true as
some line other than RED is used on the second leg.
Public Transport Program > Processes > Select link > Select-link functions > Selecting particular types of movement
The normal operation of select link considers transit legs (passing along a link or at a
node), unless mode selection criteria have been specified. You can amend this default
behavior, allowing the selection criteria to consider particular types of movement. These
are specified in the select link expression by a TYPE keyword (which is usually part of a
simultaneous condition, linked by “+” operator to the associated link or node condition).
For conditions using link selection (that is, L= conditions) the TYPE keyword can take
either of the following values.
• NTINCLUDED — To consider transit and nontransit legs traversing the link
The link specification will select nontransit legs which either traverse the specified link (if
XN values are available in NTLEG data for intermediate nodes), or when no XN data is
available the start and end points of the nontransit leg correspond to the link
specification. The TYPE keyword may not be followed by a “not-equals” (!= or <>)
operator.
For conditions using node selection (that is, N= conditions) the TYPE keyword can take
the following values
• THRU — To consider transit legs passing through the node
• NTTHRU — To consider nontransit legs passing through the node. The nontransit legs
selected will be those which have the specified node in their list of XN values.
The condition may use a list of two or more of these settings to select movements where
any of the listed types apply. The TYPE keyword may not be followed by a “not-equals”
(!+ or <>) operator.
The following examples illustrate use of the TYPE keyword:
• MW[1] = SELECTLINK(L=101-102 + TYPE = NTINCLUDED)
Selects all journeys travelling along link 101 to 102, whether using a transit line or
nontransit (for example, walking).
• MW[2] = SELECTLINK((N=123 + TYPE=ALIGHT) &
(N=123 + TYPE=BOARD))
Selects all journeys which both alight and board at node 123 (that is, they make an
interchange between lines at that node).
• MW[2] = SELECTLINK(N=123 + TYPE=ALIGHT)
Selects all journeys which alight at node 123; following that they may board another
line there, walk to another node to board a line, or egress from the public transport
system to reach a destination zone.
• MW[2] = SELECTLINK (N=123 + LINE = X + TYPE = BOARD)
Selects all transit demand arriving at node 579 (whether they alight or continue on the
line).
Public Transport Program > Processes > Select link > Select-link functions > Obtaining matrices of proportion or
percentage of demand meeting a criterion
The select process typically returns the demand for an I-J pair which satisfies a
selection criterion. The proportion of demand meeting the criterion may be obtained by
including the PROBABILITY keyword in the expression (that is, PROBABILITY=T). Similarly,
percentages may be obtained by using the PERCENT keyword (that is, PERCENT=T). As an
example:
MW[3] = SELECTLINK(LINE=TRAM1, PERCENT=T)
Returns percentage values for each I-J pair which use the line TRAM1.
Public Transport Program > Processes > Select link > Select-link functions > Loading the select link demand
The select-link process may load the portion of total demand meeting a select link
criterion, rather than loading the entire demand as specified by the parameter TRIPSIJ.
This is invoked by including the keyword and setting LOAD=T in the select link expression.
As an example:
MW[2] = SELECTLINK(L=303-307*, LOAD=T)
Although a program run may include several SELECTLINK functions, only one of these
may be used to trigger select-link loading.
Where crowding is modeled, the restriction using selection criteria applies to the last
iteration, so the crowding is based on complete loadings.
If skims are obtained when performing select-link loading, then the skims are obtained
for all evaluated routes (that is, they are not restricted to the subset of routes which
match the select link criteria).
Public Transport Program > Processes > Loading analyses
Loading analyses
During the loading-analyses process, the Public Transport program presents further
reports of transit and nontransit passenger loadings than those performed during the
loading process. Any request for loading analyses automatically invokes a loading
process.
As with the loading process, demand stratified by user class produces loading analyses
for each class.
Loading analyses are associated with the MATI phase.
The analyses currently available are:
• Transfers between modes
• Stop-to-stop movements
Public Transport Program > Processes > Loading analyses > Transfers between modes
Reports produced if loading is performed and output to the main print file:
• Passenger transfers between transit and nontransit modes
Report produced if loading is performed and output to the main print file:
• Passenger transfers between transit and nontransit modes
Public Transport Program > Processes > Loading analyses > Stop-to-stop movements
• Adjacent
The first two can be obtained by mode or for all modes. You can save this analysis to a
DBF file with FILEO STOP2STOPO .
Public Transport Program > Processes > Crowd modeling
Crowd modeling
During the crowd-modeling process, the Public Transport program iteratively balances
loaded demand against capacity. At each iteration, the program completes the route-
evaluation and loading processes, which are repeated for all user classes, and then
adjusts the costs in the model to reflect the assigned loads. The iterative process may
use either, or both, of the crowd modeling procedures:
• Link travel time adjustment
See “Crowding” on page 996 for information about the theory of crowding models.
When crowd modeling is performed, the results obtained from the last iteration (in the
form of loaded flows, printed reports, and skims) provide the model outputs.
Public Transport Program > Phases
Phases
The Public Transport program executes its main processes—data processing and
modeling—within a series of phases. You control all the phases and can initiate
additional, context-sensitive computations within them.
The phases, presented in the order they would normally be implemented, are:
• NODEREAD — Computes node based variables.
• SELECTIJ
• SKIMIJ — Extracts skims and select link results, saving them, generally in working matrices.
The NODEREAD, LINKREAD, MATI, and MATO phases provide data manipulation
facilities, and are secondary to the main functions of the Public Transport program. They
are optional.
You specify the exact configuration for the Public Transport program to run through a
combination of phases and control statements.
Control statements provide information and instructions to the program. In the Public
Transport program, control statements are either static or dynamic. Static statements
may be present anywhere in the job stream; the program evaluates them once. Dynamic
statements may be present only within phases; the program evaluates them as
encountered, during the execution of the phases.
Only context-sensitive dynamic control statements are available to the phases; a list of
valid statements is provided with the description of each phase. See “Control
statements” on page 759 for more information.
You only must code phases that contain control statements; you need not code empty
or null phases.
Specify phases in a script as follows:
PHASE=DATAPREP
;Generate access/egress legs
GENERATE
...
...
;End of GENERATE
ENDPHASE
Regardless of the functionality selected for any run of the Public Transport program, a
requirement is that a network, basic or public transport, is always input. This is read and
set up at the start of each run; no user intervention is required.
A diagram showing how the phases would be used in a typical public transport model
follows:
Public Transport Program > Phases > NODEREAD
NODEREAD
In the NODEREAD phase, you can compute node-based information from the input
network’s node attributes with NETI. This information is for use primarily in the
DATAPREP phase but is available in later phases if the DATAPREP phase is active.
The control statements within the NODEREAD phase are executed once per node. Only
one NODEREAD phase is permitted per run.
The computed variables may be scalars or vectored by node. The use of a vectored
variable produces an array containing a computed value for each node. Vectored
variables have the case insensitive prefix “nw.”
The evaluated expression may contain any valid variables, numeric or string, and node
based variables from the input network. Input node variable names must have the case
insensitive prefix “ni.”
An example of a computed node variable is:
NW.XplusY = NI.X + NI.Y
Computed variables are available for the duration of the run but not saved back to the
network.
See “Example 2: Preparing a public transport network from TRIPS link data” on
page 1019 for an example of this phase.
Public Transport Program > Phases > NODEREAD > Control statements available in this phase
CONTINUE
EXIT
GOTO
IF... ELSEIF ... ELSE ... ENDIF
LOOP ... ENDLOOP
PRINT
Public Transport Program > Phases > NODEREAD > Public Transport variables available in this phase
ZONES
Public Transport Program > Phases > LINKREAD
LINKREAD
In the LINKREAD phase, you can compute link-based information from the input
network’s link attributes with NETI. This information is for use primarily in the DATAPREP
phase but is available in later phases if the DATAPREP phase is active.
The control statements within the LINKREAD phase are executed once per link. Only
one LINKREAD phase is permitted per run.
The computed variables may be scalars or vectored by link. The use of a vectored
variable produces an array containing a computed value for each link. Vectored
variables have the case insensitive prefix “lw.”
The evaluated expression may contain any valid variables, numeric or string, and node
based variables from the input network. Input link variable names must have the case
insensitive prefix “li.”
An example of a computed link variable is:
LW.GCTime = LI.Time * 1.5
Computed variables are available for the duration of the run but not saved back to the
network.
See “Example 2: Preparing a public transport network from TRIPS link data” on
page 1019 for an example of this phase.
Public Transport Program > Phases > LINKREAD > Control statements available in this phase
CONTINUE
EXIT
GOTO
IF... ELSEIF ... ELSE ... ENDIF
LOOP ... ENDLOOP
PRINT
Public Transport Program > Phases > LINKREAD > Public Transport variables available in this phase
ZONES
LINKNO
Public Transport Program > Phases > DATAPREP
DATAPREP
The DATAPREP phase invokes the Public Transport network development process
and provides the mechanism for generating and/or reading nontransit legs.
You can develop nontransit legs with one or more GENERATE control statements, or you
can produce them externally to the Public Transport program and input them in this
phase.
You can compute data for nontransit leg generation from the input network with the COMP
statement.
See “Public transport network development” on page 1017 for examples of this phase.
Public Transport Program > Phases > DATAPREP > Control statements available in this phase
CONTINUE
EXIT
GENERATE
GOTO
IF... ELSEIF ... ELSE ... ENDIF
ZONES
Public Transport Program > Phases > MATI
MATI
The MATI phase produces working matrices, (MW[#]), from FILEI MATI matrices
(MI.#.name), although COMP statements can also compute working matrices.
The MATI phase is executed for each origin zone, I, before the route evaluation,
skimming, loading, and loading analyses processes are done for each zone pair, I-J.
This phase provides a flexible mechanism for generating and manipulating one row of a
matrix at a time. You might use this phase to:
• Examine the matrix input with FILEI MA T I, one row at a time, and determine if there is
anything specific about zone I that could affect further processing for that zone. For
example, if MA T I points to a highway network matrix, and the matrix indicates that there is
no highway access for zone I, you might set a variable for zone I and test in the SELECTIJ
phase.
• Compute a row of trips, from an origin zone (I) to all zones (J), using the COMP statement
and the built-in ROW functions, and save the trips in a working matrix, MW [#], for subsequent
loading. You can also do this in the SELECTIJ phase, but for a zone pair at a time. The
working matrix is designated for loading with PARAMETERS TRIPSIJ[userclass].
• Input matrices external to the Public Transport program with FILEI MA T I, and then
manipulate, report, and save those matrices with FILEO MA T O . You can merge highway skims
with skims extracted in the Public Transport program run.
The working matrix may be reported with the PRINTROW statement. With the BREAK
statement, you can use the MATI phase to select zones for processing.
See “Public transport loading” on page 1024 for an example of this phase.
Public Transport Program > Phases > MATI > Control statements available in this phase
CONTINUE
EXIT
GOTO
IF... ELSEIF ... ELSE ... ENDIF
JLOOP ... ENDJLOOP
ZONES
USERCLASS
I
J
Public Transport Program > Phases > SELECTIJ
SELECTIJ
The SELECTIJ phase selects pairs of zones, I-J, for bypassing the route-evaluation
process.
The ROUTEI and ROUTEO subkeywords I, J, and SELECTBYMAT provide the first line of
selection but they do not control specific I-J combinations. The SELECTIJ phase allows
a finer selection of specific I-J combinations, although if the I-J combination is precluded
by the values on the ROUTEI and ROUTEO, that I-J pair is not available to this phase.
The Public Transport program executes the SELECTIJ phase prior to the route-
evaluation process for the I-J pair. (Route evaluation is a time consuming process,
therefore judicious use of this phase can have a significant impact on overall processing
time.)
Only zone pairs for evaluated routes are available for the skimming, loading, and loading
analyses processes.
This phase can compute the trips to be loaded for each I-J pair. For example:
PHASE=SELECTIJ
if(I < 10) CONTINUE
if(J > 10) BREAK
TRIPSIJ=MI.1.1 * 0.75
PRINT LIST=I,J,TRIPSIJ
ENDPHASE
In this fragment of code, the I-J pairs loaded range from I=10‑ZONES to J=1-9. The trips
to be loaded are computed from the input trip matrix and reported.
Public Transport Program > Phases > SELECTIJ > Control statements available in this phase
CONTINUE
EXIT
GOTO
IF... ELSEIF ... ELSE ... ENDIF
PRINT
PRINTROW
Public Transport Program > Phases > SELECTIJ > Public Transport variables available in this phase
ZONES
USERCLASS
I
J
Public Transport Program > Phases > SKIMIJ
SKIMIJ
The SKIMIJ phase extracts skims and select-link outputs with special functions
described in “Select-link functions” on page 735, then saves them, generally in working
matrices with the COMP M W [#] statement.
The Public Transport program invokes SKIMIJ for each zone pair, I-J, immediately after
route evaluation.
See “Public transport skimming” on page 1022 for an example of this phase.
Public Transport Program > Phases > MATO
MATO
In the MATO phase, the Public Transport program revises, combines, reports and writes
work matrices to the FILEO M ATO files.
The program executes this phase once for each origin zone, I, after completing the route
evaluation, skimming, loading, and loading analyses processes for all destination zones
of that origin zone.
Generally, you use the MATO phase with the matrices produced by the skimming and
loading analyses phases, but you can also process other working matrices similarly.
You can manipulate matrices with the COMP statement and a set of built-in ROW
functions, and create a report with the PRINTROW statement. With the BREAK statement,
you can use the MATO phase to select zones for processing.
See “Public transport skimming” on page 1022 for an example of this phase.
Public Transport Program > Phases > MATO > Control statements available in this phase
CONTINUE
EXIT
GOTO
IF... ELSEIF ... ELSE ... ENDIF
JLOOP ... ENDJLOOP
ZONES
USERCLASS
I
J
Public Transport Program > Control statements
Control statements
Control statements provide instructions and information to the Public Transport program.
The Public Transport program has two types of control statements:
• Static — Evaluated only once, at the start of each run, regardless of their location in the
script. Citilabs recommends keeping static control statements together at the beginning of
the script file. Examples of static control statements include FILEI, FILEO, PARAMETERS , and
REREPORT. Some static statements are provided in files, not in the job script (that is, LINE,
MODE, FACTORS ).
The control statements available in the Public Transport program are listed below. Some
are specific to this program while others are available throughout Cube Voyager.
CROWDCRVDEF
EXIT
NT Public Static
Transport
VEHICLETYPE
ABORT
Terminates a run. Keywords include:
• MS G
Usage is:
ABORT MSG = text
A B OR T k e y wo rd
Ke y wo rd D e s c rip tio n
Exam ple
Before generating access and egress legs in the DATAPREP phase, this script checks
that the speed of links that may be used for walking is between 0 and 5 km/h. If the script
finds links outside this range, the script reports the links and aborts the run with an
appropriate message.
PHASE=DATAPREP
LnkCnt = 0
LINKLOOP
if((li.a <=24 || li.b <=24) && (lw.WalkSpeed <= 0 || lw.WalkSpeed > 5.0 ))
LnkCnt=LnkCnt+1
print list=li.a, li.b, lw.WalkSpeed
endif
ENDLINKLOOP
print list= 'Number of access/egress links with invalid walk speeds = ', LnkCnt
if(LnkCnt>0) abort msg = Access/Egress Links with invalid walk speeds
;Generate access legs only if walk costs coded on links
GENERATE......
ENDPHASE
Public Transport Program > Control statements > BREAK
BREAK
Breaks out of a loop.
Upon encountering BREAK, the script immediately passes control to the statement after
the associated loop.
If BREAK is within a LOOP ... ENDLOOP or JLOOP ... ENDJLOOP block, control passes to the
statement following the associated ENDLOOP (loop variable remains intact) or ENDJLOOP
(J is reset to 1).
If BREAK is not within a LOOP or JLOOP block, the script terminates processing for the I
zone but does not bypass output and zonal reporting statistics.
When used within the Public Transport program’s MATI or MATO phases, BREAK
bypasses any more processing for the relevant I zone, breaks out of the I-loop, and
bypasses end-of-zone processing for zone I.
Public Transport Program > Control statements > BREAK > Example 1
Exam ple 1
Loop terminates if “condition 1” is not met, regardless of the value of L1. When
“condition 2” is met, control passes to the following IF statement and processing for zone
I ceases.
LOOP L1=1,3
IF (condition 1)
statements
ELSE
BREAK
ENDIF
ENDLOOP
IF (condition 2) BREAK
Public Transport Program > Control statements > BREAK > Example 2
Exam ple 2
MATI selects zones 1 to 19 for processing, ignoring all other zones. BREAK terminates
the I-loop at zone 20 for each user class, enabling no further processing. The route-
evaluation, skimming, loading, and loading-analyses processes are completed for loop J
within loop I. Therefore, they would be done only for zones 1-19.
PHASE=MATI
IF(I==20) BREAK
MW[1] = MI.1.1
ENDPHASE
Public Transport Program > Control statements > BREAK > Example 3
Exam ple 3
MATO selects zones 1 to 19 for reporting, manipulating matrices, and saving matrices to
file. BREAK terminates the loop at the 20th zone. Therefore, the route-evaluation,
skimming, loading, and loading-analyses processes effectively stop after the 19th zone
for each user class. (Because MATO follows the processes, the processes will run for
zone 20 but will not save any matrices produced.)
PHASE=MATO
IF(I==20) BREAK
MW[1] = MW[1] * 1.2
ENDPHASE
Public Transport Program > Control statements > COMP
COMP
Computes a variable, matrix, or matrix element from an expression. Keywords and sub-
keywords include:
• MW
m EXCLUDE
m INCLUDE
• VAR
Usage is:
VAR=expression
MW[n]=expression, INCLUDE=list of J zones, EXCLUDE=list of J zones
• Row-based functions, which process the cells in a row (see “Matrix function descriptions”
on page 581)
• Skimming functions, which produce skim (level of service) matrices of total trip costs and
their components (see “Skimming (level of service)” on page 720)
COMP k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Phase=MATO
x=ROWADD(6,1,2,3,4,5)
PRINTROW MW=6 TITLE='AVJRNYCOST', BASE1=T, FORM=10.2
Endphase
Determine the highest node number in the public transport system, using standard
function MAX.
HighestNodeNum = MAX(HighestNodeNum, Anode, Bnode)
Public Transport Program > Control statements > CONTINUE
CONTINUE
Jumps to the end of a loop, bypassing all intermediate statements.
If CONTINUE is within a LOOP ... ENDLOOP or JLOOP ... ENDJLOOP block, control passes to the
appropriate ENDLOOP or ENDJLOOP statement. Otherwise, processing for the I zone is
terminated, but output and zonal reporting statistics will not be bypassed.
Public Transport Program > Control statements > CONTINUE > Example 1
Exam ple 1
LOOP L1=1,3
IF (!(condition 1)) CONTINUE
ENDLOOP
In this user-controlled loop, control is passed to the ENDLOOP when “condition 1” is not
met, bypassing any statements between the IF and ENDLOOP, for that value of L1.
Public Transport Program > Control statements > CONTINUE > Example 2
Exam ple 2
IF (condition) CONTINUE
This statement is used in an explicit or implicit loop over I. If the condition is met, no more
Js will be processed for the I zone, except output and zonal summaries.
Public Transport Program > Control statements > CONTINUE > Example 3
Exam ple 3
LOOP L2=K1,K2,KINC
JLOOP EXCLUDE=25-50,88
IF (condition 1) CONTINUE
....
ENDJLOOP
LOOP L3=L2,L2+5
IF (condition 2) CONTINUE
.....
ENDLOOP
ENDLOOP
JLOOP processing is bypassed for the Js for which “condition 1” is met; similarly, LOOP
processing is bypassed for the L3s for which “condition 2” is met. The outermost LOOP
operates over the full range of L2, from K1 to K2, incrementing in steps of KINC.
Public Transport Program > Control statements > CONTINUE > Example 4
Exam ple 4
PHASE=SELECTIJ
IF(I<403)CONTINUE
IF(I>455)BREAK
IF(J<403)CONTINUE
IF(J>455)BREAK
ENDPHASE
The SELECTIJ phase selects zone pairs, I and J, 403-455 for processing. The first
CONTINUE bypasses origin (I) zones 1-402 and the second one bypasses destination (J)
zones 1-403. The first BREAK stops the I-loop after zone 455 and the second stops each
J-loop after zone 455.
Public Transport Program > Control statements > CROWDCRVDEF
CROWDCRVDEF
Defines crowding curves, used to compute crowded travel time for particular
combinations of transit lines and user-class. Keywords include:
• CU R V E
• LON GN A ME
• N A ME
• N U MB E R
Crowded travel times are behavioral measures which increase the in-vehicle time to
reflect the discomfort of standing or travelling in crowded conditions.
You can define up to 255 wait curves. No default curves are provided. If crowding is not
applied, then either do not code line capacities, or use a flat curve (with y-value set to
1.0 at both x=0 and x=100).
Input CROWDCRVDEF statements must be input in the public transport system data file with
SYSTEM I.
CR OW D CR V D E F k e y wo rd s
Ke y wo rd D e s c rip tio n
CURVE |R| Defines X-Y pairs for the crowding curves used to
compute link travel times under crowded
conditions. Utilization (measured as a
percentage) is the curve’s X-axis and the
crowding factor is the curve’s Y-axis. By default
(UTFLEX=F), the values for utilization vary from 0.0
(where the crowding factor is at least 1.0) to 100.0.
By setting UTFLEX=T the user can specify values
of utilization above 100.0.
Specify the utilization values in ascending order;
the corresponding crowding factor values must
increase, or remain the same, when progressing
from one point to the next.
Each pair of X and Y values may be separated by
a comma or a dash, while the pairs themselves
must be separated by a comma. For example:
CROWDCRVDEF NUMBER=1
LONGNAME="Suburban Rail" NAME="S-
Rail" ,
CURVE= 0,1.0, 20,1.1,
100,1.9
The following rules apply to the
coding/interpreting of crowding curves:
• Values for the first coded Y-value may not
be less than 1.0.
• Crowding factor (Y-axis) may not decrease
as utilization (X-axis) increases.
• There is a linear interpolation between
coded points.
• When the first coded X-value is greater than
0% utilization, the curve runs from the point
(0-1.0) to the first coded point.
Exam ple
CROWDMODEL
Specifies the crowding model used in the run of the Public Transport program.
Keywords include:
• A D J U S T LIN K
• A D J U S T W A IT
• A P P LY
• IT E R A T ION S
• LIN KD F
• P E R IOD
• R D IFF
• R D IFFCU T OFF
• R D IFFS T OP
• R E P OR T IJ
• R MS E
• R MS E CU T OFF
• R MS E S T OP
• S KIMS
• S T OP 2S T OP
• SUM
• T R A CE IJ
• U T FLE X
• V OLD F
• W A IT D F
CR OW D MOD E L k e y wo rd s
P o s s ib le
Ke y wo rd D e s c rip tio n V a lue s
Exam ple 1
CROWDMODEL,
APPLY = T,
ADJUSTWAIT = T,
ITERATIONS = 10
Exam ple 2
Public Transport Program > Control statements > EXIT
EXIT
Terminates loops (implied or explicit). When the program encounters an EXIT statement
within a loop, the program passes control to the end of the loop.
Public Transport Program > Control statements > EXIT > Example
Exam ple
LOOP iter=1,10
.
IF (expression) EXIT
.
ENDLOOP
This loop terminates either when iter=11 or the condition specified by expression is met.
Public Transport Program > Control statements > FACTORS
FACTORS
Specifies the generalized cost factors and control information for the route enumeration
and evaluation processes. Keywords and sub-keywords include:
• A LP H A • MU S T U S E MOD E
• A ON MA XFE R S • P E R IOD
• B E S T P A T H ON LY • QU ICKE S T P A T H
m EVALFARE • QU ICKE S T MU LT I
m ENUMFARE • R E B E S T P A T H COS T
• BRDPEN • R E FA R E FA CT OR
• CH OICE CU T • R E W A IT MA X
• D E LA CCE S S MOD E • R U N FA CT OR
• D E LMOD E • S H OR T E S T W A LK
• E XT R A XFE R S 1 • S P R E A D CON S T
• E XT R A XFE R S 2 • S P R E A D FA CT
• FA R E S Y S T E M • S P R E A D FU N C
m MODE • T IME P OIN T
• FR E QB Y MOD E • W A IT FA CT OR
m NODES
• IW A IT CU R V E
m NODES • XFE R CON S T
m FROM
• KB E T A
m TO
• KIR CH OFF
• LA MB D A A • XFE R FA CT OR
m FROM
• LA MB D A R
• LA MB D A W m TO
• MA XCOMP D • XFE R P E N
• MA XFE R S m FROM
• MA XW A IT V A R m TO
• MIN XFE R V A R • XW A IT CU R V E
• MU ME XT R A COS T m NODES
FACTORS statements must be input in a separate file with FACTORI keywords on the FILEI
control statement. Each user class that the program references must have FACTORI
keywords defined on a FILEI control statement, although two or more classes may
reference the same file. The index of the FACTORI keyword, #, is the number of the user
class. If there is no index, the program assumes the index is 1. You define user classes
with the USERCLASSES keyword in the PARAMETERS control statement.
Some FACTORS keywords are used for both the route enumeration and evaluation
processes; others apply to one or the other, as noted in the keyword description.
The keywords on this statement are all “trigger” keys; you need not code the control
statement name FACTORS. The values can be input in any order. For most of the
keywords, the program uses the last value specified, if the keyword appears multiple
times.
FA CT OR S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
where:
λ
Scale parameter that reflects
traveler sensitivity to cost
differences. It takes the
value of LAMBDAW or
LAMBDAA, depending upon
the point in the trip at which it
is applied.
Costi
Cost to destination by choice
i
CostBest
Cost to destination by the
best choice
Exam ple 1
//Note: Keywords need not be preceded by control statement name FACTORS
//They are directly recognized within context
//Enumeration Controls
MAXFERS=5
EXTRAXFERS1 = 2
EXTRAXFERS2 = 1
SPREADFUNC = 1
SPREADFACT = 1.1
SPREADCONST = 10.0
REWAITMIN = 5
REWAITMAX = 30
//Evaluation Controls
ALPHA = 1.0
LAMBDAW = 0.3
LAMBDAA = 0.3
//Wait time
IWAITCURVE=1, nodes=1300-1400
XWAITCURVE=2, n=150-1600
WAITFACTOR=2.25, n=25-1000
//IVT factor by mode
RUNFACTOR[7] = 1.5, RUNFACTOR[8] = 2, RUNFACTOR[11] = 2.5
//Penalties
BRDPEN[7] = 4*2.5
XFERPEN=3.0, from=7-10, to=8-12,
XFERPEN=2.0, from=11-12, to=7-12,
XFERCONST=5.0, from=7-10, to=7-12,
XFERCONST=2.5, from=11-12, to=7-12,
XFERFACTOR=1.5, from=7-10, to=8-12,
XFERFACTOR=2.0, from=11-12, to=7-12,
Public Transport Program > Control statements > FACTORS > Example 2 — Example of EVALFARE keyword
The 'EVALFARE =T' can be defined along with the BESTPATHONLY keyword to allow fare to
be calculated in the best path evaluation and skimming process. Note that the
'BESTPATHONLY=T' setting originally doesn't include the fare in calculating the route
cost during evaluating the transit route. Hence, the user can't define 'PARAMETERS
FARE=T' with 'BESTPATHONLY=T' in the PT program, but it would be fine now by
being set with 'EVALFARE=T'. In the tested example below, the cost for route
evaluation is increased from 107.703 to 117.521 because it contains fare. Note that the
routes are still enumerated using the original approach without fare in the cost
computation.
< Settings in Factor & Parameter >
*** INPUT FACTOR FILE ***
;Global Settings ; fare to be calculated in the best
BESTPATHONLY=T, EVALFARE=T ; path evaluation process
< Comparison of transit route costs for z# 194 -> z# 2204 >
*** ROUTE COST for ORIGINAL ***
REval Route(s) from Origin 194 to Destination 2204
The 'ENUM FARE =T' can be defined along with the BESTPATHONLY keyword to allow fare
to be calculated in the best path enumeration process. However, the 'ENUMFARE=T'
also requires 'EVALFARE =T' to include the fare to the route cost during
enumerating/evaluating the transit routes. Note that 'ENUMFARE=T' cannot be utilized
without 'EVALFARE=T' once 'PARAMETERS FARE=T' is defined. In the tested
example below, the cost for route evaluation is increased from 107.703 to 162.248
because it contains the revised fare increased from $0.9 to $5 in the boarding fare.
Hence, it is confirmed that the fare is added into the route cost.
< Settings in Factor & Parameter >
*** INPUT FACTOR FILE ***
;Global Settings ; to be calculated in the best
BESTPATHONLY=T, EVALFARE=T, ENUMFARE=T ; path enumeration & evaluation
< Comparison of transit route costs for z# 194 -> z# 2204 >
*** ROUTE COST for TEST 2 ***
The 'ENUM FARE =T' can be defined along with the BESTPATHONLY keyword to allow fare
to be calculated in the best path enumeration process. In this case, the 'PARAMETERS
EFARE=T' indicates that the fare data would be input through the FAREI file. Since only
the route enumeration is processed by this keyword, the route report doesn't show the
detail information for the selected zonal pair as provided during evaluating the route.
Note that either transit skimming or transit loading process should be implemented
separately in the following step because the 'Parameters EFARE=T' setting doesn't
work with the route evaluation. In the tested example below, the total skimming fares are
changed because the transit routes are different by including the fare for the route
enumeration.
< Settings in Factor & Parameter >
*** INPUT FACTOR FILE ***
;Global Settings ; fare to be calculated in the best
BESTPATHONLY=T, ENUMFARE=T ; path evaluation process
< Comparison of transit route costs for z# 194 -> z# 2204 >
*** ROUTE COST for TEST 3 ***
Ro ute generatio n
M AXFERS works with EXTRAXFERS1 and EXTRAXFERS2 to control the number of routes
generated.
First, the program generates minimum-cost routes for all O-D pairs and records the
number of transfers required for these routes, MINXOD. Next, the program searches for
“attractive” routes for each O‑D. Attractive routes depend on the number of transfers:
• If the number of transfers equals MINXOD, number of transfers must be no greater than
MAXFERS .
• If number of transfers exceeds MINXOD, number of transfers must be less than or equal to
the minimum of:
m
MINXOD+EXTRAXFERS2
m
EXTRAXFERS1
m
MAXFERS
The search for routes has two stages. First, the program determines the connections
required to transfer between lines. Second, the program explores the connections and
generates routes by progressing through a sequence of lines and connections. The
program ensures that routes do not exceed the specified constraints.
The following table shows the number of transfers that the program explores for various
values of EXTRAXFERS2 if M AXFERS =5 and EXTRAXFERS1 =4 (the default condition).
N umb e r o f tra ns fe rs e xp lo re d
MIN XOD
0 1 2 3 4 5
E XT R A FE R S 2 0 0 1 2 3 4 5
1 1 2 3 4 4 5
2 2 3 4 4 4 5
3 3 4 4 4 4 5
4 4 4 4 4 4 5
FARESYSTEM
Defines fare systems that the program uses to calculate trip fares. Keywords and sub-
keywords include:
• FA R E FR OMFS
• FA R E MA T R IX
• FA R E T A B LE
m INTERPOLATE
• FA R E ZON E S
• IB OA R D FA R E
• LON GN A ME
• N A ME
• N U MB E R
• S T R U CT U R E
m SAME
• U N IT FA R E
Use separate FARESYSTEM statements to define multiple fare systems in public transport
network.
You input the FARESYSTEM statements to the Public Transport program with the FILEI
FAREI file. The program uses fare systems for the evaluation, skimming, loading, and
loading-analyses processes. The program does not use fares in enumeration.
The program allocates fare systems to lines, either indirectly through transit modes and
operators with FACTOR FARESYSTEM , or directly with the LINE control statement.
When modeling fares, you must allocate all lines to fare systems; travelers incur fares
when using the lines. You can code a NULL fare system to run lines effectively free.
Fare systems define the cost of:
• Travel on lines
FA R E S Y S T E M k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
FILEI
NOTE: See “FILEI” on page 50 for general information about FILEI and for important
limitations when using Application Manager.
Specifies files that may be input to the Public Transport program. Keywords and sub-
keywords include:
• FA CT OR I
m LIST
m MAXERRS
m OMITFARES
• FA R E I
m LIST
• FA R E MA T I
• LIN E I
m LIST
m MAXERRS
m SKIPBADLINES
• LOOKU P I
• MA T I
• NET I
• N T LE GI
• R OU T E I
m I
m J
m REPORTI
m REPORTJ
m SELECTBYMAT
m TRACEI
m TRACEJ
• S CR E E N LIN E I
• S Y S T E MI
m LIST
• T URNPENI
m BASEDATA
m LIST
m MAXLINKDELAY
m MISSINGLINK
m NOTMODES
m SETS
All FILEI keywords are “trigger” keywords and need not be preceded by the control
statement name.
NOTE: The Public Transport program allows certain types of files to have multiple files.
For example LINEI can have up to 32 files. Due to a restriction on the total number of
files, fewer files than permitted for a particular file type may be active in Application
Manager.
FILE I k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
//Some files that may be input to PT
FILEI FACTORI = factor.fac, list=t
LINEI[1] = lines.lin, list=t
NETI = inetwork.net
NTLEGI = geno.ntl
Public Transport Program > Control statements > FILEO
FILEO
Specifies files that the Public Transport program outputs.
All FILEO keywords are “trigger” keywords and need not be preceded by the control
statement name. Keywords and sub-keywords include:
• IN T E R CE P T O • P R IN T O
• LIN E O • R E P OR T O
m BASEGDBNETWORK • R OU T E O
m m
NET I
m m J
VOL
• LIN KO m REPORTI
m BYCLASS m REPORTJ
m DISTDEC m SELECTBYMAT
m FMVOLS m TRACEI
m FORMAT m TRACEJ
m LINES • S CR E E N LIN E O
m m CONFVAR
NTBYLINK
m m COUNTVAR
NTLEGS
m m DEFCONF
ONELINKREC
m m MEUSESNT
ONOFFS
m m
SKIP0 SCREENVAR
m TIMEDEC • S T OP 2S T OP O
m m ACCUMULATE
VOLFIELDS
m DEC
• MA T O
m m GROUPEDMODES
DEC
m m GROUPS
MO
m m LIST
NAME
m m MODES
TYPE
m m NODES
FORMAT
• NET O m STOPGROUP
m DEC
• N T LE GO
m BASEGDBNETWORK
m NET
m VOL
m XN
NOTE: The Public Transport program allows certain types of files to have multiple files.
For example PRINTO can have up to 99 files. However, Application Manager restricts the
total number of files. Therefore, fewer files than permitted for a particular file type may be
active in Application Manager at any point.
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
• Distance
• Time
• SEQ — Sequence number of
this line among the lines that
traverse the link; ranges
from 1 to CNT)
• CNT — Number of lines that
traverse this link
• HEADWAY — Headway of
the line in the specified
HDWAYPERIOD
• Load (if the public transport
network contains loads)
When multiple lines traverse a
link, the output contains one
record for each line.
NOTE: LINKO can save at
maximum two decimals for travel
time values. Please see
“Considerations on numeric
formats” on page 850.
• ALLONOFFS — Movements
for all on-off combinations.
• FIRSTLASTBYMODE —
Movements from first node
to last node on a particular
mode, regardless of
intervening modes. Must
specify MODES
subkeyword.
• ADJACENTBYMODE —
Through movements from
first node to last node on a
particular mode. Must
specify MODES
subkeyword.
All movement types other than
ADJACENT can contain one or
more transit legs.
See “More on stop-to-stop
analysis” on page 851.
Default value is FIRSTLAST.
Exam ple
ENDRUN
Public Transport Program > Control statements > FILEO > Considerations on numeric formats
• Matrix values usually can be represented with numbers where a fixed decimal place can be
assumed.
In the past, computers could process integers much faster than floating point numbers.
However, this is not necessarily true with newer computers.
Single-precision floating point provides only six to seven digits of precision, and cannot
always maintain the precision required for certain types of matrices. Cube Voyager
processes all matrices in double-precision (16 digits) format to accommodate a wider
range of values, and to not lose precision or accuracy when computing. However, writing
double-precision numbers to the matrix files would generate very large files, and in most
cases, only a few decimal places are required for each cell value. Therefore, the Public
Transport program stores matrix values with a special packing routine that tries to
minimize the file’s space requirements.
The Public Transport program tries to convert each number to an integer starting with 0
decimal places and continues with the next power of 10 until it reaches the maximum
level specified. The program uses the lowest level that converts to an integer with no
loss of precision. If a scaled cell value is too large to fit within a 32-bit integer, the
program stores the cell as a double-precision value. If is D or S, the program skips the
integer conversion attempt and stores all cells as either 8-byte double values or 4-byte
single values. If not specified, defaults to 2.
For example, consider a cell computed as 10/3. The result is 3.33333333.... to sixteen
digits. When changed to single precision, the result is accurate to about seven digits,
requiring four bytes to store. If converted to an integer while is 0, the result is 3, and the
cell would require only one byte to store—a significant reduction. However, that might not
be precise enough for the programs that read it. If is 2 for that number, the resulting
integer is 333, requiring two bytes to store. Upon reading, another application will
automatically restore the number to 3.33. If were S, the value would be stored as a 4-
byte single-precision, and if were D, it would be stored as an 8-byte double-precision.
The S and D formats require more storage space.
Public Transport Program > Control statements > FILEO > More on stop-to-stop analysis
2. 3-4 on mode 1
3. 5-6 on mode 2
4. 7-8 on mode 1
5. 9-10 on mode 1
V a lue o f
A CCU MU LA T E Mo v e me nts a na ly ze d
FIRSTLAST 1-10
GENERATE
Generates nontransit legs in the public transport network. Keywords include:
• COS T • MA XN T LE GS
• D IR E CT ION • N T LE GMOD E
• D IR E CT LIN K • ON E W A Y
• E XT R A CT COS T • R E A D N T LE GI
• FR OMN OD E • S LA CK
• IN CLU D E LIN K • T ON OD E
• LIS T • XFE R ME T H OD
• Finds transit modes at each node specified in TONODE, computes the cost to the node, and
compares the cost to the mode’s MAXCOST. If the cost for at least one of the modes is less
than the mode’s MAXCOST and if the specification in DIRECTLINK is satisfied, the program
saves the leg.
• Examines each saved leg, adding acceptable legs to the legs table. The program adds the
best leg for a mode, and legs that service that same mode and whose cost does not
exceed the cost of the best leg for that mode plus the SLACK for that mode. If SLACK is not
specified, the slack for a mode effectively becomes the difference between the best cost
and the MAXCOST for the mode. MAXNTLEGS specifies the maximum number of legs the
program will generate for a mode from a FROMNODE.
• Merges legs using any special transaction codes. For example, you might specify that the
program replace a generated leg with a longer leg. See NTLEGI under “FILEI” on page 811.
None of the GENERATE keywords are “trigger” keys; you must code all keywords on a
GENERATE control statement.
Ke y wo rd D e s c rip tio n
A CCE S S LIN K |R| Optional. One or more access links from park-and-
ride facilities to stop nodes.
Specify an access link as:
A-S,cost,distance
where:
• A — Surrogate access point (integer)
• S — Stop node (integer)
• cost — Optional. Cost of using this access link
(real).
• distance — Optional. Distance traveled on this
access link (real).
Separate each access link with a comma.
If the link does not exist in the network, the program
generates the link.
You specify pairs of numbered sets. Paired values
indicate the start of new access links. Enter paired
values in the correct order to avoid generating an
error.
If you specify ACCESSLINK, the program ignores
any TONODE keywords. The program obtains the
cost from the route to the A-node. If ACCESSLINK
provides numeric values for cost and distance, the
program adds them to the link’s cost and distance.
If ACCESSLINK only contains one value, the
program adds that value to the link’s cost.
Valid values for A and S are 1 to the network’s
highest node number.
The first GENERATE statement produces access legs from zones to the public transport
system and egress legs in the reverse direction. The second GENERATE statement
produces transfer legs between stops.
PHASE=DATAPREP
//Note: the GENERATE command must precede controls
//GENERATE 1: Access and Egress links for zones 1-1272
GENERATE,
NTLEGMODE=100,
MAXCOST=20*20.0,
COST=li.time,
FROMNODE=1-1272,
TONODE=1273-5644,
DIRECTION=3,
INCLUDELINK=(li.LINKTYPE=30-32),
SLACK=20*5.
MAXNTLEGS=20*5,
DIRECLINK=5
LIST='GEN2'
GENERATE COST=(li.distance), EXTRACTCOST=(lw.xcost), MAXCOST=12*1,
NTLEGMODE = 36, LIST=T, DIRECTION=3, FROMNODE=1, TONODE=2052
LIST='GEN3'
GENERATE COST=(li.distance), EXTRACTCOST=(lw.xcost), MAXCOST=12*1,
NTLEGMODE = 35 LIST=T, DIRECTION=3, FROMNODE=1,TONODE=2052
The final nontransit legs saved will be: 1 - 2052 - 35 (and reverse)
Public Transport Program > Control statements > GOTO
GOTO
Jumps immediately to a named statement.
GOTO label
When GOTO is processed, flow immediately branches to the target statement, named
“:label.” Each GOTO statement must have an associated :label statement. Use care when
the :label statement is within a different IF or LOOP block. The target statement must begin
with a colon (:).
Public Transport Program > Control statements > GOTO > Example
Exam ple
In this example, the GOTO statement passes control in the forward and backward
directions.
GOTO hwybuild
.....
.....
:hwybuild
IF (expression) GOTO :hwybuild
Public Transport Program > Control statements > IF... ELSEIF ... ELSE ... ENDIF
• A block of statements:
IF (expression)
ELSEIF (expression)
ELSE (expression)
ENDIF
You must predefine any expression variables in an earlier COMP VAR statement. (The
program automatically defines any variables not predefined, but with a dot (.) in their
name as numeric variables.)
You may nest but not overlap IF... ELSEIF ... ELSE ... ENDIF blocks. They may not overlap
LOOP ... ENDLOOP blocks.
• COMP
• CONTINUE
• EXIT
• GOTO
• PRINT
Public Transport Program > Control statements > IF... ELSEIF ... ELSE ... ENDIF > Example
Exam ple
Each row represents an origin (I) zone and each column represents a destination (J)
zone. Typically, you use JLOOP ... ENDJLOOP blocks for matrix computations that you
cannot complete with a single COMP M W control statement.
JLOOP blocks may not be nested, and may not overlap other JLOOP, LOOP, or IF blocks.
J LOOP k e y wo rd s
Ke y wo rd D e s c rip tio n
A JLOOP block causes the program to loop between the JLOOP statement and its
ENDJLOOP statement, moving J from Jbeg to Jend in increments of Jinc. The logic for
JLOOP and ENDJLOOP processing is:
• At JLOOP:
m
If J is specified, establish values for Jend and Jinc.
m
Else set J=1, Jend=Zones, Jinc=1.
m
If (J < 1 or J > Zones or Jend <1 or Jend > Zones), terminate fatally.
m
Process statements within JLOOP.
• At ENDJLOOP:
m
Add Jinc to J.
m
If (Jinc > 0 and J <= Jend) go to statement following JLOOP.
m
If (Jinc < 0 and J >= Jend) go to statement following JLOOP.
m
Control passes to statement following ENDJLOOP.
The program processes all statements between the JLOOP and ENDJLOOP statements,
including COMP MW statements, with the current value of J.
The following statements are valid within a JLOOP block:
• BREAK
• COMP
• CONTINUE
• EXIT
P ha s e J LOOP p ro c e s s ing
MATI and Program executes JLOOP once per matrix row (or
MATO origin zone). You may use J keyword to select
destination zones.
1 Program performs no matrix processing during these phases. Therefore, there is no destination zone.
However, JLOOP statements are valid, and will act as a zonal loop.
Public Transport Program > Control statements > JLOOP ... ENDJLOOP > Example 1
Exam ple 1
Exam ple 2
LINE
Describes the attributes of public transport lines, including the nodes the line traverses
and attributes of those nodes. Keywords and sub-keywords include:
• A LLS T OP S • ON E W A Y
• CIR CU LA R • OP E R A T OR
• COLOR • R U N IN T E R V A L
• CR OW D CU R V E • R U N T IME
• CR U S H CA P • S E A T CA P
• DAYT YPE • S H OR T N A ME
• FA R E S Y S T E M • S T A R T T IME S
• HEADW AY • U S E R A 1, U S E R A 2,
U S E R A 3, U S E R A 4,
• H E A D W A Y _R USERA5
• LOA D D IS T FA C • U S E R N 1, U S E R N 2,
U S E R N 3, U S E R N 4,
• LON GN A ME
USERN5
• MOD E
• V E H ICLE T Y P E
• N A ME
• XY S P E E D
• N OD E S o r N
m ACCESS
m ACCESS_C
m DELAY
m DELAY_C
m DWELL
m DWELL_C
m FMOFF
m NNTIME
m OFF1
m ON 1
m RT
m SPEED
m TF
m TIME
m VOL1
m XYSPD
LINEkeywords describe the line’s attributes. Some are required; some are optional.
None are “trigger” keys; you must code all keywords on a LINE control statement.
You may input lines to the Public Transport program in ASCII format, in up to seven files
with FILEI LINEI, or in the Public Transport network file with FILEI NETI.
The Public Transport program outputs lines to the binary Public Transport network
defined by FILEO NETO and to the ASCII file defined by FILEO LINEO .
When crowding is used, the Public Transport program’s Loading Models append results
of a crowd run to the output LINE data with the FM CAPACITY keyword.
Lines traverse two or more nodes, which you define with the NODES keyword. Nodes
have their own attributes, defined with subkeywords (ACCESS , ACCESS_C , DELAY,
DELAY_C , NNTIM E , RT , SPEED , TF , TIM E , and XYSPD ). The Public Transport program’s
loading models append the results of the loading process to line nodes, using the
keywords FM OFF , FM ON , FM VOL , OFF 1 , ON 1 , and VOL 1 . These data items form part of an
output FILEO LINEO file, but the program does not read this data when processing a
FILEI LINEI file.
Several of the LINE keywords and NODES subkeywords adjust network link times by line.
See “Calculation of line/link times” on page 883 for an explanation of how they interact
with each other to produce the adjusted link times.
LIN E k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
NODES SPEED |R| Optional. Speed for all current link and
subsequent links in the line, until the next
SPEED or TF subkeyword.
SPEED overrides the TIMEFAC keyword
value. The program uses TIMEFAC for
links the line traverses until encountering
SPEED or TF, and then uses that value.
Valid values are numbers greater than
or equal to 1.
NODES XYSPD |R| Optional. Sets the line’s speed for the
current link and any subsequent links not
in the input network until encountering the
next XYSPD subkeyword. Overrides the
value of XYSPEED.
Do not code XYSPD for two-way lines.
Doing so produces an error.
Valid values are numbers greater than
or equal to 1.
NOTE: XYSPD inputs support two
decimal places. More may be specified,
but only two will be saved in the output
lines file. Please see “Considerations on
numeric formats” on page 850.
1 The Public Transport program saves the results of a loading operation to this NODES subkeyword.
Public Transport Program > Control statements > LINE > Example > Example
Exam ple
LINE NAME="GMB1-24M", MODE=7, OPERATOR=11, ONEWAY=T, CIRCULAR=F, HEADWAY=12,
N=778, -777, 776, 773, 774, 765, 3674, 764, -763, 759, 760, -3673, -756, 752
Public Transport Program > Control statements > LINE > Calculation of line/link times
• Set link time to the computed X-Y distance divided by either XYSPEED or XYSPD, as
appropriate.
• Set link time to T IME if specified.
• Add D E LA Y or D E LA Y _C to link time, if specified.
• Add turn penalties to the approach link of the modelled intersection.
The program applies scaling to link travel time, DELAY and DELAY_C values. The program
does not scale dwell times and junction delays, but retains their original settings.
If you set PARAMETERS EXTENDRUNTIMES to true and the total time calculated from link
times, delays, dwell times, and intersection delays exceeds the specified value, then the
program increases the NNTIME, RT, or RUNTIME value to this total.
Public Transport Program > Control statements > LINKLOOP ... ENDLINKLOOP
NOTE: You can nest LINKLOOP blocks within other blocks such as IF or LOOP, but not
another LINKLOOP.
Public Transport Program > Control statements > LINKLOOP ... ENDLINKLOOP > Example
Exam ple
where:
• Var is the required user-specified name of the loop-control variable. The program does not
protect the value of Var during the loop; computation, program, and other LOOP statements
may alter the value of Var.
• Begin is the constant value to which the program initializes Var. You must specify a value.
• End is the constant value that the program compares Var to when processing the ENDLOOP
statement. You must specify a value.
• Incr is the constant the program adds to Var before processing the ENDLOOP statement.
If the result of the comparison is true, the program branches back to the statement
following the LOOP statement. If it is false, control is passed to the statement following
ENDLOOP.
Processing of the ENDLOOP statement depends on the value of Incr:
• If Incr is positive, when the value of Var is less than or equal to End, the program goes to
the statement following LOOP, otherwise the program goes to the statement following
ENDLOOP.
• If Incr is negative, when the value of Var is greater than or equal to End, the program goes
to the statement following LOOP otherwise the program goes to the statement following
ENDLOOP.
The program tests the ENDLOOP condition (without incrementing the variable value) when
initializing the loop-control variable. If the test fails, the program does not perform any
statements within the LOOP block.
Public Transport Program > Control statements > LOOP ... ENDLOOP > Example 1
Exam ple 1
Exam ple 2
A nested loop, with the innermost loop executing twice for each value of variable xyz:
10,8,6,4,2.
LOOP xyz=10,1,-2
LOOP abc=1,2
.
.
ENDLOOP
ENDLOOP
Public Transport Program > Control statements > MODE
MODE
Defines the transit and nontransit modes that the public transport system uses.
Keywords include:
• LON GN A ME
• N A ME
• N U MB E R
All nontransit legs and transit lines belong to modes and refer to them by their numeric
identifiers. The MODE statement associates descriptive names with each mode. You can
include descriptive names in reports and graphics. Although not mandatory, Citilabs
recommends that you define the modes in use with the MODE statement.
Input MODE statements in the public transport system data file, specified with SYSTEM I.
MOD E k e y wo rd s
Ke y wo rd D e s c rip tio n
NT
Specifies the format of nontransit legs in the Public Transport network. Keywords
include:
• LE G
• A CT ION
• COS T
• D IS T
• FMV OL
• FMV OLT
• MOD E
• ON E W A Y
• SPEED
• V OL
• V OLT
• XN
You can generate nontransit legs with GENERATE statements or produce them with a
process external to the Public Transport program.
The program saves nontransit legs with the public transport network when processing a
NETO statement. You can use the output for modeling, reporting, and displaying. You
can feed the saved nontransit legs back to the modeling process when inputting the
public transport network with a NETI statement.
You can also save nontransit legs in the file specified with the NTLEGO statement. You
can use this format for reviewing and editing. You can feed these saved nontransit legs
back to the modeling process with a NTLEGI statement.
N T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
OPERATOR
Defines the operators in the public transport system. Keywords include:
• LON GN A ME
• N A ME
• N U MB E R
All lines belong to operators and refer to them by their numeric identifiers. The OPERATOR
control statement associates descriptive names with operators. You can include these
names in reports and graphics. Although not mandatory, Citilabs recommends that you
define the operators in use with the OPERATOR statement.
Input OPERATOR statements in the public transport system data file, specified with
SYSTEM I.
OP E R A T OR k e y wo rd s
Ke y wo rd D e s c rip tio n
PARAMETERS
Specifies global parameters for the Public Transport run. Keywords and sub-keywords
include:
• A ON ME T H OD
• CH A N GE A T LA S T S T OP
• E FA R E
• E XT E N D R E P OR T
• E XT E N D R U N T IME S
• FA R E
• FA R E MS G
• H D W A Y P E R IOD
m DELAY_DEFAULT
m DWELL_DEFAULT
m TIMEFAC
• MA P S CA LE
• MA XMW
• ME U S E S N T
• MOD IR E
• N OR OU T E E R R S
• N OR OU T E MS GS
• S KIP B A D LIN E S
• T R A N T IME
• T R IP S IJ
• U S E R CLA S S E S
• V 4R OU T E FOR MA T
• ZON E MS G
P A R A ME T E R S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
The DWELL_DEFAULT keyword is applied to all the stops except the first stop station
because the first stop station would be served on the scheduled operating time. If the
nodes are indicated as the non-stop with a negative sign in node number (or
STOPA=0), the dwell time would not be added into the nodes. As an example, the
'Comparison of run times in link level' shows the addition of 2 min for peak period only in
each transit stop station (e.g. STOPA=1).
< Transit line coding: 2 min for peak and 1 min for off-peak >
LINENAME="B6 EB", LONGNAME="Stockton-Wilson EB", HEADWAY[1]=60,
HEADWAY[2]=60, MODE=21, ONEWAY=T, OPERATOR=1,
CIRCULAR=F, DWELL_DEFAULT[1]=2, DWELL_DEFAULT[2]=1,
USERA3="Line 026", USERA2="B6", USERA1="LOCAL",
N=11964, -11967, -11960, -11965, -11962, -11966,
-11963, -11969, DELAY=5, N=11961, -11968, -11972,
-11959, -11958, -11956,
Public Transport Program > Control statements > PARAMETERS > Example > Example of DELAY_DEFAULT keyword
The DELAY_DEFAULT keyword is applied to all the links except the link specified with either
DW ELL or DW ELL_C sub-keyword. It simply adds the delay time into each link. As an
example, the 'Comparison of run times in link level' shows the addition of 1 min for peak
period for every link except the link 11969-11961 with 'DELAY=5'.
< Transit line coding: 1 min for peak and 0.5 min for off-peak >
LINENAME="B6 EB", LONGNAME="Stockton-Wilson EB",
HEADWAY[1]=60,HEADWAY[2]=60, MODE=21, ONEWAY=T,
OPERATOR=1, CIRCULAR=F,DELAY_DEFAULT[1]=1,
DELAY_DEFAULT[2]=0.5,USERA3="Line 026", USERA2="B6",
USERA1="LOCAL", N=11964, -11967, -11960, -11965,
-11962, -11966, -11963, -11969, DELAY=5, N=11961,
-11968, -11972, -11959, -11958, -11956,
Public Transport Program > Control statements > PARAMETERS > Example > Example of TIMEFAC keyword
The TIMEFAC keyword is applied to all the links except the links specified with either
NODES TF or NODES SPEED sub-keyword. It simply multiplies the runtime by the
input factor value into in each link. As an example, the 'Comparison of run times in link
level' shows the increase of link runtime by approximately twice for every link for peak
period because 'TIMEFAC[1]' is 2.0. Note that the time proportions in the summary table
are not exactly same as 2.0 for peak period due to the rounding issue in the dBase
format.
< Transit line coding: 2.0 min for peak and 1.5 min for off-peak >
LINENAME="B6 EB", LONGNAME="Stockton-Wilson EB",
HEADWAY[1]=60, HEADWAY[2]=60, MODE=21, ONEWAY=T,
OPERATOR=1, CIRCULAR=F, TIMEFAC[1]=2.0,
TIMEFAC[2]=1.5, USERA3="Line 026", USERA2="B6",
USERA1="LOCAL", N=11964, -11967, -11960, -11965,
-11962, -11966, -11963, -11969, DELAY=5, N=11961,
-11968, -11972, -11959, -11958, -11956,
Public Transport Program > Control statements > PARAMETERS > More on user classes
• Nontransit legs, generated with the GENERATE control statement, input with N T LE GI, or both
• Skim data, output with MA T O , specifies level-of-service data that can vary by user class.
• Routes are enumerated and evaluated by user class. Routes are input with R OU T E I, and
output with ROUTEO.
You must specify FACTORI and MATI files by user class. However, if there are no
differences between the behavior for some user classes, you can point those user
classes to the same FACTORI file.
For example, suppose you want to define input files for user classes 1, 3, and 4. User
class 3 and 4 use the same factors. You might create the following control statements:
FILEI FACTORI[1]= FACTSUC1.FAC, FACTORI[3]=FACTSUC3.FAC, FACTORI[4]=FACTSUC3.FAC
FILEI ROUTEI[1]=ENROUTEUC1.RTE, ROUTEI[3]=ENROUTEUC3.RTE, ROUTEI[4]=ENROUTEUC4.RTE
The Public Transport program outputs a public transport network that contains the four
components that are common to all user classes (network infrastructure, system data,
nontransit legs, and line data) and that contains the factors for all user classes.
The program outputs user-class-specific enumerated routes files (ROUTEO), matrices
(M ATO ), and skims and select link analyses.
You define input and output files for user classes with the FILEI and FILEO control
statements.
Public Transport Program > Control statements > PRINT
PRINT
Specifies the format for data items output in a single line to the standard printed output, a
file, or both.
The program prints one line for each PRINT statement. The length of the printed line is
determined by the formatting of each listed item.
See “PRINT” on page 69 for details about the standard Cube Voyager control
statement.
Public Transport Program > Control statements > PRINTROW
PRINTROW
Specifies format for reporting work matrices to the main print file.
See “PRINTROW” on page 77 for details about the standard Cube Voyager control
statement.
Public Transport Program > Control statements > PRINTROW > Example
Exam ple
PTRUN
The PTRUN control is used within LINEI files for providing detailed timetable information
for each RUN Read from LINEI (based on the LINE control). Keywords and sub-
keywords include:
• DAYT YPE
• N OD E S
m AT
m ARR
m DEP
• OFLIN E
PTRUN keywo rds
Ke y wo rd S ub k e y wo rd D e s c rip tio n
REPORT
Generates reports. Keywords and sub-keywords include:
• LIN E S
m DEC
m SKIP0
m SORT
• LIN E V OLS
m DEC
m SKIP0
m STOPSONLY
m USERCLASSES
The program generates a third report, which shows passenger transfers between modes
and operators, when running the loading process.
R E P OR T k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
• F — Do not report
passenger loadings.
Default value is F.
See “Transit line loadings” on
page 933 for an example of this
report.
REREPORT
Produces reports showing the input simplified public transport network and allied data
structures that the route enumeration process uses.
Keywords include:
• A CCE S S LE GS
• E GR E S S LE GS
• LIN E
• LIN E S
• LIN E LIN E LE G
• LIN E ZON LE G1
• LIN E ZON LE G2
• N
• S T OP N OD E S
• T LE GS
• T R N LE GS 1
• T R N LE GS 2
• T R N LE GS 3
• T R N LE GS 4
• T T DEPS
• T T LE GS
• U S E R CLA S S
• XFE R LE GS
These basic reports help you understand the network-simplification and route-
enumeration processes. For examples, see “Network simplification” on page 947.
A run can have multiple REREPORT statements. A statement’s selections apply to the
reports generated by that statement. The statement outputs reports to the file specified
with REPORTO .
None of the REREPORT keywords are “trigger” keys; you must code all on a REREPORT
statement.
R E R E P OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
In the REREPORT statement below, all reports are for user class 1. Node-based reports
only apply to nodes 250-450, and line-based reports apply to lines with line names
beginning with MUNI.
//The REREPORT control statement name must be coded at the beginning of the
statement
REREPORT,
ACCESSLEGS=T,
EGRESSLEGS=T,
LINES=T,
TRNLEGS1=T, TRNLEGS2=T, TRNLEGS3=T, TRNLEGS4=T,
XFERLEGS=T,
LINEZONLEG1=T, LINEZONLEG2=T,
STOPNODES=T,
N=250-450, LINE='MUNI*', USERCLASS=1
Public Transport Program > Control statements > VEHICLETYPE
VEHICLETYPE
Defines the main vehicle types used by the transit lines operating public transit services.
Keywords include:
• N U MB E R
• CR OW D CU R V E
• CR U S H CA P
• LOA D D IS T FA C
• LON GN A ME
• N A ME
• S E A T CA P
A vehicle can be any form of transport that provides public transit service over fixed
routes, such as a bus, tram, train, ferry, or hovercraft. The vehicle definitions provide a
template that you can associate with one or more transit lines. You can amend vehicle
attributes on a line-by-line basis when needed.
You may define up to 255 vehicle types. The program includes no default vehicle types.
When transit lines operate with particular vehicle types, you may specify the vehicle type
in the LINE statement.
You must input VEHICLETYPE statements in the Public Transport system data file,
specified with SYSTEM I.
V E H ICLE T Y P E k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
WAITCRVDEF
Defines wait curves used to compute initial and transfer wait times at stop nodes based
on the frequency of services. See “Generalized cost” on page 936 for a description of
the wait-time calculation. Keywords include:
• N U MB E R
• N A ME
• LON GN A ME
• CU R V E
You may define up to 255 wait curves. You may allocate two wait curves to each stop
node with IW AITCURVE and XW AITCURVE . Use IWAITCURVE when the node is a trip’s first
boarding point and use XWAITCURVE at transfer points. Use the node-specific
W AITFACTOR to weight the wait time. You must input WAITCRVDEF statements in the Public
Transport system data file, specified with SYSTEM I.
The program provides default wait curves for initial boarding and transfers at stop nodes
where you do not assign wait curves. See “More on wait curves” on page 922 for details
about wait curves.
W A IT CR V D E F k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
Defining wait curve number 1 for stops in the central business area.
WAITCRVDEF NUMBER=1,
NAME="CENTRAL-AREA"
CURVE=
1-0.5,
15-7.5,
100-12.0
Public Transport Program > Control statements > WAITCRVDEF > More on wait curves
The program uses default wait curves at nodes where you do not assign wait curves.
The following diagram shows the default wait curve at the first boarding point.
For transit services with a frequency of 60 vehicles per hour or more, the default wait
time is set to half a minute. The default curve uses a constant wait time in this case
because services with very small headways tend to have irregularly arriving vehicles,
causing the relationship between wait time and headway to break down.
The default wait curve for transfer points is half the headway of all services visiting the
stop.
Public Transport Program > Control statements > WAITCRVDEF > More on wait curves > Rules for defining wait curves
• The curve runs from the point (1- 0.5) to the first coded point. Wait time is fixed at 0.5
minutes for headways less than one minute.
• Extrapolation beyond the last coded point occurs at the same gradient as immediately
below that point.
Reports
This section describes the reports that the Public Transport program produces. You
select reports using a variety of control statements. The program writes the reports to the
main Cube Voyager print file unless otherwise stated.
The program can produce the following reports:
• Enumerated routes
• Evaluated routes
• Fare matrices
• Transit line summary (including passenger hours and distance if loads are present)
The REREPORT control statement produces a series of basic reports that let you examine
and understand the network-simplification and route-enumeration processes. See
“Network simplification” on page 947 for examples of these reports.
Public Transport Program > Reports > Enumerated routes
Enumerated routes
You can produce a report of enumerated routes with the ROUTEO keyword and its
subkeywords, REPORTI and REPORTJ . The program writes the report to the file specified
by REPORTO .
This example shows routes from zone 1 to zone 9. The first line for each route shows
the access leg from the origin zone to the first boarding point. Subsequent lines for a
route show pairs of transit and nontransit legs with the names of the transit lines running
on the transit legs. The shown cost is used for selecting potential routes; it is not the cost
used for evaluating routes.
The program will discard some of these routes for various reasons, such as a probability
of use less than a user-specified minimum, or alighting and reboarding the same line.
The Evaluated Routes report (“Evaluated routes” on page 927) lists routes that are
actually used between the zones.
In this example, the program finds five (potential) physical routes between zones 1 and
9. Some offer more than one combination of services.
Public Transport Program > Reports > Evaluated routes
Evaluated routes
You can produce a report of evaluated routes using either the ROUTEI or the ROUTEO
keyword and the corresponding subkeywords REPORTI and TRACEI. The program writes
the report to the file specified by REPORTO . Reports produced with REPORTI list routes
taken; reports produced with TRACEI give a tabular output detailing component costs and
summaries for each mode. When using multirouting, the report lists all routes used and
the probability of taking each of them.
Specify the required origin zones with the REPORTI or TRACEI subkeywords and the
required destination zones with the REPORTJ or TRACEJ subkeywords. Note that REPORTI
requires REPORTJ, and vice-versa.
The following topics show:
• Example produced with REPORTI
This report shows multiple routes from zone 1 to zone 9, along with their probability of
use. The first line for each route shows the access leg from the origin zone to the first
boarding point. Subsequent lines for the route show pairs of transit and nontransit legs
with the names of the transit lines running on the transit legs.
The cost shown is the generalized cost of each route in minutes, weighted by the
probability of use. This cost includes walk and in-vehicle times, and boarding and
transfer penalties, but not wait time, which the program computes from the routes’
common segments for the origin-destination pair as a whole.
Public Transport Program > Reports > Evaluated routes > Example produced with TRACEI
This report shows two possible routes from 1129 to 757. For each route, the report lists:
• Leg-by-leg information. The report contains a printed line for each leg, starting with the
access leg, followed by alternating transit and nontransit legs, and ending with the egress
leg. For each leg, the printed line shows destination node, mode, wait time, travel time,
cumulative actual total cost, perceived boarding and transfer penalties, cumulative
perceived cost, distance, cumulative distance, and transit lines used (along with
probability).
• Mode information. For each mode used, the report lists actual travel time, distance, and
wait times.
• Trip fare. If you model fares, the report includes the trip fare, in monetary units.
Fare matrices
You can produce a report of fare matrices with the FAREMATI keyword in the REPORT
control statement. The program writes the report to the main print file. The report shows
the contents of the input fare matrices, specified with FILEI FAREM ATI and used by fare
systems defined by the FARESYSTEM control statement.
S a mp le fa re -ma tric e s re p o rt
FareMatrix(FMI.1.FROMTO) for FareSystem 3
(FAREZONE-FROMTO):
--------------------------------------------------
----------
J: I=1 FareSystem 3 Tot= 11
-- --- ---------- - ---- --
1: 1 1 2 3 4
J: I=2 FareSystem 3 Tot= 14
-- --- ---------- - ---- --
1: 1 1 3 4 5
J: I=3 FareSystem 3 Tot= 20
-- --- ---------- - ---- --
1: 2 3 4 5 6
J: I=4 FareSystem 3 Tot= 20
-- --- ---------- - ---- --
1: 3 4 5 1 7
J: I=5 FareSystem 3 Tot= 23
-- --- ---------- - ---- --
1: 4 5 6 7 1
Public Transport Program > Reports > Transit line summary
This example shows transit lines sorted by mode. Because the public transport network
includes line loadings, this report includes passenger distance and passenger hours.
This report shows data for all user classes. The program also produces a separate
report for each user class.
If the public transport network does not include line loadings, the program only reports
transit line attributes once, as the attributes are common to all user classes.
Public Transport Program > Reports > Transit line loadings
This example report shows the number of passengers boarding, alighting, and riding
through the nodes of a transit line. This report shows only stopping nodes with some
passenger activity because STOPSONLY and SKIP0 are set to T.
This report shows data for all user classes. You can request a separate report for each
user class.
If the program performed crowd modeling with wait-time adjustments, the program would
supplement reports showing all user classes with columns showing the flow-metered
boarding, alighting, and through-ridership volumes.
Public Transport Program > Reports > Transfers between modes
• A report showing transfers between transit modes (ignoring walk transfers between transit
modes)
The program produces these reports for each user class and for all classes combined.
Theory
This section discusses the theory used in the Public Transport program:
• Generalized cost
• Modeling approach
• Network simplification
• Route-enumeration process
• Route-evaluation process
• Skimming process
• Loading process
• Fares
• Crowding
Public Transport Program > Theory > Generalized cost
Generalized cost
Generalized cost is a measure of the main components of a Public Transport trip.
The generalized cost of a public transport trip has three components:
• Time
m
Walk time (nontransit time)
m
Wait time
m
In-vehicle time
• Inconvenience
m
Boarding penalty
m
Transfer penalty
• Cost
m
Fare
The Public Transport program measures generalized cost in time, using minutes as the
s working units. Fares, if used, are input in monetary terms and converted into the
corresponding time units.
Subsequent sections provide details about individual components and their weighting
factors.
Public Transport Program > Theory > Generalized cost > Walk time (nontransit time)
• Between an origin and destination zone, without using any transit mode
You can develop walk links outside the Public Transport program and input the links to
the program, or you can develop the walk links when developing the public transport
network.
A link’s walk time (nontransit time) is typically the actual travel time. To convert the times
to perceived values (for inclusion in generalized costs), you can weight the link times
with the RUNFACTOR keyword.
Public Transport Program > Theory > Generalized cost > Wait time
Wait time
The program uses the combined headway of available transit services to compute the
wait time at any boarding point. Specifically, the program computes wait time from wait
curves that you specify. If you do not specify any wait curves, the program uses default
wait curves. To represent passengers’ ability to control wait time at the start of a trip but
not at transfer points, you may specify different wait curves for initial and subsequent
boardings at each node.
You define wait curves with the WAITCRVDEF control statement. You assign wait curves to
nodes with IW AITCURVE and XW AITCURVE keywords in the FACTORS control statement.
You can weight the wait times with the node-specific W AITFACTOR keyword.
The program uses default wait curves at nodes where you do not assign wait curves.
See “Default wait curves” on page 923 for a description of the default wait curves.
When the program performs crowd modeling with wait time adjustments, passengers
might experience additional wait time attributable to crowding. For example, a transit
service might be so loaded that a passenger cannot board (and must wait for a later
service). Similarly, a network bottleneck might occur (where demand exceeds capacity,
and some passengers cannot proceed forward within the modeled period). You model
these additional wait times with a node-specific W AITFACTOR keyword in the FACTORS
control statement.
Public Transport Program > Theory > Generalized cost > In-vehicle time
In-vehicle time
In-vehicle time is the time passengers spend travelling in a public transport vehicle for
each transit leg of a trip. If a trip has more than one leg, the value is the total in-vehicle
time for all legs.
You can weight in-vehicle time with a transit-mode-specific value specified with the
RUNFACTOR keyword.
When performing crowd modeling with link travel-time adjustments, the program also
weights in-vehicle time with a crowding factor.
Public Transport Program > Theory > Generalized cost > Boarding penalty
Boarding penalty
Boarding penalty is a fixed penalty applied at each boarding (that is, at the start of the
trip) and at each interchange. You may specify separate penalties for each mode. The
default penalty for each mode is zero (that is, no penalty).
You specify boarding penalties by mode with the BRDPEN keyword.
Public Transport Program > Theory > Generalized cost > Transfer penalty
T ransfer penalty
Transfer penalty is the transit-mode-to-transit-mode interchange penalty, which
represents the inconvenience of transferring between modes. The program applies this
penalty at transfer points, even if there is walking between the two modes. The penalty is
based on a combination of alighting and boarding modes.
The transfer penalty applies in addition to the boarding penalty for the subsequent transit
leg. For transfers between the same mode, you might set the transfer penalty to a
negative value to counteract or reduce the boarding penalty applied to the subsequent
leg of that mode.
You can ban changes between modes by setting a high transfer penalty, such as 999,
for that mode-to-mode combination. All mode-to-mode penalties default to zero—that is,
there are no penalties by default.
You specify transfer penalties with the XFERPEN keyword. You may add constants to
transfer penalties with the XFERCONST keyword, and you may weight transfer penalties
with the XFERFACTOR keyword.
Public Transport Program > Theory > Generalized cost > Fare
Fare
By defining fare models, you can include fares in the route-evaluation and skimming
processes. Fare models describe how the program computes the fare for part of a trip or
for an entire trip.
You define fare models with the FARESYSTEM control statement, and specify the input file
with the FILEI control statement and FAREI keyword.
You associate fare models with transit lines two ways:
• Directly with the LINE statement and FA R E S Y S T E M keyword
• Through their mode or operator attribute, with the FACTORS control statement and
FA R E S Y S T E M keyword
Public Transport Program > Theory > Generalized cost > Route enumeration cost calculation
• Boarding penalty
The route-enumeration process uses a simple estimate of wait time for each leg
bundle. The process computes the headway for each bundle’s boarding node from
the sum of the frequencies of the bundle’s legs. The process sets the wait time to half
this headway, weighted by WAITFACTOR. Where necessary, the process adjusts the
resulting value to fall within the range set by REWAITMIN to REWAITMAX. You can
exclude wait time from the route-enumeration process by setting these factors to zero.
• Walk time, taken directly from nontransit legs and weighted by an appropriate RUNFACTOR
When modeling best paths (or when REBESTPATHCOST is T), the route-enumeration
process handles some of these components differently. In this case:
• Calculations of wait and in-vehicle time depend on the value of FR E QB Y MOD E :
m
When true (default value), the process computes these times for individual modes (and
the value for fastest mode subsequently used in enumeration).
m
When false, the process computes these times across all modes in a transit leg bundle.
• In-vehicle time is based on the average value for lines in the transit leg bundle. The
process uses the calculations described in “SFM and SFCM examples” on page 975 to
discard any slow routes in the bundle and to obtain the required value.
• Wait time is calculated using initial or transfer wait curves and W A IT FA CT OR (as in the route-
evaluation process). The process uses the headway of the transit-leg bundle (or the lines
of a particular mode in the bundle) after discarding any slow routes. For best-path models,
the route-enumeration process uses transfer penalties (based on XFE R CON S T ,
XFE R FA CT OR , and XFE R P E N ) when identifying discrete routes.
The route-enumeration process does not consider fares, and ignores transfer penalties
except when modeling best paths. Instead, the route-evaluation process disaggregates
transit-leg bundles by mode to apply transfer penalties. Using fares and transfer
penalties with leg bundles during route enumeration could eliminate valid routes. For
example, consider a banned transfer between transit modes 3 and 5. Routes transferring
from a mode-3 leg to a mode-5 leg would be eliminated. However, suppose these legs
are the top legs in bundles that contain legs of other modes. These other legs would
also be eliminated.
The route-enumeration process adds wait time to the time of each bundle’s top leg to
obtain a transit-leg cost.
The report produced by the TRNLEGS3 keyword in the REREPORT control statement shows
the generalized cost of transit legs used during the route-enumeration process.
Public Transport Program > Theory > Modeling approach
Modeling approach
This section discusses the algorithms that the Public Transport program uses. The
program supports two distinct modeling methods: multirouting and best-path. For both
modeling methods, the program finds attractive or reasonable routes, (that is, routes that
have some probability of use), in three steps: network simplification, route enumeration,
route evaluation. You can restrict modeling to consider just those routes that use a
particular transit mode at some stage in the trip.
This section discusses:
• Multirouting and best-path methods
• Network simplification
• Route enumeration
• Route evaluation
For example, suppose travelers waiting at node N have a choice between two routes to
reach the trip’s destination. The first route uses line L, which runs every 20 minutes and
takes 15 minutes to reach the destination after boarding. The second route uses line M,
which runs every 30 minutes and takes 11 minutes to reach the destination. Either line
offers an efficient effective route towards the required destination. Taking these values
as components of the generalized cost (without need for further weighting), you can
compute an expected travel time from the stop to the destination.
In a multirouting model, travelers are prepared to board whichever bus comes first.
There are a total of five services per hour. Assuming equal spacing of departures, the
combined headway is 12 minutes and average wait is 6 minutes. The cost to the
destination is the wait time plus travel time, either 11+6 or 15+6, that is, 17 or 21.
Assuming route usage proportional to service frequency, the average time to destination
is 19.4 minutes.
In a best-path model, travelers choose between the two routes and then wait for a
service on the chosen transit line (ignoring any service on the other line). Travelers
assess attributes of each route: L has an average wait of 10 minutes and travel time of
15 minutes, for a total cost of 25 minutes. M has an average wait of 15 and travel time of
11, for a total of 26 minutes. Therefore, travelers using the best-path method would
select transit line L, with an average trip cost of 25 minutes.
Model developers must decide between the two methods. The appropriate method
might depend on externally imposed requirements or practices (for example, guidelines
from government departments) or a choice regarding the suitability of each method.
Many modelers prefer the multirouting method in cities with extensive, well-developed
public transport systems.
Public Transport Program > Theory > Modeling approach > Network simplification
• Nontransit legs
• Line-zone leg
• Line-line legs
See “Network simplification” on page 947 for a description of these data structures.
Public Transport Program > Theory > Modeling approach > Route enumeration
Route enumeration
For multirouting modeling, the route-enumeration process finds all potentially attractive
routes and enumerates them. The process follows three principles:
• The trip should move progressively from the origin to the destination.
• Travelers prefer simpler trips, that is, direct trips or trips that involve few transfers.
Route evaluation
For multirouting models, the route-evaluation process takes the explicit list of reasonable
routes between an origin and destination and determines which routes passengers will
use to make trips and what fraction of passengers will use each route.
The route-evaluation process treats the routes like a hierarchy of conditional choices:
Each stop or branch point represents a decision whether to board a service, alight from
a service, or walk elsewhere to board another service. The program uses conventional
algorithms to forecast these individual choices. For example, the program uses
information about the trip sequence to preclude alighting and reboarding the same
service.
For best-path models, the route-evaluation process identifies the best path using a
similar evaluation method, and assigns all demand to that route.
Public Transport Program > Theory > Modeling approach > Limiting selected routes to particular transit modes
Network simplification
Public transport networks are often quite detailed and data intensive. To improve
algorithm performance and minimize memory and temporary disk storage, the Public
Transport program simplifies the network for enumerating and storing routes. The
program stores the simplified network in intermediate data structures, which you can
examine to gain an understanding of how multirouting works in the Public Transport
program.
Use the DELM ODE , DELACCESSM ODE , and DELEGRESSM ODE factors to remove legs of
particular modes from the network representation. The program does not use specified
legs at any stage in the modeling.
This section introduces the network representations used for:
• Transit legs
• Transit-leg bundles
• Nontransit legs
• Line-zone legs
• Line-line legs
Public Transport Program > Theory > Network simplification > Transit legs
T ransit legs
A transit leg is a trip segment, from a boarding point to an alighting point, that uses a
single transit line. Travel on the transit line can be over one or more links in the public
transport network. (A trip consists of an access leg, and one or more pairs of transit leg
bundles and nontransit legs, the last of which is the egress leg.)
Use the REREPORT control statement and LINES keyword to produce a line-attribute report.
Use the REREPORT control statement and TRNLEGS3 keyword to produce a line-ordered
transit-leg report.
T ransit-leg bundles
A transit-leg bundle is a collection of transit legs that use different transit lines but board
and alight start at the same node. Transit-leg bundles have the following properties:
• The “top leg” of the bundle is the cheapest in terms of travel time (in the example all legs
within bundles have the same time).
• They may or may not traverse the same links of the underlying network.
This sample shows transit legs from node 875, including three sets of leg bundles: from
node 875 to nodes 753, 757, and 751. When multiple lines connect node 875 to an
alighting node, the report marks the top line (the fastest line or the first line, if all have
equal time) with “*.” All legs in a bundle have the same actual in-vehicle time, but the
REnum time for the bundle’s top leg includes an estimate of the bundle’s waiting time.
(Do not confuse this waiting time with the wait time calculated during the route-
evaluation process. See “Generalized cost” on page 936.)
Public Transport Program > Theory > Network simplification > Nontransit legs
N ontransit legs
Nontransit legs are minimum-cost segments, traversed by nonmechanized modes.
Nontransit legs connect:
• Zones and stop nodes or stop nodes and zones that allow access to and egress from the
transit system
Nontransit legs may traverse none (special case), one, or multiple physical links. The
program derives leg attributes from link attributes.
The program can generate nontransit legs with the GENERATE control statement, input
user-specified nontransit legs, or do both. The program associates a cost with these
nontransit legs.
The program automatically generates a third type of “notional” nontransit leg, which
allows transfers between two lines visiting the same node. Such nontransit legs do not
have any associated cost.
Boarding and transfer costs apply to both types of transfers—those occurring at a node
and those between two nodes connected with a physical nontransit leg.
Use the REREPORT control statement and ACCESSLEGS, EGRESSLEGS, and XFERLEGS
keywords to produce nontransit-leg reports.
Line-zone legs
During network simplification, the program expands access and egress nontransit legs—
legs from zone to stop node and vice versa—into zone to line and line to zone legs. The
program stores line-zone legs as pointers to the corresponding access and egress
nontransit legs along with some additional information that helps improve the
performance of the route-enumeration algorithm.
When multiple access and/or egress legs exist between a zone and a line, the program
might eliminate some legs or restrict their use to ensure that routes starting or terminating
on a line use distinctive segments and do not overlap. For best-path models, the
program uses all connectors to ensure identification of the best route; because the
program selects exactly one best route, overlapping segments are not possible.
For multirouting models, the program eliminates multiple access legs by applying the
following rules:
• Among a set of legs accessing consecutive stops (disregarding intermediate nonstopping
nodes), select the leg with the least generalized cost and discard the others. (Between legs
of equal cost, select the downstream leg.) If SHORTESTWALK=F then selection is based
on lowest travel time to some downstream point on the line (rather than shortest leg cost).
• Always retain the first access leg (that is, the leg connected to the transit line’s earliest
stop).
• If the cost of the “first access + riding to the next” is more than the cost of the next access,
those boarding at the first access may only ride until the stop before the next access.
• If the cost of the “first access + riding to the next” is less than the next access, discard the
next access.
• Each access has a stop up to which those boarding can ride; either to the stop before the
next valid access or to the end of the line.
For multirouting models, the program eliminates multiple egress legs by applying the
following rules:
• Among a set of legs providing egress from consecutive stops (disregarding intermediate
nonstopping nodes), select the leg with the least generalized cost and discard the others.
(Between legs of equal cost, select the upstream leg.) If SHORTESTWALK=F then
selection is based on travel time from some upstream node on the line.
• Always retain the last egress leg (that is, the leg connected to the transit line’s latest stop).
• If the cost of an egress leg is more than the cost of “riding to the next + next egress,”
discard the leg.
• If the cost of the an egress leg is less than the cost of “riding to the next + next egress,”
then only those boarding after the current egress can use the next one.
• Each egress has a stop that specifies the beginning of a range of valid boarding stops; this
may be the stop after the previous valid egress or the beginning of the line.
Line-line legs
During network simplification, the program expands nontransit legs between stop nodes,
direct transfers at the same stop node, and walk transfers between stops into line-to-line
legs. The program stores line-line legs as pointers to the nontransit transfer legs along
with some additional information that improves the performance of the route-
enumeration algorithm.
The route-enumeration process eliminates some transfer legs. When generating line-to-
line legs, the program applies the following rules:
• For multirouting, among multiple connectors between consecutive stops on a “from-line”
and consecutive stops on a “to-line,” retain only the lowest-cost connector; discard the
others. If SHORTESTWALK=F then the connector with shortest through travel time from
an upstream node on the from-line to a downstream node on the to-line is selected (rather
than the lowest cost connector).
• Do not permit transfers from a transit line’s first node; passengers must use the line before
transferring.
• For circular lines with the same first and last nodes, permit boarding at the first node and
alighting at the last node.
• For multirouting, prohibit transfers involving backtracking, such as if the node prior to
alighting is the same as the one after boarding.
• If two lines traverse the same physical route with the same stop characteristics, record only
one transfer location for consecutive stops.
For example, consider the following transit lines.
In this case, the program only records one transfer location between
Lines A and B instead of four—the last stop. The program relaxes this
restriction during route evaluation to give flexibility in transfer location, especially when
modeling crowding.
However, if stop 2 is a stopping node for line A and not for line B, then the program
records two transfer locations: one at stop 1 and one at stop 4 (representing transfers
at stops 3 and 4). If two lines meet at nonconsecutive stops, diverging between them,
the program records a transfer location at each stop where they meet.
Use the REREPORT control statement and LINELINELEG keyword to produce line-to-line
transfer-leg reports.
Route-enumeration process
Route enumeration is a heuristic process that identifies a set of discrete routes between
zone pairs along with the probability that passengers will use the routes to travel
between the zones. Use keywords in the FACTORS and PARAMETERS control
statements to control the route-enumeration process.
The program measures trip cost differently during route-enumeration than during route-
evaluation. See “Route enumeration cost calculation” on page 940.
Route enumeration has three distinct stages:
• Finding minimum-cost routes
• Enumerating routes
The process varies only slightly when you specify a must-use mode. See “Enumerating
routes with a must-use mode specified” on page 964. Public Transport also includes an
option to enhance the stability of the process under small variations of input network
characteristics. See “Modified route enumeration process” on page 965.
Public Transport Program > Theory > Route-enumeration process > Finding minimum-cost routes
where:
• Node pair 1->1276 is the access leg from node 1.
• Triplet 1276->1572->1583 represents a transit leg between node 1276 and node 1572 on
line 744 or 746, and a nontransit-transfer leg between node 1572 and node 1583.
• Triplet 1583->1654->100 represents a transit leg between node 1583 and node 1654 on
line 399, 476, 478, 486, 489, 493, or 495, and an egress leg between node 1654 and node
100.
The route via lines 744 and 399 will have the best travel cost; the other routes may have
the same or slightly longer vehicle travel time.
The route minimizes the generalized cost, not the number of transfers. Therefore,
identified routes might have more than M AXFERS transfers. However, you can reflect the
impact of transfers in the generalized cost with sensible boarding penalties.
You can specify a “spread,” an upper cost limit for routes between an O-D pair when
using multirouting. Select the function for calculating the spread with the SPREADFUNC
keyword, and specify function parameters with the SPREADFACT and SPREADCONST
keywords. The route-enumeration process uses the costs from the minimum cost routes
and the spread to determine a maximum cost value for “reasonable” routes to that
destination.
Similarly, to set the maximum number of transfers permitted on “reasonable” routes to a
destination, the route-enumeration process uses the number of transfers from the
minimum-cost routes along with EXTRAXFERS1 and EXTRAXFERS2 .
Minimum-cost routes minimize some combination of user-specified trip attributes.
Passengers might not select such routes. This is a reason to prefer multirouting, which
includes both the direct and indirect routes in the full list of enumerated routes.
If a destination’s minimum-cost route uses more than M AXFERS transfers and the route-
enumeration process has identified no other routes, then the process will enumerate this
single route provided the route has no more than AONM AXFERS transfers and the route
meets any must-use-mode requirements.
Public Transport Program > Theory > Route-enumeration process > Establishing connectivity between lines
For this network, the route-enumeration process generates the following connectors for
line A:
• Line A to line B (note there are two interchange points between these lines)
• Line A to line D
Line-to-line legs handle all transfers—direct, between lines A and B and lines B and C,
and by walking, between lines A and B and lines A and D.
Public Transport Program > Theory > Route-enumeration process > Enumerating routes
Enumerating routes
After generating the connectors for a transit line, the route-enumeration process
enumerates routes for each selected origin zone connecting to the line via a valid
access leg. The process uses two steps:
• Expand routes with viable connections
m
Record the beginning of the first route: origin zone and nontransit (access) leg.
m
Examine the transfer points between the first two lines of the connector. If the transit leg
used on the first line is the bundle’s top leg, and the time to the next boarding point (that
is, the sum of time for transit and nontransit legs) is within the spread established
earlier, and the number of transfers meets the constraints set by MAXFERS,
EXTRAXFERS1 and EXTRAXFERS2, extend the route by the transfer.
m
Examine each interchange between the two lines in the same way.
m
Repeat the process for the subsequent lines in the connector set until connections have
been fully expanded.
For example, consider the connector, “line A to line C via line B,” shown in the example
in “Establishing connectivity between lines” on page 962. The route-enumeration
process generates the routes in the following table.
O O-A x
(access)
The process does not re-record the common parts of routes, shown in italics.
Public Transport Program > Theory > Route-enumeration process > Enumerating routes with a must-use mode specified
Route-evaluation process
The route-evaluation process calculates the “probability of use” for each of the
enumerated routes between zone pairs.
The process discards enumerated routes that fail to meet certain criteria, such as routes
with a probability of use less than the minimum specified by CHOICECUT . Before
computing probabilities, the process removes routes that alight and reboard the same
service.
See “Generalized cost” on page 936 for a description of the trip cost used in route
evaluation.
The remainder of this topic presents:
• Methodology of route evaluation
Where:
λ
is a scale parameter which reflects the
travelers sensitivity to cost differences
At choices between transit alternatives, the process computes the cost to the destination
by adding the cost of the transit leg (including boarding and transfer penalties) and the
expected cost to the destination from the end of the transit leg. Then, the process
combines the values for the transit alternatives into a single value for the expected cost
from the node to the destination. This is calculated as the average of the costs
associated with each alternative (weighted by the probability of passengers taking the
alternative).
In calculating the transit element of the expected cost to destination, the process applies
an additional condition to ensure that adding (or improving) services does not increase
costs. Specifically, the process examines each service operating between a pair of
boarding and alighting points and includes the service if the resulting reduction in wait
time exceeds the resulting increase in travel time. The process ensures that the
expected time to the destination from the boarding node improves when a service is
included in the set of attractive alternatives. This set of services is known as the basic
choice set.
Public Transport Program > Theory > Route-evaluation process > Models applied at decision points
• Transit choices
The route-evaluation process applies the walk-choice model when passengers have
alternative walk choices available. For example, when passengers leave the origin or
alight from a service, they might walk to their destination, board a different line at that
stop, or walk to another stop for the next transit leg.
This model has a logit structure:
Where:
λ
is the scaling factor for the model
(LAMBDAW)
The scaling factor LAMBDAW controls the shape of the logit curve used to allocate
passengers to alternatives at each decision point. Large the scaling factors produce a
smaller spread of trips between alternatives—that is, more trips are allocated to the best
route. Conversely, low scaling factors produce trips spread over a wider range of
alternatives.
The X-axis shows the difference between the time by service i, ECDi, and the time by
the best service, ECDbest. The Y-axis shows the proportion of trips allocated to the
longer choice when a binary choice is available. The diagram plots three different values
for the scaling factor: 0.2, 0.5, and 1. The curve for LAMBDAW = 0.5 shows that a
choice five minutes longer than the best would be allocated 7.6% of the total trips. With a
scaling factor of 0.2, the longer route gets 26.9% of trips, but with a scaling factor of 1.0,
the longer route gets only 0.67% of trips. Thus, longer routes get a larger share of the
trips as the scaling factor is reduced.
Public Transport Program > Theory > Route-evaluation process > Models applied at decision points > Transit choices
Two models are available to allocate passengers to the transit choices available at a
stop: the service-frequency model (SFM) and the service-frequency-and-cost model
(SFCM). SFM considers only service frequency while SFCM also considers the cost to
the destination. See “SFM and SFCM examples” on page 975 for examples that show
how the two models treat transit choices at a stop.
Service-frequency model
Applied at stops with a basic set of transit choices, the service-frequency model
calculates the conditional probabilities of the individual lines in proportion to their
frequency. The model is equivalent to travelers who arrive randomly without knowledge
of the timetables and take the first reasonable service forward from the node.
where:
Service-frequency-and-cost model
• If the excess time is more than the expected cost of waiting, then the line is not valid;
travellers are better off ignoring this line and waiting for the next service from the selected
set.
• If the excess time is greater than zero but no more than the expected cost of waiting, the
line is valid some of the time. Specifically, excess time divided by the cost of waiting
defines the proportion of time that travellers are better off ignoring the line. Therefore, one
minus this proportion defines the probability of using the line when its service arrives at the
stop.
As the probability of use varies between lines, the frequency of the combined services
takes account of probability of use, as follows:
where:
During loading, the proportion of demand using a particular line is given by:
Public Transport Program > Theory > Route-evaluation process > Models applied at decision points > Alternative alighting
choices
The route-evaluation process applies the alternative-alighting model when a line has
two or more valid alighting points. This model has a logit structure similar to the walk-
choice model:
where:
λ
is the scaling factor for the model
(LAMBDAA).
NOTE: LAMBDAA affects the choice of
alighting points just as LAMBDAW
affects walk choices. For an example,
see “Impact of the different values of
scaling factor LAMBDAW” on page 971.
Notes:
• Lines 1-4 are included in the basic choice set because, with the addition of each line, the
overall time to destination improves. Line 5 is excluded from the basic choice set because
including it makes the time to destination worse.
(3)
(2) (4)
(1) Cum
Line Fre q ue nc y P ro p o rtio n
Line Fre q ue nc y a t S to p o f T rip s
1 5 5 0.357
2 6 11 0.429
3 2 13 0.143
4 1 14 0.0714
5 1 - 0.0
Notes:
Column(4) = (2)/cumulative frequency at stop
Public Transport Program > Theory > SFM and SFCM examples > Example of the service-frequency-and-cost model
(4 ) (5 ) (6 ) (1 0 )
A v e ra g e E xce ss Wa it (7 ) (9 ) A v e ra g e
t ra v e l t ra v e l t ime P ro p o rt io n (8 ) Wa it t ra v e l
(2 ) (3 ) t ime t ime w it h o u t o f t ime Cu m t ime t ime
(1 ) L in e Tra v e l e xclu d in g ov er t h is w h e n lin e e f f e ct iv e in clu d in g in clu d in g
L in e f re q u e n cy t ime t h is lin e a v e ra g e lin e u se d f re q u e n cy t h is lin e t h is lin e
1 5 20 - - - 1 5 12 20
Notes:
• Example uses a wait factor of 2 to weight the waiting times.
(3) (4)
(2) (5)
(1) E ffe c tiv e Cum
Line fre q ue nc y fre q ue nc y P ro p o rtio n
Line fre q ue nc y a t s to p a t s to p o f trip s
1 5 5 5 0.406
5 1 - - -
Notes:
• Column (3) = (2) * Proportion of time when line used (values are listed in Column (7) in the
Choice set table above)
Skimming process
The skimming process extracts the cost of a public transport trip into a zone-to-zone
matrix.
Because the Public Transport program finds multiple routes between zone pairs, the
program can provide several skims, suitable for different purposes:
• Composite-cost skim — Supports scheme evaluation and demand modeling
• Value-of-choice skim — Indicates the choice available in the public transport system
Available skims and the processes for extracting them are described in “Skimming (level
of service)” on page 720 and “Skim functions — quick reference” on page 732.
Public Transport Program > Theory > Skimming process > Composite-cost skim
Composite-cost skim
For each zone pair, the composite-cost skim computes the composite cost, or the total
utility of the trip including the choices available to the traveller.
The route-evaluation process uses composite costs, also referred to as the expected
cost to destination (see “Deriving cost used” on page 967 for a description of how they
are derived).
To enable you to model demand or evaluate schemes, the skim ensures that adding
new routes or improving services does not lead to an increase in the cost.
The skim calculates composite costs from each decision point in the trip to the
destination. The calculation varies with the type of choice:
• Walk choices
• Transit choices
Value-of-choice skim
For each zone pair, the value-of-choice skim computes the value of choice, a measure
of the extent to which travellers can choose between alternative routes. Higher values
indicate travellers can choose between routes of similar costs, whereas lower values
indicate a lack of route choice, or choices where the lesser alternatives are considerably
more expensive than the best route.
The value of choice provides a measure of the resilience or robustness of the public
transport system. With more low-cost choices, the system can continue functioning
following the failure of one or more components.
The value-of-choice skim is equivalent to the difference between the composite-cost
skim and the average-generalized-cost skim.
Public Transport Program > Theory > Skimming process > Average skims
Average skims
Average skims compute the costs a typical traveller incurs while making a public
transport trip. You can extract average skims for all components of the trip. There are
three broad areas:
• Time
m
Walk (nontransit)
m
Wait
m
In-vehicle
• Inconvenience
m
Boarding
m
Transfer
• Cost
m
Fare
Because multiple routes might connect zone pairs, average skims weighting each route
according to its probability of use.
Average skims compute component costs at network and route-set level. Within each
route set, average skims can compute costs other than wait time by mode.
Several average skims can compute either actual values—true measures of the cost—or
perceived values—the cost’s contribution to generalized cost (usually a product of the
cost and a weighting coefficient).
Average skims are appropriate for model validation and skimming operational statistics,
such as passenger miles, hours, and revenue.
Public Transport Program > Theory > Skimming process > Best-trip skim
Best-trip skim
For each zone pair, the best-trip skim computes the actual time for the best route (that is,
the time if travellers make the best choice at every decision point).
Because the skim uses actual values for all trip components, the skim does not reflect
traveller behavior, and is, therefore, inappropriate for demand modeling.
The skim bases the wait time and the transit-leg time on the lowest expected values.
The skim computes wait times from the appropriate wait curve, using the combined
frequencies of all acceptable lines from the node towards the destination. The skim
computes transit-leg times from the fastest line in the leg-bundles used.
NOTE: At present, walk(nontransit) legs have only one time attribute, the one used to
construct them (perceived time). See “Walk time (nontransit time)” on page 937.
Public Transport Program > Theory > Loading process
Loading process
The loading process (assignment) allocates trips, either computed or from the input trip
matrix, to services (transit lines) and nontransit legs. The loading process uses routing
and travel time information obtained from the route-evaluation process.
The loading process considers one origin-destination zone pair at a time. The process
assigns the zone pair’s trips to the available routes according to each route’s probability
of use, calculated during the route-evaluation process.
For example, consider the reports of enumerated and evaluated routes between zones
1 and 3.
The first report shows three bundles of enumerated routes from zone 1 to zone 3. All
routes meet the evaluation criteria; none are eliminated. The second report lists the
routes with their probability of use. The enumerated-routes report shows used costs.
However, the evaluated-routes report shows the average cost for the route bundle, not
the composite costs used to calculate the probability of use.
The loading process considers two walk choices from zone 1: to nodes 773 and 2052.
The route-evaluation process determined that the probability of going to node 773 is
0.774032, while the probability of going to node 2052 is 0.225968, reflecting the shorter
time via node 773. The loading process splits trips from zone 1 to zone 3 in this
proportion and saves the trips for the nontransit (access) legs:
• At node 773, there is a single transit service, GMB1-24B; all trips arriving at node 773
board this service. There are two alighting points: nodes 764 and 759. The time via 764 is
less than the time via 759. Thus the probability of using node 764 is 0.631438 and the
probability of using node 759 is 0.142594. The loading process splits trips at node 773
between the two alighting points and saves the trips for the two transit legs.
m
At 764, the loading process assigns arriving trips to lines PLB1-113B, PLB129B, and
PLB127A in proportion to their relative frequencies for trips to node 751. From node
751, travelers go to zone 3 via node 749 and line GMB1-2B. The process saves the
number of trips assigned to the four transit legs for each leg.
m
At node 759, the loading process assigns arriving trips to transit lines RES34R and
GMB1-2B for trips to nodes 875 and 749 before ending at zone 3.
• At node 2052, the loading process assigns travelers to transit line ISL-DN for the trip to
node 875, and then to transit line GMB1-2B for the trip to node 749 before ending at zone
3.
All trips from zone 1 to 3 use line GMB1-2B as the last transit leg in the trip, and alight at
node 749 where they walk to zone 3. These are saved for the nontransit (egress) leg
749-3.
The loading process is complete after assigning trips between all (selected) origin-
destination zone pairs, and computing the total trips using transit and nontransit legs on
the underlying network links.
Public Transport Program > Theory > Fares
Fares
This section describes how to model fares in the Public Transport program. Topics
include:
• Overview
• Trip length
• Trip costs
• Fare zones
• Examples
Public Transport Program > Theory > Fares > Overview
Overview
Fares are a fundamental element of a public transport trip. Therefore, it is important to
incorporate fares fully into the Public Transport modeling process.
To incorporate fares, the Public Transport program:
• Considers fares in the route choice
Fares do not always significantly impact route choice. To reduce run times, you might
exclude fares from the route-evaluation process and skim and calculate revenue from
the evaluated routes.
The Public Transport program must accurately represent the fare systems that
passengers face. The Public Transport program provides a framework which you can
use to directly represent or approximate most fare systems. In fact, you can represent
different types of fare systems within a single public transport network.
You can specify fare systems and value of time by user class. You might do this to use
readily available ticket type data to segment and model demand by ticket type.
Transit legs are the basic unit the program uses to calculate fares. A transit leg is one
part of a trip, from a boarding point to an alighting point, that uses a single transport line.
The program assigns each line to a fare system, either directly or through its mode or
operator.
The program calculates fare for a single leg of the trip. If multiple consecutive legs have
the same fare system, the program assumes integrated or through ticketing and
calculates fare for that sequence of legs.
To model fares, the Public Transport program requires a program-wide “fare system”
that describes each transit line’s individual fare system, its data requirements, and how it
interfaces with other lines.
You define fare systems with the FARESYSTEM control statement and input fare systems
with the FILEI FAREI file. You define fare system attributes with FARESYSTEM keywords and
subkeywords:
• Unique numeric and character identifiers (NUMBER, NAME, LONGNAME)
• Unit of measure for trip length, such as distance, number of fare zones crossed, or
boarding-alighting fare zones. (STRUCTURE, with possible values: FLAT, DISTANCE, HILOW,
COUNT, FROMTO, or ACCUMULATE)
• Boarding costs at the initial boarding and subsequent transfers, and the cost of transferring
between fare systems (IBOARDFARE, FAREFROMFS )
• Trip cost, which may be specified with a coefficient per unit measure of the trip, a table, or
matrix (UNITFARE, FARETABLE, FAREMATRIX)
• Rules for computing costs when transferring to the same fare system and interpreting fare
tables (SAME, INTERPOLATE)
Data requirements for fare systems depend upon the unit of trip measure (specified with
STRUCTURE) and the method for specifying trip costs (specified with UNITFARE, FARETABLE,
and FAREMATRIX). Requirements can vary from minimal to substantial. The following
table provides a quick reference to the various fare systems and their data requirements.
UNITFARE NA Optional1 NA NA NA NA
The program assigns fare systems to transit lines indirectly through the line’s mode and
operator with the FACTORS FARESYSTEM keyword or directly with the LINE control
statement. When modeling fares, each line must have an assigned fare system.
Include fares in the route-evaluation process by setting PARAMETERS FARE to T. Skim
fares, whether or not they are included in route-evaluation, by selecting skimming
functions FAREA and FAREP in the SKIMIJ phase.
Public Transport Program > Theory > Fares > Trip length
T rip length
The units for measuring trip-length is a key attribute of the fare system. Trip-length units
might be based on legs, actual distance, or fare zones. Fare zones are single nodes or
groups of nodes.
You specify the trip-length unit with the FARESYSTEM keyword STRUCTURE. There are six
possible values. Each value results in a different method for calculating trip length and
fare.
D e s c rip tio n o f trip -le ng th units
• — Fare incurred when transferring from lines using other defined fare systems.
FAREFROMFS
See “FAREFROMFS” on page 805.
Public Transport Program > Theory > Fares > Trip costs
T rip costs
Trip cost is a key attribute of the fare system. The program determines trip cost using
one of three methods:
• UNITFARE —Coefficient used to calculate fares. Only available when STRUCTURE is DISTANCE.
To obtain fare, the program multiplies UNITFARE by in-vehicle distance of a leg or a sequence
of consecutive legs using the same fare system.
You code fares in monetary units. The program converts fares to generalized costs
using the FACTORS keyword VALUEOFTIM E .
Public Transport Program > Theory > Fares > Fare zones
Fare zones
Fare systems that have the STRUCTURE set to HILOW, FROMTO, COUNT, or
ACCUMULATE require fare zones. Fare zones are either groups of nodes or single
nodes.
A public transport network might have multiple fare-zone schemes, but a fare system
must have only one zone scheme. Therefore, a node can be in only one fare zone.
The HILOW structure requires an annular fare zone system while the other structures
require sequential fare zones.
n T o identify and code fare zones for fare systems with a FROMT O,
COUNT , or ACCUMULAT E structure
2. Add a new node attribute to store the fare zone, such as FAREZONE.
a. From the Node menu, point to Attribute, and choose Add.
b. In the Add Note Network Variable dialog box, type FAREZONE and click OK.
4. Assign a number to the new fare-zone attribute of the nodes within the polygon
n T o identify and code fare zones for fare systems with a HILOW structure
2. Add a new node attribute to store the fare zone, such as FAREZONE.
a. From the Node menu, point to Attribute, and choose Add.
b. In the Add Note Network Variable dialog box, type FAREZONE and click OK.
3. Associate the number of the outermost fare zone to the new fare-zone attribute of all
nodes.
4. Use the Polygon menu to define a ring separating the outermost fare zone from the other
zones.
5. Assign the number of the penultimate fare zone to the new fare-zone attribute of the nodes
within the polygon
6. Repeat the last two steps until all fare zones have been completed.
Public Transport Program > Theory > Fares > Examples
Examples
This section shows how fares are calculated for a four-leg trip using different fare
models, individually and in combination.
2 B-C 2=Underground 3
Piccadilly
3 C-D 2=Underground 2
Bakerloo
4 D-E 3=Bus 1
Public Transport Program > Theory > Fares > Examples > Example 1: FLAT fare system
FARE(A-E) = 175 pence, which is the sum of fares for each leg, calculated as:
Leg A-B = 100 {IBOARDFARE for A-B} +
Leg B-C = 75 {FAREFROMFS[1] for B-C, for transferring from FARESYSTEM 1 to 2}
Leg C-D = 0 {FAREFROMFS[2] for C-D, for transferring from FARESYSTEM 2 to 2}
Leg D-E = 0 {FAREFROMFS[2] for D-E for transferring from FARESYSTEM 2 to 2}
Public Transport Program > Theory > Fares > Examples > Example 2: DISTANCE fare system
The trip uses three fare models, all with STRUCTURE set to DISTANCE but with different
unit cost for trip length.
FARESYSTEM NUMBER=1, NAME=’Distance British Rail’, STRUCTURE=DISTANCE,
IBOARDFARE=100, FAREFROMFS[1]=0, 100, 100, FARETABLE=1.0,0.75, 5.0,2.50, 10.0,3.50
FARESYSTEM NUMBER=2, NAME=’Distance Underground’, STRUCTURE=DISTANCE,
SAME=CUMULATIVE, IBOARDFARE=100, FAREFROMFS[1]=100, 0, 100, UNITFARE=60
FARESYSTEM NUMBER=3, NAME=’Distance Bus’, STRUCTURE=DISTANCE, IBOARDFARE=50,
FAREFROMFS[1]=50, 50, 0, UNITFARE=50
FACTOR FARESYSTEM=1, MODE=1
FACTOR FARESYSTEM=2, MODE=2
FACTOR FARESYSTEM=3, MODE=3
FARE(A-E) = 950 pence, which is the sum of fares for trip legs, calculated as:
Leg A-B = 100 + 350 (IBOARDFARE + trip cost)
Legs B-D = 100 + (5*60) (FAREFROMFS[1] + total distance * UNITFARE)
Leg D-E = 50 + (1*50) (FAREFROMFS[2] + total distance * UNITFARE)
NOTE: Where two consecutive legs have the same fare system, the fare can be
calculated for each leg separately or cumulatively, depending upon the setting of SAME.
In this example, legs B-C and C-D have the same fare system and SAME is set to
CUMULATIVE, so the fare is calculated for B-D. SAME has no effect in this case
because UNITFARE is used rather than FARETABLE.
There is no cost for transferring from fare type 2 to another leg using the same fare type.
Public Transport Program > Theory > Fares > Examples > Example 3: FROMTO fare system
The two FROMTO fare systems use different FARETABLE values and an incentive is
offered to interchange between fare system 1 and 2 and vice versa.
FARESYSTEM NUMBER=1, NAME=’British Rail’, STRUCTURE=FROMTO,
FAREMATRIX=FMI.2.BritRail, FAREFROMFS[1]=0, -25, 0, FAREZONES=NI.FAREZONE
FARESYSTEM NUMBER=2, NAME=’Underground’, STRUCTURE=FROMTO, SAME=CUMULATIVE,
FAREMATRIX=FMI.1.UndGrnd, FAREFROMFS[1]=-25, 0, 0, FAREZONES=NI.FAREZONE
FARESYSTEM NUMBER=3, NAME=’Bus’, STRUCTURE=DISTANCE, UNITFARE=50, IBOARDFARE=50,
FAREFROMFS[1]=50, 50, 0
FARE (A-E) = 525 pence, which is the sum of fares for legs, calculated as:
Leg A-B = 250 (FAREMATRIX FMI.2.BritRail, row NI.FAREZONE(A), column NI.FAREZONE(B))
Leg B-D = -25+200 (FAREFROMFS[1] and FAREMATRIX FMI.1.UndGrnd, row NI.FAREZONE(B),
column NI.FAREZONE(D))
Leg D-E = 50 + 1*50 (FAREFROMFS[2] + trip cost)
Public Transport Program > Theory > Crowding
Crowding
An iterative process, crowd modeling enables a public transport system’s capacity to
influence the system’s travel times and thus the routes found and their probability of use,
as calculated during route evaluation.
The Public Transport program supports two types of crowd models:
• Link-travel-time adjustment
• Wait-time adjustment
Link-travel-time adjustment
A link-travel-time adjustment models a passenger’s perception that travel time is more
onerous when standing (rather than sitting), or when in crowded vehicles. Specify this
adjustment with a “crowding factor.” The program multiplies the crowding factor by in-
vehicle time to determine the perceived “crowded in-vehicle time.”
For example, suppose a vehicle has a seating capacity of 40, crush capacity of 50, and
load distribution factor of 0.85 (standing occurs when more than 85% of 40—that is, 34
seats—are occupied). Once standing starts, the crowding factor might increase slowly
from 1.0 for the first few standing passengers, then more steeply once vehicle loading
exceeds 40.
The Public Transport program uses crowding curves. Derived from the crowd-factor
curve, crowding curves show utilization on the X‑axis. Utilization, the percentage of
standing places occupied, can vary between 0 and 100with the default option, but a user
control keyword (UTFLEX)
allows to specify crowding curves for values of Utilization beyond 100%. The
corresponding crowding curve is shown below.
Crowd factors are 1.0 in uncrowded conditions, and typically rise to values in the ranges
1.0 to 1.4 for seated passengers and 1.5 to 3.0 for standing passengers when the
vehicle is fully loaded with standing occurring.
The program calculates crowded link travel time as:
where:
where:
P is the passenger demand (per hour).
With the default settings, the value of utilization is constrained with a minimum value of
0% (when no standing occurs) and an upper limit of 100% (when crush capacity is
exceeded). A user selected keyword (UTFLEX) allows to specify utilization values
beyond 100%.
If the values of seating capacity and crush capacity are identical for any line, then
utilization is 100% whenever demand exceeds the seating capacity, and 0% otherwise.
Public Transport Program > Theory > Crowding > Wait-time adjustment
Wait-time adjustment
The wait-time adjustment reflects the ability to board a service. In simple models (without
crowd modeling) travellers typically board the first service that arrives at a stop and goes
to the required alighting point. As loadings on services increase, this becomes less
realistic, as travellers will choose the first appropriate service that has available capacity.
Using measures of demand and available capacity, the wait-time adjustment computes
the probability of being able to board a service. With heavily loaded services, some
travellers will wait for the next service, incurring additional wait time at the boarding node.
Without crowding, the program assigns demand with the service-frequency model
(SFM), or service-frequency-and-cost model (SFCM). The wait-time adjustment
redistributes the initial SFM or SFCM loadings whenever any line does not have the
available capacity to take its assigned demand. The program reassigns this excess
demand to other lines with spare unused capacity; those travellers incur additional wait
time.
The additional wait time might make this route less attractive, resulting in diversion of
demand to other enumerated routes for the origin-destination pair.
If demand exceeds capacity and no alternative routes are available, then this transit leg
acts as a “bottleneck”—not all of the travel demand is able to use the service during the
modeled period. The demand remaining at the end of the modeled period would
discharge once peak travel volumes subside; those travelers experience additional
delays, which form a second component to the wait-time adjustment.
“Flow metering” handles the bottleneck effect and the inability of demand to pass
through that point. Flow metering removes the excess demand from later stages in the
trip; thus demand at any downstream point reflects the number of travellers who can
reach that point. For any origin-destination pair, the program can calculate the proportion
of flow-metered demand (that is, demand unable to reach its destination due to network
bottlenecks), and the number of trips affected.
Public Transport Program > Theory > Crowding > Crowding process
• Public Transport run, based on data values stored in the input network
Link variables in the input network contain the screenline number (zero if the link is
not part of a screenline), link count, and confidence level.
For a Public Transport run to produce matrix estimation data, the script must specify a
FILEO INTERCEPTO command, along with either a FILEI SCREENLINEI or a FILEO
SCREENLINEO command. Alternatively, the software may save just a screenline output file
without performing any route evaluation.
To configure the intercept file to contain only transit use of the links, or all demand (that
is, transit plus nontransit use of all links), use the MEUSESNT keyword on PARAMETERS and
FILEO SCREENLINEO commands.
Public Transport Program > Using the Public Transport program > Defining input and output files
All control statements available in the Public Transport program are described in
“Control statements” on page 759. This section shows which files contain which data
items.
NTLEGI Nontransit NT
leg
NTLEGO Nontransit NT
leg
Public Transport Program > Using the Public Transport program > Linking Highway and Public Transport models
Typically, modeled stops are close to a junction node. Therefore, the program adds the
entire junction delay to the travel time of the link approaching the modeled junction.
You might model turning delays at a transit line’s last node. The program accounts for
such delays as occurring before the line reaches its final stop, even though the vehicle
does not pass through the node. The program adds that node’s lowest turning delay to
the travel time along the final link.
You should configure the model to read the TURNPENI file at the same time as the
LINEI files. When reading LINE data from a network file, the program has already
calculated link travel times and cannot amend turn penalties.
Public Transport Program > Using the Public Transport program > Coding network times/speeds
• Public Transport program, in which case only the network information is used (the public
transport element is discarded)
The network must provide basic link attributes that support the Public Transport
program’s modelling functions: link distance, and walk and transit times or speeds.
Link distance is required (specified by LI.DISTANCE or another variable from which
distance can be derived). The program uses link distance to calculate link times when
you provide only speeds, to skim distance from routes, and to calculate fares for
distance-based fare models.
Subsequent sections in this topic offer guidance on how to code transit and nontransit
times and/or speeds in the network:
• Transit times/speeds
• Nontransit times/speeds
Public Transport Program > Using the Public Transport program > Coding network times/speeds > Transit times/speeds
T ransit times/speeds
The Public Transport program requires a base transit time for links that public transit
lines traverse. This is supplied to the program with PARAMETERS TRANTIME. (You can
factor each line’s base link-time in a variety of way, as described in “LINE” on
page 868.)
You can use different techniques to specify a link’s transit time. Possible techniques
include:
• Set a link’s transit time to the congested time resulting from a highway assignment:
TRANTIME = LI.TIME_CONGESTED (assuming the links contain a variable named
TIME_CONGESTED).
• Create a network variable that stores transit speeds with the Network program.
(If the highway network stores public transport links, you can exclude those links from
highway assignments by setting those links’ path value to a negative value and their
capacity to 0.)
• Set array(s) of working link values in the LINKREAD phase and use those arrays in the
TRANTIME expression.
For example:
PHASE=LINKREAD
if (link condition…)
LW.TTIME = LI.DISTANCE*60/LI.SPEED * 1.2
else
LW.TTIME = LI.DISTANCE *60 / LI.SPEED
endif
ENDPHASE
PARAMETERS TRANTIME=LW.TTIME
• TRIPS users only. Input the TRIPS link records directly to the Network program to create a
Cube Voyager network. The Network or Public Transport programs can derive transit and
nontransit link times from the link record’s link-type field and the LTYP data in the lines file.
See “Example 2: Preparing a public transport network from TRIPS link data” on page 1019.
Public Transport Program > Using the Public Transport program > Coding network times/speeds > Nontransit times/speeds
N ontransit times/speeds
You can develop nontransit legs outside the Public Transport program, inside the Public
Transport program, or some combination. Regardless of the process, you must use
GENERATE statements within the DATAPREP phase to develop a nontransit network.
When developing the nontransit network outside the Public Transport program, you
must ensure that you use costs—perceived or actual—consistent with the cost
components that the route-enumeration and route-evaluation processes use.
Keywords in the GENERATE statement set the method for obtaining nontransit legs.
However, you might need to precede the GENERATE statement with a script that
manipulates link attributes. As in the LINKREAD phase, you can loop through all the
links in the network and set desired link values.
Example:
PHASE=DATAPREP
LINKLOOP
if(link condition…)
LW.NTCOST = LI.DISTANCE * 1.6
else
LW.NTCOST = LI.TIME*3.8
endif
ENDLINKLOOP
GENERATE COST=LW.NTCOST * 2.5, EXCLUDE=(LW.NTCOST > 100)
ENDPHASE
Public Transport Program > Using the Public Transport program > Generating nontransit access and egress legs
Consider the routes from zone 1 to zone 11 in the network shown. Travellers access the
transit system through nontransit legs generated with two GENERATE statements, for
modes 1 (walk) and 2 (drive).
NT LEG=1-3967 MODE=2 COST=2.03 DIST=2.03 ONEWAY=T XN=4227 4006 4007 3963 3965 3966
NT LEG=1-4000 MODE=2 COST=1.66 DIST=1.66 ONEWAY=T XN=4005 4004 15646 4003 15647 3961
NT LEG=1-4143 MODE=2 COST=3.20 DIST=3.20 ONEWAY=T XN=4226 4267 4266 4265 4302 4303
4301 4144 4773
NT LEG=1-4227 MODE=1 COST=12.96 DIST=0.27 ONEWAY=T
NT LEG=1-4263 MODE=2 COST=3.87 DIST=3.87 ONEWAY=T XN=4005 4004 15646 4003 15647 3961
4000 3999 3998 3997 9420 9419 3996 9423 3993 3992 9810 3991
NT LEG=1-4276 MODE=2 COST=2.66 DIST=2.66 ONEWAY=T XN=4268 4269 4270 4271 15687 8710
8709 4273 4274
NT LEG=1-4309 MODE=2 COST=2.12 DIST=2.12 ONEWAY=T XN=4268 4269 4307 4306 4308
NT LEG=1-4322 MODE=2 COST=3.39 DIST=3.39 ONEWAY=T XN=4268 4269 4270 4271 15687 8710
8709 4273 4315 4314 4316 4319
NT LEG=1-4386 MODE=2 COST=3.40 DIST=3.40 ONEWAY=T XN=4268 4269 4307 4306 4308 4309
4774 4349 4775
Travellers egress from the public transport system to zone 11 with the nontransit legs
reproduced below, generated by a GENERATE statement.
NT LEG=4276-11 MODE=1 COST=3.36 DIST=0.07 ONEWAY=T
NT LEG=4278-11 MODE=1 COST=14.40 DIST=0.30 ONEWAY=T XN=4276
The routing algorithms only recognize routes that have an access leg followed by pairs
of transit and nontransit legs, the last being the egress leg. Although a nontransit-only
route, 1->4276->11 exists, the algorithm will not enumerate that route.
The all-or-nothing process, which marks base times for the route-enumeration “spread,”
finds that 1->4276 is the best access leg to the public transport system for zone 11.
Because travellers cannot cannot walk directly to 11 from 4276, they ride a transit line to
4278 and walk to 11 from there. (Where transit alternatives are either not available or not
feasible, the process will find no routes between the two zones.)
Because the program found a route, even a nonsensical one, the program finds base
times at nodes and enumerates and evaluates routes.
REval Route(s) from Origin 1 to Destination 11
1 -> 4322
4322 -> 4280 -> 4280 lines AM4L5 AM4L6- AM4L18
4280 -> 4276 -> 11 lines AM4L12 AM4L89-
Cost= 30.8287 Probability=0.2803
1 -> 4322
4322 -> 4325 -> 4325 lines AM4L5 AM4L6- AM4L18
4325 -> 4276 -> 11 lines AM4L12 AM4L89-
Cost= 30.83 Probability=0.2803
1 -> 4276
4276 -> 4278 -> 11 lines AM4L12- AM4L89
Cost= 31.42 Probability=0.0071
1 -> 4276
4276 -> 4280 -> 4280 lines AM4L12- AM4L89
4280 -> 4276 -> 11 lines AM4L12 AM4L89-
Cost= 34.98 Probability=0.0959
1 -> 4322
4322 -> 4276 -> 11 lines AM4L12 AM4L89-
Cost= 19.62 Probability=0.3364
The fourth route in the list accesses and egresses the transit system at node 4276 and
takes a transit line in between, raising questions about the quality of the evaluated
routes. Rather than being an algorithmic problem, this arises due to the quality of the
input data. In this case, if you allow drive access from zone 1 to 4276, then you should
consider generating a drive-walk nontransit-only route between zones 1 and 11.
Otherwise, remove the drive accesses and connect zone 1 to the transit system only
with walk legs.
Removing routes that access and egress the transit system at the same node would
alleviate just one symptom rather than the underlying cause.
A good nontransit network is essential for identifying good quality routes. You develop a
nontransit network through an iterative process, validating and refining the network
produced by the GENERATE statements over a few cycles.
Some useful GENERATE keywords to control the excessive generation of nontransit legs
are:
• SLACK
• MAXNTLEGS
• DIRECTLINK
Public Transport Program > Using the Public Transport program > Considering nontransit-only routes
This diagram shows two walk (MODE=11) access legs and one drive (MODE=12)
access leg that two GENERATE statements generate. No drive-drive routes are generated.
NT LEG=81-1092 MODE=11 COST=19.20 DIST=0.40 ONEWAY=T XN=1094
NT LEG=81-1104 MODE=11 COST=7.68 DIST=0.16 ONEWAY=T
NT LEG=81-1109 MODE=12 COST=1.41 DIST=0.47 ONEWAY=T VOL=430 VOLT=430 XN=1104
The transit time from 1109 to 1092 is just under a minute. Therefore, the all-or-nothing
process determines that the best stop to access line MAIN is 1109.
The program generates several nontransit legs at 1109, including a drive egress:
NT LEG=1109-99 MODE=12 COST=1.53 DIST=0.65 ONEWAY=T XN=1108 1105
The best-cost route from 81->99 is to drive from 81 to 1109 and then to 99. However,
because this is a nontransit-only route neither the all-or-nothing process nor the
enumeration process will enumerate the route. Further, because the route is so much
faster than any of the possible transit routes, the program will not enumerate the transit
routes either, unless you define a very large route-enumeration SPREAD, which will
result in an unnecessarily large route set for those zone pairs that genuinely connect
with transit routes (most zone pairs in any study). Therefore, zones 81 and 99 will
appear unconnected.
If you are not interested in nontransit-only routes, skims, and loads, you can leave such
zone pairs unconnected. However, when validating a network, you might establish why
zone pairs do not connect.
If, however, nontransit-only routes are required, then drive-only connections between
zones should be generated:
GENERATE,
COST=(li.DIST * 60) /li.OFFPSPD,
MAXCOST[1]=5,
NTLEGMODE = 14,
FROMNODE=81, TONODE=99
This statement generates short drive-only routes between zones that cost 5 units or
less.
NT LEG=81-99 MODE=14 COST=2.19 DIST=0.88 ONEWAY=T VOL=10 VOLT=10 XN=1094 1093 1092
1091 1090 1107
This route traverses links other than 81->1109 and 1109->99 and costs even less,
making any transit-based routes even less competitive. However, because the NT
statement identifies the drive-only route, the route-enumeration and route-evaluation
processes enumerate that route:
REnum Route(s) from Origin 81 to Destination 99
81 -> 99
Cost=2.19
REval Route(s) from Origin 81 to Destination 99
81 -> 99
Cost= 2.19 Probability=1.0000
In this example, the transit routes are much slower than the drive-only one, and are only
enumerated when SPREADFACT is 1.5. Although the program enumerates transit routes,
the program only uses the drive-only route. The route-evaluation process discards the
other routes because they cannot compete with the drive-only route.
REnum Route(s) from Origin 81 to Destination 99
81 -> 1109
1109 -> 569 -> 569 lines SMAIN
569 -> 1107 -> 99 lines SMAIN SMAIN
Cost=58.95
81 -> 1109
1109 -> 1107 -> 99 lines SMAIN
Cost=59.61
81 -> 99
Cost=2.19
REval Route(s) from Origin 81 to Destination 99
81 -> 99
Cost= 2.19 Probability=1.0000
You must carefully consider how to model short, fast nontransit-only routes when there
are transit alternatives. Undetected, nontransit-only routes can result in poor quality
routing as described in “Generating nontransit access and egress legs” on page 1010.
Public Transport Program > Examples
Examples
This section contains examples showing different ways to run the Public Transport
program. Examples cover:
• Public transport network development
Parameter TRANTIME provides the location of transit time in the link record.
The script explicitly codes the DATAPREP phase. You can only code GENERATE
statements in this phase.
This script produces a public transport network, containing validated input and the
described generated components. You can save this network and for subsequent use
by the Public Transport program for route enumeration, route evaluation, skimming,
loading, and loading analyses. You can also display the network in Cube.
;Prepare a Public Transport Network
RUN PGM = PUBLIC TRANSPORT
;Output files
FILEO REPORTO = LDPRN00A.PRN
FILEO NETO = LDNET00B.NET
;Input Files
FILEI SYSTEMI = PTSYSTEM.PTS
FILEI FACTORI[1] =FACTORLD.FAC
FILEI LINEI[1] = ISL_PTLINES.LIN
FILEI NETI = LDHWN00A.NET
;Globals
PARAMETERS TRANTIME = li.TrnsTime
PHASE=DATAPREP
;generate access/egress links
list='\nGenerate Zone Access/Egress Legs'
GENERATE,
COST=li.WalkTime,
MAXCOST[1]=16*20,
LIST=T,
NTLEGMODE=33,
INCLUDELINK = li.WalkTime>0
;generate xfer non-transit legs
list='\nGenerate Transfer Legs'
GENERATE,
COST=li.WalkTime,
MAXCOST[1]=16*15,
LIST=T,
NTLEGMODE = 34,
ONEWAY=F,
INCLUDELINK = li.WalkTime>0,
FROMNODE=26-4000, TONODE=26-4000
ENDPHASE
ENDRUN
Public Transport Program > Examples > Public transport network development > Example 2: Preparing a public transport
network from TRIPS link data
• LINKREAD calculates walk and transit times for all links in the network. TRIPS networks
have links, identified by link type, that are “walk” only, “transit” only, or “both” walk and
transit. The LINKREAD phase produces walk and transit time fields for each link. For links
where only one activity can take place, the other field contains a zero.
• DATAPREP produces some diagnostics and generates access, egress, and transfer links.
The generation process only includes links with a walk link-time greater than zero.
;Prepare a Public Transport Network from TRIPS data
RUN PGM = PUBLIC TRANSPORT
;Output files
FILEO NETO =LDNET00B.NET
FILEO NTLEGO = LDNTL00A.NTL
FILEO REPORTO =LDPRN00A.PRN
;Input files
FILEI LINEI[1] = \ISL_PTLINES.LIN
FILEI NETI = LDHWN00A.NET
FILEI FACTORI[1] = FACTORLD.FAC,
LIST=T
FILEI SYSTEMI = PTSYSTEM.PTS
;GLOBALS
PARAMETERS TRANTIME = li.TrnsTime
;NODEREAD phase loops over nodes. Can access network node variables N.xxx,
;and generate node variables Nw.xxx.
PHASE=NODEREAD
print list=ni.n, ni.x, ni.y
ENDPHASE
;LINKREAD phase loops over links. Can access network link variables L.xxx and
;generate link variables Lw.xxx.
PHASE=LINKREAD
;this phase is used to generate walk and transit times for
;the links of a TRIPS Public Transport network
;convert TRIPS distance and speed/time fields from 100dths to units
lw.RDIST=li.DISTANCE/100.
lw.RSPDTIME=li.SPDTIME/100.
if(li.LType == 10,18,28,29,31,32)
lw.TrnsTime = 0.0
else
lw.TrnsTime = lw.RSPDTIME
endif
LINKLOOP
if(lw.WalkTimePT > 0.0 && lw.TrnsTime == 0.0)
WalkLnkCnt = WalkLnkCnt+1
elseif(lw.WalkTimePT == 0.0 && lw.TrnsTime > 0.0)
TrnsLnkCnt = TrnsLnkCnt+1
elseif(lw.WalkTimePT > 0.0 && lw.TrnsTime > 0.0)
BothLnkCnt = BothLnkCnt+1
else
ErrLnkCnt = ErrLnkCnt+1
PRINT LIST = li.a, li.b, lw.WalkTimePT, lw.TrnsTime
endif
ENDLINKLOOP
PRINT LIST = '\nNumber of walk only links = ', WalkLnkCnt,
'\nNumber of transit only links = ', TrnsLnkCnt,
'\nNumber of walk and transit links = ', BothLnkCnt,
'\n'
;Note if and 'if' statement does not fit on one line and closing 'endif'
;is required
if(WalkLnkCnt==0 && BothLnkCnt==0)abort msg = No Walk links in the Network
if(TrnsLnkCnt==0 && BothLnkCnt==0)abort msg = No Transit links in the Network
if(ErrLnkCnt> 0)abort msg = Links with invalid time/speeds in Network
;Generate access/egress links
list='\nGenerate Zone Access/Egress Legs '
GENERATE,
COST=lw.WalkTimePT,
MAXCOST[1]=16*20,
LIST=T,
NTLEGMODE = 33,
INCLUDELINK = lw.WalkTimePT>0
;Generate xfer non-transit legs
list='\nGenerate Transfer Legs '
GENERATE,
COST=lw.WalkTimePT,
MAXCOST[1]=16*15,
LIST=T,
NTLEGMODE = 34,
ONEWAY=F,
INCLUDELINK = lw.WalkTimePT>0,
FROMNODE=26-4000, TONODE=26-4000
ENDPHASE
ENDRUN
Public Transport Program > Examples > Public transport skimming
ENDPHASE
;MATO loops over J for each I. All skims extracted above are reported
PHASE=MATO
The script codes the DATAPREP phase, a mandatory phase for public transport
network development.
Next, the script performs the following functions for each user class:
• Route enumeration — Saves routes on ROUTEO[1] and ROUTEO[2].
• Route evaluation
• Skimming — Extracts composite and value-of-choice skims, saves on MA T O[1] and MA T O[2],
and reports.
• Loading — Loads trip matrices input on any MA T I file (not necessarily the one subscripted
by the user class) to the evaluated routes.
The script codes the MATO phase to report the output skim matrices.
Finally, the script saves a public transport network containing the results of the loadings
for both user classes to NETO . You can display the results with Cube.
;Generate Non-transit network, Enumerate, Evaluate Routes,
Skim and Load for two User Classes.
RUN PGM=PUBLIC TRANSPORT
:Output Files
FILEO REPORTO = LDPRN00A.PRN
FILEO ROUTEO[2] = LDRTE00D.RTE
FILEO ROUTEO[1] = LDRTE00A.RTE
FILEO NETO = LDNET00E.NET
:input
FILEI MATI[2] = MSMAT00B.MAT
FILEI MATI[1] = MSMAT00B.MAT
FILEI SYSTEMI = PTSYSTEM.PTS
FILEI FACTORI[2] =FACTORUS2.FAC
FILEI FACTORI[1] = FACTORUS1.FAC
FILEI LINEI[1] = ISL_PTLINES.LIN
FILEI NETI =LDHWN00A.NET
;Globals
PARAMETERS TRANTIME=li.TrnsTime
PARAMETERS USERCLASSES=1,2
PARAMETERS TRIPSIJ[1] = Mi.01.1
PARAMETERS TRIPSIJ[2] = Mi.02.1
PHASE=DATAPREP
;generate access/egress links
list='\nGenerate Zone Access/Egress Legs '
GENERATE,
COST=li.WalkTime,
MAXCOST[1]=16*20,
LIST=T,
NTLEGMODE = 33,
INCLUDELINK = li.WalkTime>0
;Routes are enumerated, evaluated, skimmed and loaded for each user class
;SKIMIJ loops over IJ pairs. Skims are saved in working matrices in this phase
PHASE=SKIMIJ
MW[1]=COMPCOST(0) ;composite cost
MW[2]=ValOfChoice(0) ;value of choice
ENDPHASE
;MATO loops over J for each I. Skims are reported for each user class
PHASE=MATO
if(ROWSUM(1) > 0) PRINTROW mw=1 TITLE='Compcost', BASE1=T, FORM=10.2
if(ROWSUM(2) > 0) PRINTROW mw=2 TITLE='ValOfChoice', BASE1=T, FORM=10.2
ENDPHASE
ENDRUN
Public Transport Program > Examples > Public transport crowding
Troubleshooting
E rro r D e ta ils
InsertBufferedFeatureException InsertBufferedFeatureException
occurs when strings longer than
252 characters are being
imported into a field. In this case,
Cube will automatically truncate
the strings (with the last three
characters being “...”).
TRNBUILD Program > Using TRNBUILD in Cube Voyager
• When coding TRNBUILD scripts, enter any distances in control statements in hundredths
of distance units without any decimal point. Enter time and speed as true values, including
the decimal point included. For example, code 1.5 miles as 150, and code 1.4 minutes as
1.4.
NOTE: This applies to script statements only. NETI values are real: Enter distances in
true units (miles or kilometers, with decimal points included) on the networks.
• Times and distances are only accurate to the second decimal place. To increase
efficiency, TRNBUILD stores times and distances as 16-bit integers with an implied scale
of 100 and a maximum value of 65,530. For example, TRNBUILD stores a network
distance 1.235 as 124, and stores a time of 1.001 as 100.
• TRNBUILD displays distances reported in the print file or any output files in hundredths of
units. TRNBUILD reports times in real units in the print file, except for the LINESTRING
report and the TRACE summary. TRNBUILD outputs times in hundredths of units in LINKO
and MATO.
• Use the MATRICES statement to define the total number of O/P matrices in the MATO file.
You can only use a limited number of variables or values in matrix calculations.
Expressions cannot reference the values from other matrices.
Introduction to TRNBUILD
Transit processing is similar to highway-network processing, but more complex. During
transit processing, the program must form a transit network and develop paths between
zones. The program uses paths to extract level-of-service (LOS) data, which mode-
choice models use (in a separate process). The program also uses paths to assign trips
to the network. When developing paths for transit processing, the program must
consider mode transfers, mode weighting, and line combinations—a more complex
process than path development for highway processing.
A transit network contains lines and support links. Lines are user-defined transit routes.
Support links—nontransit links that provide connectivity between different transit lines and
between zone centroids and lines—are necessary to support the transit system. Types of
support links include walk, park-and-ride, and transfer. The program requires a
background highway network as the starting point for support links and lines. The
highway network provides the location of nodes, and basic information about distance
and highway travel. For transit lines that do not use separate guideways, such as buses,
the program computes the line’s speed as some function of the highway distances and
speeds on the links used.
Every support link and every transit line must have a mode number. Mode numbers can
range from 1 to 255. The program treats modes assigned to transit lines as transit
modes and treats all other modes as support modes. You may assign mode numbers as
desired, but if the program detects any support links with a mode used by a transit line,
the program will terminate with a fatal error message. Citilabs recommends that you set
a standard for defining modes and use that standard consistently.
Support links can use the distances from any related highway links, but usually the
program computes support-link travel times with a separate process. You must enter
support links with control statements. Traditionally, the program uses support links to
model people walking to, from, and between transit stop nodes, and for driving from
zones to transit. TRNBUIILD has no predefined specifications of support links and their
modes. For maximum flexibility, Citilabs recommends assigning separate modes for the
following categories:
• Walk from zone to another mode
• General walking
You might prefer to funnel all access to and from rail stations through links of certain
modes (usually walk, transit, and drive). This requires saving three modes for these
access links. You might prefer to further stratify transit access by grouping some transit
modes.
With properly structured data, you can easily change mode assignment. When defining
support links, you can assign modes. TRNBUILD allows you to assign a global value for
modes, and to change the global setting before reading various line records. However,
global values are not compatible with transit-network editing in Cube Base. Therefore,
Citilabs recommends that you not use global values.
The program has a built-in process to generate zonal access support links
automatically. That process builds traditional paths using the highway-link distances and
the walk speed to find the best path from each of the selected zone centroids to each of
the transit stops within a designated distance. The program generates a support link
from the zone to each stop reached within the specified distance. You can vary the
distance by mode, and can limit the number of links by mode. The program can
generate links from a zone, to a zone, or from a zone and to a zone. The program
assigns modes globally. If the program uses a special highway network, you can also
restrict the number of highway links that paths traverse. You can also provide access
links that cause the program to develop the path from the zone to the link’s A-node,
rather than from the zone to a stop node at the link’s B-node. You must initiate zonal
access with the ZONEACCESS control statement.
PNR control statements trigger a similar built-in process to generate drive-access support
links. PNR access development differs from zonal access development. If you code
PNR node as a link, the program considers the first node to be the PNR node, and
generates an additional lot link between the two nodes. Only the zones explicitly defined
with the PNR node can access the node. The program will generate an access link from
each specified zone that is within the specified distance of the PNR node. You can enter
the generated links as either one- or two-way; usually you will code drive-access links
as one-way. The program develops the zone-to-PNR-node link using a minimum-time
path-development process. These processes only use the links in the highway network.
Specifying the maximum-time parameter can reduce the path development time. You
cannot suppress this access development process if there are PNR control statements in
the input.
TRNBUILD Program > Introduction to TRNBUILD > Path building
Path building
The program builds transit paths using a special algorithm, which is similar to highway
path building. When building highway paths, the program develops a path set for an
origin zone, and then extracts individual zone-to-zone paths. Transit path building has
considerably more variables than traditional highway path building. Rather than simply
developing the single best path between two zones, TRNBUILD allows you to invoke
many factors at various points in the process.
The algorithm determines the best path to each node. Because there may be restrictions
(usually mode oriented) out of the node, the program must keep the best path into each
node for each active mode at the node. This requires considerable computer resources.
Though the algorithm can develop paths by saving just the single best path into a node,
this method may not obtain true minimum paths if there are mode-change factors or
prohibitions. Saving the single best path will reduce path-development time by about
sixty percent. The PATHSTYLE parameter sets the alternate option (see “PARAMETERS”
on page 1070).
Usually, you input transit-line data in some period-specific basis, which may be
inconsistent with the processed period. For example, you might include a line with a 90-
minute headway in an analysis for a 60-minute period. Because the program is not time
specific, the program does not know how many times the line is available at a particular
stop node during the process: one time or two times? Instead, the program assumes
that any line is available at any of its stop nodes.
Traditionally, a line’s wait time is calculated as one-half of its headway. However, most
travelers are somewhat knowledgeable about what time they can board the line.
Therefore, you might invoke a maximum initial wait time, IWAITMAX. For example, a 60-
minute line would normally have a 30-minute wait time. But when the line is the first in a
trip, you might cap the wait time. To ensure that wait time accounts for boarding time,
you can also set a minimum wait time, IWAITMIN. Similarly, for transferring passengers,
the transit system likely offers some synchronization and the wait time may differ from
the traditional wait time. You can specify maximum and minimum wait times at transfer
points with XWAITMAX and XWAITMIN.
TRNBUILD also allows you to factor times on various segments of a trip, creating
perceived times that differ from actual times. The program applies these perceived
factors based on modes, wait time, and transfers. The program builds paths based on
perceived times. Before choosing a path segment, the program converts the actual time
to perceived time based on the action considered. As the path moves from one segment
to another, the modes of the from- and to-segments determine how the program
processes the path. The program considers a segment to be either a support link or a
contiguous portion of a transit line. In most cases, segment connections have some
associated perceived time. Boardings occur when accessing a transit segment;
transfers occur at any boarding other than a path’s initial boarding.
During segment-to-segment processing, the program adds a value to the path time; it
can be zero. The program obtains the added value from the XPEN and XPENFAC arrays,
depending upon the segment modes (see “FACTOR” on page 1047). The program
considers the XPEN value to be an actual value, which is modified during path selection
by the XPENFAC factor to obtain a perceived value. The values are mode-to-mode
specific, and include all modes. You can prevent certain mode-to-mode combinations
with NOX factor switches. The program computes the perceived segment time by
multiplying the actual segment time by the segment’s MODEFAC factor. If the to-segment
is transit, the program also multiplies the wait time by the XWAITFAC factor and possibly
adds a boarding penalty, BOARDPEN. You can use the boarding penalty to add larger
perceived values to the path time as the number of boardings increases, discouraging
excessive transit boardings.
In basic mode, the program works with only the set of best paths between two zones (I-
J). For some zone combinations, there are other reasonable possibilities. However,
considering all possibilities would take an inordinate amount of computer resources.
TRNBUILD has an option to calculate additional path sets based on the accesses at the
zones. Specify this option with a MULTIACCESS control statement. With this option, the
program builds a path set from every outbound link at zone I and considers all the
access links at J for each path to J. Thus, if zone I has four outbound links and zone J
has four inbound links, the program might consider up to sixteen paths between I and J.
During assignment, the program compares each of the I-J possibilities to the best path
between the zones, and considers only those that fall within the MULTIACCESS
specifications. Those specifications define time differences, specified as both actual
minutes and relative time. For example, if MULTIACCESS MAXTIMEDIFF=3, MAXPCTDIFF=10,
then the assignment program will use any I-J path that is within 3 minutes, or 10 percent,
of the best I‑J path.
The program uses all the selected paths in assignment. The program allocates trips to
the paths according to the relative times of the paths. Specifying MULTIACCESS for an
application without assignment has no effect on results. However, if an application traces
paths, the trace will show the various paths that would be used during assignment. Note
that the multiaccess process does not necessarily create a good spread for the
assignment. The spread depends on the access links at a zone. For example, if three
outbound access links connect to the same line, the spread may be only between the
access links. If there is another access link to another line, that link might get a smaller
share because the program spreads the trips across the four links. The multiaccess
process increases path-building time because the process must build more paths.
TRNBUILD Program > Introduction to TRNBUILD > TRNBUILD line-combining process
The line-combining process selects the path from a node when travelers can choose
from more than one line to reach a specific downstream node. TRNBUILD’s line-
combining process combines only lines with the same mode.
When there are several lines of the same mode that can take a passenger from a
particular node to the same downstream node and those lines have different headways
or different run times, TRNBUILD considers perceived times and completes the following
steps:
1. Select the best line, based on the total time (sum of wait time and run time) between the
two points on each line.
2. Save lines that have a total time within the mode’s COMBINE criteria.
3. Compute combined wait time by dividing the total number of vehicles available per hour
into sixty minutes, and dividing by two.
In many cases, the run times for the lines vary, so a method must be employed to
compute a weight for each line’s run time.
It would seem that the average run time could be used, but there are scenarios where
this could result in rather strange values. A typical scenario would be at a station where
there are numerous local lines (low headways) that run at slow speeds, and an
occasional express line (high headway) that runs at a high speed.
A new wait time is computed for each line by subtracting the best run time from the line’s
total time. These new wait times are used to compute an equivalent headway, which in
turn, is used to compute an estimated combined wait time. Each line’s run time is given a
weight based upon the ratio of the estimated wait time to its new wait time. The total run
time is weighted sum of all the line run times.
There is no guarantee that the process will always result in a combined total time that is
less than the best path for every situation. But, the process is reasonable in most
situations.
To illustrate the process, define the following terms:
• Actual value (A) — Determine directly from line links and frequencies (that is, the actual link
time or the actual waiting time to board).
• Await — Actual wait time (headway/2). This value is restricted by the wait factors (IWAITMIN,
IWAITMAX, XWAITMIN, and XWAITMAX)
A list of all the lines and their corresponding Ptt to reach the node from this node is
obtained. The line with the lowest Ptt is considered as the best line. All other lines are
then evaluated to determine if they should be combined with the best line. A line will be
combined with the best line if its Ptt does not exceed the sum of the B(Ptt) + MaxDiff, or,
if there is a COMBINE IF expression which is satisfied for the line.
After the program obtains a list of the lines to be combined, it determines how the trips
will be distributed among the lines. A revised perceived wait time for each line is
computed as the difference between the line’s Ptt and the B(Prun). Each line is given a
weight based upon its revised wait time relative to the other lines’ revised wait times.
The perceived path wait time is computed as one half the headway based upon vehicles
available and factored by the appropriate wait factor. ( (60 / VehAvail / 2) * WAITFAC).
The perceived path run time is the sum of (weight * perceived run time) for all lines.
Example: Assume the following conditions for an initial boarding between a node pair,
and MaxDiff = 10.00:
IWAITMAX=8 IWAITMIN=2 MODEFAC=1.2 IWAITFAC=2.5
Line Freq Run Pwait Prun Ett RWait Wt Rtime
A 10 22 12.50 26.40 38.90 26.90 .291 7.69
B 15 15 18.75 18.00 36.75 24.75 .317 5.70
C 20 10 20.00 12.00 32.00 20.00 .392 4.70
D 60 23 20.00 27.60 47.60 Not combined
TRNBUILD can assign trips from a trip matrix to the paths. When using a trip matrix, the
program does not build path sets for origin zones without trips. This can reduce
computation time considerably. If there are any trips for any of the I-J pairs selected
(explicitly or implicitly), the program generates the path set, but only processes the
selected I-J pairs with trips. If the assignment option is true, the program assigns trips to
the appropriate I-J paths. The program accumulates link volumes and node boardings
and exits. You can requests several types of reports showing assignment results.
See “FILEI” on page 1052.
TRNBUILD Program > Introduction to TRNBUILD > Level-of-service extraction
You can obtain zone-to-zone values for various elements of the I-J paths. These
elements include times, distance, first and last transit nodes, access and first transit
modes, number-of-boardings, and fares. You can extract most elements by mode, or
combinations of modes. You can combine elements with user expressions. If the
program traces an I-J pair, the trace includes a list of its basic elements. The transit
running times and distances may be not exact for the transit legs where the path is split
amongst several lines. In those segments, the extracted element is the sum of (line
weight * network value) for all lines in the segment.
See “FILEO” on page 1054.
If the you specify the FILEO MATO keyword, the program writes the extracted values in
matrix format to the specified file. See also “MULTIACCESS” on page 1069.
TRNBUILD Program > Introduction to TRNBUILD > Output network
Output network
This version of TRNBUILD does not write an explicit transit network. The program can
write a DBF file containing the nodes and links, and you can use the file with Cube Base.
You can reduce the number of links in the output file by restricting the modes to be
included. The TRNBUILD network will automatically include all the nodes in a transit line.
However, an option lets you restrict the output to only stop-to-stop links (omitting the
intermediate non-stop nodes). If an assignment is made, the file will contain link
volumes, boardings, and exits at each link’s nodes. See also “FILEO” on page 1054.
TRNBUILD Program > Control statements
Control statements
TRNBUILD has several levels of control statements. Some statements must be input
before other statements, so that certain memory allocations can be made at the
appropriate times. The order of statements is not important except that the level 1
statements must be read before any level 2 statements. At the first occurrence of any
level 2 statement, the input network (designated on the FILEI statement) is opened,
certain memory allocations (specifications obtained from PHASE1 statement values) are
made, and most level 1 statement values are no longer acceptable. If these rules are
violated, and the program can’t adjust itself at that time, fatal messages may be issued.
There are exceptions, but the fatal messages can be avoided if the rules are adhered to.
Level 1 statements: FILEI, PHASE1
Level 2 statements: LINE, LINK, PNR, SELECT, SUPPORT, XY, ZONEACCESS
All other statements can be input at any time.
The following control words are available in the TRNBUILD module.
MULTIACCESS
COMBINE
Line-combining specification. Keywords include:
• IF
• MA XD IFF
COMB IN E k e y wo rd s
Ke y wo rd D e s c rip tio n
MA XD IFF |R255*| <0> is the first process tested in the combination decision
process. If the line’s total time does not exceed best time +
MAXDIFF, the line will be combined with the best line.
You may specify MAXDIFF and an IF for each mode. The program provides a default
MAXDIFF of 0 for each mode, but you must provide any IF selections.
TRNBUILD Program > Control statements > COMBINE > Example
Exam ple
COMBINE MAXDIFF = 255*0 ; Default process.
COMBINE IF[1]=(
(N1=5000 && N2==6000-6010,7002 && (((WAIT+RUN)–MINTIME) <=3.25)) ||
(I=1-100,500 && (wait - minwait) <= 2.00 && (time - mintime) < 3) ||
(((WAIT+RUN)–MINTIME) <= 5.00) ), ; mode 1
(((WAIT+RUN)–MINTIME) <= 3.25 ), ; mode 2
5 * ( (wait-minwait)<=2 && (run-minrun)<= 2) ; modes 3-7
; no IFs for modes 8-10
TRNBUILD Program > Control statements > FACTOR
FACTOR
Wait, xfer, mode factors. Keywords and sub-keywords include:
• B OA R D P E N
• IW A IT FA C
• IW A IT MA X
• IW A IT MIN
• MA XW A IT T IME
m NODES
• MOD E FA C
• N OX
• XP E N
• XP E N FA C
• XW A IT FA C
• XW A IT MA X
• XW A IT MIN
FA CT OR k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Use FACTORS to account for certain types of activity based upon either the mode of the
link being entered, or upon the mode of the link being exited in combination with the
mode of the link being entered. All these keywords are used to enter values into arrays
where the index corresponds directly with the mode. The keywords with double
dimensions (NOX, XPEN, XPENFAC) are based upon mode-to-mode activity, where the first
index implies the from mode, and the second index implies the to mode. If, for those
keywords, only one index is specified, the second index is assumed to be 1.
Use IWAITMAX, IWAITMIN, XWAITMAX, and XWAITMIN to account for discrepancies in the
general use of line frequencies when computing wait time at a node. For example, a line
may have a headway of 60 minutes, and the average wait for the line would be 30
minutes. But the transit system schedulers may have arranged schedules so that
generally the wait times are kept to some more reasonable limit. Use IWAITMAX and
XWAITMAX to set somewhat tighter controls on that aspect. It is generally considered that
a knowledgeable user will arrive at his first boarding node at a time that minimizes the
wait time; thus, you can set IWAIT... values separately from XWAIT... values.
Use IWAITMIN and XWAITMIN to effectively cause a wait time greater than the computed
minimum to be used. In a busy grid, there may be shuttle busses running at every
minute. At some nodes the east-west busses may arrive at the same time as the north-
south busses. In all likelihood, the transfer could not be made within the normal 30
second wait time, so additional wait time would be required.
TRNBUILD Program > Control statements > FACTOR > Example
Exam ple
IWAITFAC=255*2.0 ; all initial wait factors are 2.0
IWAITMIN[3]=4,5.5,3*6 ; beginning at mode 3: 4.00 5.50 6.00 6.00 6.00
NOX[11]= y,n,n,y ; NOX 11->1 and 11->4
NOX[12][12] = y,n,n,y ; NOX 12->12 and 12->15
XWAITMIN=10*0.5, XWAITMAX=10*12.55 XWAITFAC=2,9*2.5
MAXWAITTIME=5, NODES=800, 901-903
MWT=5, N=800, 901-903 ; same as previous line
TRNBUILD Program > Control statements > FARE
FARE
The FARE control statement defines fare values. Keywords include:
• MOD E FA R E
• XFA R E
FA R E k e y wo rd s
Ke y wo rd D e s c rip tio n
The fares are all entered as signed integer units within the range of -32767 to 32767.
The summary and maximum value variables may not be less than 0, or greater than
65535. Any negative values are set to zero at the end of the path extraction. Because
users code networks with different techniques and have different fare computation
processes, and there is no single way to compute fares. Some users may wish to have
an XFARE for all 255 x 255 possibilities, but If the path goes from transit to non-transit to
transit, excessive fares would be assessed (the current logic with XFARE precludes this
from happening). Other users may wish to code non-transit links with a MODEFARE, and
not use XFARE at all. In that case, consecutive non-transit links could cause a problem.
Most likely. MODEFARE and XFARE would not be used in the same application, but that
combination may be useful for certain networks.
Fares based upon distance or time traveled can be obtained by using the STEPFUNC
function described on the MATRICES control statement (see “MATRICES” on
page 1067).
TRNBUILD Program > Control statements > FARE > Example
Exam ple
FARE MODEFARE=3*50,0,0,4*75,0 ; sets transit fares for modes 1-10
XFARE[11] = 10*50, XFARE[12] = 10*50;
TRNBUILD Program > Control statements > FARELINKS
FARELINKS
Sets fare links. Keywords include:
• FA R E
• MOD E S
• L
• ON E W A Y
Fare links are links, that when traversed in a path, cause an additional fare to be added
to the I-J mode-based fare. A total of all such fares is accumulated during I-J path
tracing (done only when LOS matrices are being accumulated). At the end of the trace,
the fare-link total is added to the I-J fare accumulated in the normal fashion. The fare-
link total can be either negative or positive. However, if the final total fare (mode-based +
fare-link) value is negative, it will be reset to zero. During the trace and accumulation, all
fare links that are traversed are used in the accumulation; there is no logical combination
of the links other than full addition.
Fare links on multi-path segments of the path can cause strange results. Suppose that
the path from I-J splits between two lines: A and B. If line A has a fare link and line B
does not, then the fare from the fare link on line A will be factored according to the
portion of the trips that would be assigned to line A between the points of divergence.
Thus, the fare link might indicate a fare of 100 should be assessed, but only a portion
will be.
FA R E LIN KS k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
FARELINKS FARE=20 MODES=1-3,7 L=1000-1001, 2000-2001
FARELINKS FARE=-10 L=8000-1010 ONEWAY=TRUE, MODES=9
FARELINKS FARE=25 L=500-510,510-511 MODES=15 ; need not be transit
TRNBUILD Program > Control statements > FILEI
FILEI
Inputs data files. Keywords include:
• NET I
• MA T I
• FA R E MA T I
FILE I k e y wo rd s
Ke y wo rd D e s c rip tio n
The fare matrix is searched anytime there is a path segment on a mode for which there
is a FAREMATI. Assume a path of segments:
1-100 (mode=11),
100-101 (2)
101-102 (2)
102-103 (2)
103-300 (5)
300-301 (5)
301-400 (12)
400-308 (5)
308-2 (12)
The search process begins when a new mode is boarded; a search is made for the
boarding node to the exit node where the path changes mode. In this example, the first
search is node 100 (board mode 2) to node 103 (exit mode 2). If there is an entry, the
fare will be applied. If there is no entry, a search will be made to determine if there are
entries for any combinations of the modes 100-101-102-103, that would cover the entire
string. The following node-node combinations would be searched. If a search
combination is found the fare is assessed, and the next mode is processed. If no valid
combination is found, no fare assessed. The following combinations were be searched
for mode 2:
100-103
100-102 and 102-103
100-101 and 101-103
100-101, 101-102, and 102-103
Then there would be search for mode 5 nodes 103 to node 301 (103-300-301) followed
by a search for mode 5 (400-308). Note that there will not be search for 103-308
because the path has a mode change between the segments.
Different FAREMATI keywords may point to the same file, in order to enter the same
structure for different modes. Mode mixing can not occur.
The values can be obtained in the MATRICES MW statements:
MW[] = faremat(modes...) (0 is the total of the modes.)
TRNBUILD Program > Control statements > FILEI > Example
Exam ple
FILEI NETI=?hwy.net ; ? will be replaced by current system prefix.
NETI = r:\work\?\base.net ; r:\work\ALTA\vase.net -- system prefix = ALTA
MATI = mytrip.fil ; referenced by TRIPS statement.
FAREMATI[2] = myfare.mat
TRNBUILD Program > Control statements > FILEO
FILEO
Outputs files. Keywords and sub-keywords include:
• MA T O
• N E T O - currently disabled!
m MODES
m STOPSONLY
• S U P P OR T O
m MODES
m FIXED
m ONEWAY
• LIN KO
• N OD E O
• LIN E V OLO
m ID
m FORMAT
• LIN KV OLO
m ID
m FORMAT
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
LIN E V OLO |KF| Name of the text file where the program
writes line summary records. If an
assignment is undertaken and this file is
specified, the program writes a record for
each LINE containing the following fields:
Name, Mode, Owner, Frequency,
LineTime, LineDistance, TotalBoardings,
PassengerMiles, PassengerHours, ID.
Specify the format of the file with the
FORMAT subkeyword.
LIN KV OLO |KF| Name of the text file where program writes
link summary records. If specified,
program writes a record for each LINK
containing the following fields: A, B, Time,
Mode, Plot, StopA, StopB, Distance,
Name, Owner, [Volume,] ID. (Plot is either
a 1 or a 0 to indicate this is the best record
for this A-B to plot. Volume is not written if
assignment is not in effect.) Specify the
format of the file with the FORMAT
subkeyword.
LINKVOLO FOR MA T |S| Specifies the format for writing LINKVOLO
records. Possible values:
• TXT
SUPPORTO FIXE D |?| Flag that indicates how the program writes
the data fields to statements in the
SUPPORTO file:
• False — Indicates statements are
completely free form.
• True — Indicates fixed-length fields,
providing easier browsing, but
requiring more disk space.
Exam ple
FILEO NODEO = trnnode.dbf ; output node file
FILEO LINKO = trnlink.dbf ; output link file
FILEO MATO = ?los.mat ; output transit LOS values
FILEO LINEVOLO=linevol.csv, ID=ASSIGNB, FORMAT=CSV
FILEO LINKVOLO=linkvol.txt, ID=ASSIGNB, FORMAT=text
SUPPORTO = D:SUPPORT MODES=11-16 ONEWAY=N FIXED=Y
Result:
SUPPLINK N=1-7783 MODE=11 DIST= 30 SPEED= 2.5 ONEWAY=Y
SUPPLINK N=3-7592 MODE=11 DIST= 133 SPEED= 2.5
SUPPLINK N=3-7593 MODE=11 DIST= 20 SPEED= 2.5
SUPPLINK N=7-7688 MODE=11 DIST= 16 SPEED= 2.5
.
.
SUPPLINK N=1007-7689 MODE=11 DIST= 26 SPEED= 2.5
.
.
SUPPORTO=D:SUPPORT MODES=11-16 ONEWAY=Y FIXED=N
Result:
SUPPLINK N=1-7783 MODE=11 DIST=30 SPEED=2.5 ONEWAY=Y
SUPPLINK N=3-7592 MODE=11 DIST=133 SPEED=2.5 ONEWAY=Y
SUPPLINK N=3-7593 MODE=11 DIST=20 SPEED=2.5 ONEWAY=Y
SUPPLINK N=7-7688 MODE=11 DIST=16 SPEED=2.5 ONEWAY=Y
.
.
SUPPLINK N=1007-7689 MODE=11 DIST=26 SPEED=2.5 ONEWAY=Y
.
SUPPLINK N=7593-3 MODE=11 DIST=20 SPEED=2.5 ONEWAY=Y
.
.
TRNBUILD Program > Control statements > LINE
LINE
Defines transit lines. Keywords and sub-keywords include:
• A LLS T OP S
• COLOR
• FR E QU E N CY
• FR E QU E N CY R
• GLOB A L
m CLEAR
• MOD E
• N A ME
• N OD E S
m ACCESS
m ACCESS_C
m DELAY
m DELAY_C
m RT
m SPEED
m TF
m TIME
m XYSPD
• ON E W A Y
• R U N T IME
• S H OR T N A ME
• T IME FA C
• U S E R A 1, U S E R A 2, U S E R A 3, U S E R A 4, U S E R A 5
• U S E R N 1, U S E R N 2, U S E R N 3, U S E R N 4, U S E R N 5
• XY S P E E D
LIN E k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
NODES SPEED |R| Sets the speed for current link and all
subsequent links in the line (from the
input network or any LINK records),
until the program encounters another
SPEED or TF subkeyword. Only specify
SPEED within a node string.
NODES T IME |R| Sets the operation time for the link
surrounding this keyword.
When reading a LINE statement, the program initializes LINE processing with the
following steps:
• If this is the first LINE statement, clear all global values, and set global ONEWAY to true.
• If CLEAR is true (no matter where it is specified on the record), clear the line global
parameters, and set global ONEWAY to true.
• Set the line’s working parameters equal to the line’s global parameters.
After reading a LINE statement without errors, if GLOBAL is true, the program saves the
current line parameters in the line’s global area for use by subsequent lines. The
program can use a LINE statement with no NAME and no NODES to reset the line’s global
area. If all FREQUENCYR values are zero, the program resets FREQUENCYR to FREQUENCY
after saving to global, so that global FREQUENCYR is not affected.
Upon encountering each link in a node string, the program determines the time and
distance that the line uses with the following decision logic:
• If the link is found in either a LINK statement or in the input network:
m
If TIME has a value, set link time = TIME
m
Else if SPEED has a value, set link time to distance/SPEED
m
Else set link time to link time * TIMEFAC
Exam ple
LINE GLOBAL=y CLEAR=y MODE=3 ONEWAY=y TIMEFAC=1.2 ; setup global
LINE NAME=abc FREQUENCY=5,15,20,5 ONEWAY=n, ; basic values
N= 801-802-803 SPEED=23 N=804 805 -1805 806 807, -901,
DELAY=3 N=902,905,1006
LINE NAME=with_times NODES=801 802 803 RT=21.5 NODES=804 805 806,
RT=40 NODES=807 808 809 RT=50 NODES=9001 9002
TRNBUILD Program > Control statements > LINK
LINK
Link data for use by LINE definitions (must precede the LINE statement that includes the
link). Keywords include:
• CLE A R
• D IS T
• GLOB A L
• LIS T LIN K
• MOD E S
• N OD E S
• ON E W A Y
• SPEED
• XY A LL
• XY FA C
LIN K k e y wo rd s
Ke y wo rd D e s c rip tio n
MOD E S |IVP| Specifies the modes for the link. You may
code any combination of modes that does
not conflict with the used transit modes. If
you code the keyword more than one time
on the statement, the program uses all the
specified modes.
The LINK statement provides information about links that the program uses for transit
lines and that do not exist in the input network or have values that need to be revised.
The program stores these links separately does not consider them to be part of the
network. Because the program stores these links with other data, searching for them can
be inefficient. Because the program searches every link on a LINE statement,
considerable time could be spent in the search process. You can reduce the search time
if the program reads all the LINK statements at one time and saves them in a contiguous
area. Every link must have at least a distance, a time (or speed), and a specified mode.
TRNBUILD Program > Control statements > LINK > Example
Exam ple
LINK GLOBAL=y CLEAR=y MODES=1-10 ONEWAY=n
LINK NODES=1001-1002 DIST=100 SPEED=22.5
LINK DIST=250 TIME=15.5 NODES= 2003 - 3015 ONEWAY=y
TRNBUILD Program > Control statements > MATRICES
MATRICES
Output matrix definitions. Keywords include:
• N A ME
• MW [ ]
MA T R ICE S k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
MATRICES MW[1] = BOARDS,
MW[2] = TIME(1,2,3,4,5,6,7,8,9,10), ; total transit time
MW[3] = dist(11,13,14,15), ; total walk time
MW[4] = (IWAIT + TIME(0) + XWAIT(0) + XPEN) * 0.01, ; total time
MW[5] = NODEI, ; mode of access
MW[6] = NODE0(8), ; first boarding rail station
MW[7] = NODEL(8), ; last alighting rail station
MW[8] = STEPFUNC(DIST(4), 100,100, 200,150, 300,200, 500,300),
NAME = BOARDS, TOTAL_TIME, TOTAL_DIST, TTIME_MIN, ACCESS,
NAME[6] = RAIL1, RAIL2
TRNBUILD Program > Control statements > MULTIACCESS
MULTIACCESS
Multiaccess assignment keywords, including:
• MA XT IME D IFF
• MA XP CT D IFF
The presence of either of these keywords triggers the multiaccess process discussed in
“Path building” on page 1037.
MU LT IA CCE S S k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
MULTIACCESS MAXTIMEDIFF=3, MAXPCTDIFF=5
; any I-J path within 3 minutes of the best time will be included
; any I-J path within 5 percent of the best time will be included
TRNBUILD Program > Control statements > PARAMETERS
PARAMETERS
General parameters. Keywords include:
• B U ILD P A T H S
• FR E QP E R IOD
• LIS T IN P U T
• MA XP A T H T IME
• MA XR U N T IME
• ON LIN E
• P A T H S T Y LE
• S E QS IZE
• U S E R U N T IME
• W A LKS P E E D
• XY FA CT OR
• ZON E MS G
P A R A ME T E R S k e y wo rd s
Ke y wo rd D e s c rip tio n
The keywords on this statement are all “trigger” keys; you need not code the control
word PARAMETERS. You can input the values in any order, and, for most of the keywords,
if they appear multiple times, the program uses the latest value.
TRNBUILD Program > Control statements > PARAMETERS > Example
Exam ple
PARAMETERS MaxRunTime=120 ; flag long lines
MaxPathTime=180 ; no paths greater than 3 hours
WALKSPEED=4.1 ; walk speed in kph
USERUNTIME=n ; ignore LINE RUNTIME and RT values
TRNBUILD Program > Control statements > PHASE1
PHASE1
Initial parameters. Keywords include:
• H W Y T IME
• LIN KD U MP
• MA XN OD E
• W OR KR A M
P H A S E 1 k e y wo rd s
Ke y wo rd D e s c rip tio n
The keywords on this statement are all “trigger” keys; you need not code the control
word, PHASE1 need not be coded. These keywords are valid only prior to the opening of
the input network. Therefore, you must input them early in the input stream.
TRNBUILD Program > Control statements > PHASE1 > Example
Exam ple
MAXNODE=22000 HWYTIME=trantime ; increase highest node
PHASE1 MAXNODE=2100
TRNBUILD Program > Control statements > PNR
PNR
Specifies park-and-ride link generation. Keywords include:
• CLE A R
• GLOB A L
• LOT MOD E
• MA XT IME
• MOD E
• N OD E
• ON E W A Y
• S E LE CT
• T IME
• ZON E S
P N R k e y wo rd s
Ke y wo rd D e s c rip tio n
LOT MOD E |I| Mode assigned to the lot link. The value
must not conflict with any transit modes
being used.
After reading any input PNR statements, the program automatically tries to generate PNR
access links. However, you need not input PNR statements to enter PNR-access and lot
links in the transit network. You can input these links directly via SUPPORT statements.
TRNBUILD Program > Control statements > PNR > Example
Exam ple
PNR MODE=12 LOTMODE=13 ONEWAY=Y MAXTIME=30 GLOBAL=Y
; establish general global values for subsequent PNR's
PNR NODE=8001 ZONES=1-15,48,125,138-173
PNR node=9001-10001 ZONES=16-47,358
TRNBUILD Program > Control statements > REPORT
REPORT
Report requests. Keywords and sub-keywords include:
• CA P A CIT Y
• LIN E S
• LIN E S T R IN G
• LIN E V OL
m LINESORT
m MODES
m STOPSONLY
• LIN KV OL
m FULL
m MODES
m STOPSONLY
• N OD E V OL
m MODES
• R U N T IME A D J
• SPEED
R E P OR T k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
• * forces a match.
To include * or - in the mask,
enclose the mask within " ". The
program selects the number of
characters equal to the lesser of
the length of the mask or the name.
For example, to see all lines, enter
a single ?. To report lines that
begin with the letter A and have a 3
in the fourth position, enter A??3.
The REPORT statement specifies which reports the program prints and suppresses.
Some reports are automatically suppressed if the program does not complete trip
assignment. If you restrict assignment (do not accumulate all volumes, boards, or exits),
some reports will be incomplete.
NOTE: Some reports can be quite voluminous.
TRNBUILD Program > Control statements > REPORT > Example
Exam ple
REPORT CAPACITY=n SPDCODE=y RUNTIMEADJ=y
REPORT LINKVOL=y FULL=y ;list all links in the network.
REPORT LINEVOL=y, LINESORT=y, STOPSONLY=n
REPORT LINES= Name, Mode, ORDER;
REPORT LINESTRING=MU?## ;report all MUNI numbered lines
REPORT NODEVOL=y MODES=1,3-7,10
TRNBUILD Program > Control statements > SEGLIMITS
SEGLIMITS
Limits nontransit travel segments during path building (not during network construction).
Keywords include:
• MA XD IS T
• MA XT IME
• MOD E S
S E GLIMIT S k e y wo rd s
Ke y wo rd D e s c rip tio n
During path building, some paths may tend to use a successive series of nontransit
links. While each link itself has an acceptable time or distance, the sum of successive
link times may not be acceptable. This may be especially true for walk links. For
example, you might consider a walk time of 15 minutes to be acceptable. If the network
connects two 15-minute walk links, the path could use the links successively and
generate a 30-minute walk segment. A SEGLIMITS statement can preclude this from
happening. You may specify up to 20 SEGLIMITS statements. Each statement contains
the restricting modes, and either a MAXDIST or MAXTIME limit. If the statement specifies
both MAXTIME and MAXDIST, the program generates two segment limits.
TRNBUILD Program > Control statements > SEGLIMITS > Example
Exam ple
SEGLIMITS MODES=101,13 MAXTIME=22.5
; Any combination of mode 101 and mode 13 will be restricted to 22.5 minutes
SEGLIMITS MODES=212 MAXDIST=600 ; No mode 212 link > 6 miles
TRNBUILD Program > Control statements > SELECT
SELECT
Zone and miscellaneous selection. Keywords include:
• A CCE S S MOD E S
• I
• J
• IJ
• S KIP MOD E S
• T R A CE
S E LE CT k e y wo rd s
Ke y wo rd D e s c rip tio n
Exam ple
SELECT I=1-20,55,37-50,83, J=1-99,512
SELECT TRACE=( (I=1-10 && J=50-75,387 && BOARDS > 2) ||
(J=1-10 && I=50-75,387 && BOARDS > 2) )
SELECT SKIPMODES=12 , IJ=( (i=1-5 & j=100-120) || (i=100-120 & j=1-5) )
SELECT ACCESSMODES=11-16; all zone connect modes compete
TRNBUILD Program > Control statements > SUPPLINK
SUPPLINK
Direct input of nontransit links. Keywords include:
• D IS T
• MOD E
• N OD E S
• ON E W A Y
• SPEED
• T IME
• XY A LL
• XY FA C
This statement is compatible with Cube Base transit line editing, whereas SUPPORT is not
totally compatible. Citilabs recommends using this statement for single links rather than
using SUPPORT. SUPPLINK is a subset of SUPPORT; SUPPLINK does not support some of the
SUPPORT keywords. This section lists the supported keywords.
Ke y wo rd D e s c rip tio n
When a SUPPLINK statement contains both TIME and SPEED, the program sets link time to
TIME rather than calculating link time from DISTANCE and SPEED.
TRNBUILD Program > Control statements > SUPPLINK > Example
Exam ple
SUPPLINK MODE=13, SPEED=60, N=21-22 DIST=300
SUPPLINK NODES=21-22 MODE=15 DIST=500 TIME=20
TRNBUILD Program > Control statements > SUPPORT
SUPPORT
Direct input of nontransit links. Keywords include:
• CLE A R
• D IS T
• GLOB A L
• LIS T LIN K
• MOD E S
• N OD E S
• ON E W A Y
• SPEED
• XY A LL
• XY FA C
S U P P OR T k e y wo rd s
Ke y wo rd D e s c rip tio n
LIS T LIN K |?| Flag that indicates whether to list all the
generated links. Use primarily for
debugging.
SPEED |R| Speed used to compute the link times for all
generated links.
• If DIST specified (or set in global area) and there is only one link in a string, then set
distance = DIST.
• Else XYALL=N so the program computes the distance using the first successful method:
1. From A-B link in network
2. From B-A link in network
3. If XYFAC=Y, compute distance from the coordinates
4. Generate link error
End if
TRNBUILD Program > Control statements > SUPPORT > Example
Exam ple
SUPPORT MODES=13, SPEED=60, N=21-22 N=21-22-23 GLOBAL=Y DIST=3
SUPPORT N=21 -22 -23 24 N=24-25 GLOBAL=N CLEAR=Y MODES=11 XYFAC=Y
SUPPORT N=21 -22 -23 24 MODES=13-15 DIST=5 SPEED=0
TRNBUILD Program > Control statements > TRIPS
TRIPS
Specify trip processing. Keywords and sub-keywords include:
• MA T R IX
m ASSIGN, with sub-keywords VOLUMES, BOARDS, EXITS, OLINKS
T R IP S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Without a TRIPS control statement, the program does not process any trip matrix. Trip
processing restricts paths to only those zonal pairs with actual trips. When the program
encounters the MATRIX keyword, the program sets the default values of ASSIGN and its
subkeywords to false. If the program also encounters ASSIGN, the program sets the
default values of its subkeywords to the same value as ASSIGN. If ASSIGN is set to true,
the program observes any settings of other subkeywords. If ASSIGN is set to false, the
program ignores its subkeywords. Only set the values of ASSIGN subkeywords differently
than the ASSIGN value if you have insufficient memory to accumulate all data at one time.
TRNBUILD Program > Control statements > TRIPS > Example
Exam ple
TRIPS MATRIX=MI.1.3, ASSIGN=y, BOARDS=n,EXITS=n
TRIPS MATRIX=?14.1 ; matrix 1 from xxxx14.DAT -- MINUTP notation
TRIPS MATRIX=MI.1.3, ASSIGN=Y, OLINKS=5000-5001,5100-5101,5101-5100
TRIPS MATRIX=MI.1.3, ASSIGN=Y, OLINKS=5000-5001,5100--5101 ; same
TRNBUILD Program > Control statements > XFERGEN
XFERGEN
Generate transfer support links. Keywords include:
• MOD E
• MA XD IS T
Given this statement, the program generates support links of the specified modes using
only NETI links. The program builds paths from each stop node to all other stop nodes
within the specified distances. The program generates a distance for the support link
and computes the time from WALKSPEED. The program generates one support link for
each connection. For example, if a path from stop 100 to stop 200 uses four NETI links,
the program generates one support link from 100 to 200.
XFE R GE N k e y wo rd s
Ke y wo rd D e s c rip tio n
Example: Suppose stop 100 services modes 1 and 3, stop 200 services mode 3 and 6,
and the stops are 50 distance units apart. If MAXDIST[3]=25 and MAXDIST[6]=50, the
program will connect these stops. The largest MAXDIST of any of the serviced nodes
defines the limit for a connection. If you use multiple XFERGEN statements or repeat a
MAXDIST keyword, the program uses the last value. A typical statement might be:
XFERGEN MODE=11, MAXDIST=10*33, MAXDIST[8]=50
; allow longer walk to Mode 8
Use care when specifying MAXDIST; you could generate more links than TRNBUILD can
handle. The link paths will pass through centroids, if that is the best path between
nodes. To examine the generated links, use a SUPPORTO statement to induce the
program to write a file of SUPPLINK records.
TRNBUILD Program > Control statements > XY
XY
Insert or revise coordinates. Keywords and sub-keywords include:
• N OD E
m X
m Y
• XY
XY k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
XY NODE=137, X=234123, Y=327500, NODE=138, X=234123, Y=327510
XY XY[137]= 234123,327500 234123,327510 ;Same as above
TRNBUILD Program > Control statements > ZONEACCESS
ZONEACCESS
Zonal access development (not PNR) parameters. Keywords include:
• GE N E R A T E
m DIRECTION
m LIST
m MAXDIST
m MAXLINKS
m MAXSTOPS
m MODE
m SELECT
• LIN K
m DIST
m MODE
m ONEWAY
ZON E A CCE S S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Exam ple
ZONEACCESS generate=y,maxstops=1,2,3*4,6,7,8,10, maxdist=10*150 mode=11
ZONEACCESS link=43-22,43-40,MODE=14 dist=050
TRNBUILD Program > Examples and FAQ
; ----- request to see certain transit paths (must use transit links)
TRACE=(I=1-5 && J=1-5 && BOARDS>0)
• Phases
Cube Avenue > Using Cube Avenue > Cube Avenue introduction
• P la nning mo d e ls
• Citilabs recommends PACKET S=PA, the default Packet Allocation mode, with a packet
size (P A CKE T S IZE ) of 1 or 2.
If using PACKETS=PS, Packet Splitting mode, the target packet size should be at
least as big as the expected number of iterations. If the matrix is large, a bigger value
may be appropriate.
• Avoid small matrix cells. Every non-zero cell must generate packets. But packets consume
computer memory and processor cycles. Therefore a matrix with many small cells can
cause lots of time and RAM to be wasted. Bucket rounding the matrix before assigning it is
probably the easiest way of cleaning a non-sparse demand matrix but, if you have enough
local knowledge of the study area, you may be able to clean the matrix better by hand.
Cube Avenue > Using Cube Avenue > Phases
Phases
This section describes the typical phases in Cube Avenue:
• SETUP phase
• LINKREAD phase
• ILOOP phase
• ADJUST phase
• CONVERGE phase
Cube Avenue > Using Cube Avenue > Phases > SETUP phase
SET UP phase
This phase behaves identically in Cube Avenue and standard Cube Voyager Highway
assignments.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase
• LINKCLASS
• LI.SPDCLASS, LI.CAPCLASS
• LI.LANES
• SPEED
• C
• T0
• T1
• STORAGE
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > NOTE: Positive values should be used for DISTANCE,
C, SPEED, and STORAGE. Thus, zero values should be avoided.
NOTE: Positive values should be used for DISTANCE , C , SPEED , and STORAGE . Thus, zero
values should be avoided.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > DISTANCE
DISTANCE
If the user does not set this variable in script, it will be initialized from LI.DISTANCE, if
that variable exists and has a non-negative value. Failing that, it defaults to zero. Zero
distance links are sometimes described as “dummy links.”
As in any network, free-flow time must be provided independently of speed for zero
distance links, and output speeds are not meaningful for them. In Cube Avenue, a link
distance of zero may also cause STORAGE to default to zero (with disastrous
consequences for the modeling).
Distance is usually measured in miles or in kilometers.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > LINKCLASS
LINKCLASS
In Cube Avenue, LinkClass functions as the index for functions TC and COST, as it
does in any other highway assignment. If the script does not set the variable,
LI.LINKCLASS will be used if the variable exists and has a positive value. Failing that, it
defaults to one.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > LI.SPDCLASS, LI.CAPCLASS
LI.SPDCLASS, LI.CAPCLASS
If these field(s) exist, and the values in them are positive, and appropriate speed or
capacity tables are defined in the network, or in the script, they will be used, in
conjunction with Li.Lanes, to look up base speed and capacity values.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > LI.LANES
LI.LANES
The variable Li.Lanes will be taken from the input network. If there is no such field or if
the value in the field is non-positive, a value of one will be used. Note that the field name
required in the input network is “LANES” and that fields with similar names, such as
“NumberOfLanes,” will not be recognized as the number of lanes.
As in any highway assignment, Li.Lanes, may be used as an index into speed or
capacity tables.
In Cube Avenue, LI.LANES may also take part in the default STORAGE calculations.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > SPEED
SPEED
If the user does not set this variable in script, then defaulting will be from Li.Speed if that
exists. If Li.Speed does not exist, but Li.Lanes does, a speed table lookup will be
attempted. If all defaults fail, or if they result in a negative value, Speed will be initialized
to zero.
Note that, during the modeling, SPEED is a dependent variable; the independent
variable is TIME. Thus the defaulting behavior of SPEED is only significant if it is used to
calculate a default for T0.
Speed is in distance units per hour.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > C
This is the flow capacity of the link, in vehicles per model period. Note that this measures
how quickly the link can discharge or accept vehicles. This capacity differs from
STORAGE, which measures how many vehicles can occupy the link simultaneously.
Scripts can use the DYNAMIC command to specify that the value of C varies by time
segment.
If the script does not explicitly set this variable, the value in Li.Capacity is used as the
default. If Li.Capacity does not exist but Li.Lanes does, a capacity table lookup will be
attempted. If none of these values exists, a value of zero will be applied (with disastrous
consequences for Cube Avenue modeling). Finally, if PARAMETERS CAPFAC has been
coded, that factor will be applied.
Essentially, this value is the maximum frequency with which a vehicle can be discharged
from or admitted to a link. Thus, a zero-capacity link can delay packets forever.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > T0
T0
This is the free-flow time for the link, in minutes. It is used during application of the
function, TC. If the user does not set a value in script, the program will look in turn for
Li.T0, Li.Time and Li.Time1, in that order. If it still cannot find a value it will try to use
60*Distance/Speed. If all else fails, a default of zero will be applied.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > T1
T1
This is the link time to be used on the first iteration of assignment, before any calculated
times are available from an ADJUST phase. Note that in Cube Avenue it is applied to
every time segment. It defaults to T0 unless the user explicitly sets the value in script. It
is very common to accept this value, although there may be some merit to using
observed times where these are available.
Cube Avenue > Using Cube Avenue > Phases > LINKREAD phase > STORAGE
STORAGE
This is the number of vehicles that can fill the link. Both queuing and moving vehicles on
the link will use up storage. However, the storage does not directly limit the flow on the
link; so long as vehicles leave the link as fast as new vehicles arrive, the number of
vehicles on the link does not change. Thus every link has two capacities: the standard
capacity, C, restrains flow while STORAGE restrains occupancy.
If the user script does not supply a positive value for STORAGE, the program will try to
extract a value from LI.STORAGE. If a positive value still cannot be found,
LI.LANES*DISTANCE*vpd, where vpd denotes the value of PARAMETERS
VEHPERDIST, will be tried. If all else fails a value of zero will be applied (with the
disastrous consequence that the link will always be full, and hence, impassable).
Note that a link that has any spare storage will admit packets. In particular, if a packet
arrives at a link with some storage available, but the packet’s volume exceeds the
available storage, it will still be admitted to the link. (The link then becomes full, and it
remains full until it has discharged sufficient vehicles to reduce the occupancy back
below 100%.) Thus the maximum number of vehicles that can be observed on a link
may exceed that link’s storage slightly.
Cube Avenue > Using Cube Avenue > Phases > ILOOP phase
ILOOP phase
This phase is concerned with the creation of packets and the determination of routes.
The user script associated with this phase is executed for each time segment, and within
each time segment for every origin. This script should contain one or more
DYNAMICLOAD statements.
NOTE: You may elect to generate new packets each iteration, and discard the old ones,
using the PACKETS GENPKTBYITER subkeyword. This is normally used in conjunction with
DYNAMICLOAD BUILDALLPATHS to force regeneration of all possible OD paths each iteration.
Please follow the links for these keywords for more information on usage and application.
Cube Avenue > Using Cube Avenue > Phases > ADJUST phase
ADJUST phase
This phase is executed when the movement of packets through the network is
simulated. Initially, all network link times are given by applying the TC function applied to
the volumes assigned in the previous iteration for the corresponding time segment
(except for the first iteration, when T1 is used).
During the simulation, a “queue” of events is maintained. In addition, there is a queue of
blocked packets waiting to get on each downstream link. There are four kinds of event
that can be stored in the event queue: a packet departs an origin, a packet arrives on a
new link, a packet arrives at its destination, or a packet becomes unblocked on a link.
Initially the event queue contains one event for each packet’s departure from that
packet’s origin and all the link queues are empty. The event queue is sorted on the time
at which the events are scheduled to occur.
The events from the event queue are processed in turn. As each event is processed
more events are added to the queue. For example, when a packet is scheduled to arrive
at a link A from link B, it is verified whether link A will accept the packet (if not it joins link
A’s queue) and an arrival event is scheduled for the next link on the path; before the
event processing is completed, a check is made to see whether any packets can be
released from link B’s queue.
Since every event occurs at a specified time, it is easy to determine whether the next
event occurs in the same time segment as the current one. If not, or if the end of the
model period has been reached, the script associated with the ADJUST phase is
executed for the time segment that has just been completed.
At the end of the entire simulation, some of the results are aggregated to obtain values
relevant to the entire modeled period. It is these aggregate values that are passed to the
Converge phase.
Cube Avenue > Using Cube Avenue > Phases > CONVERGE phase
Control statements
This section describes Cube Avenue-specific control statements:
• DYNAMIC
• DYNAMICLOAD
• FILEO
• PARAMETERS
• PATHLOAD
The control statements available in the Highway program are also available in Cube
Avenue.
Cube Avenue > Control statements > DYNAMIC
DYNAMIC
Changes the value of the capacity variable by time segment. Only use this command
during the LINKREAD phase.
Keywords include:
• C
Ke y wo rd D e s c rip tio n
This statement is useful for modeling time-dependent changes in link capacities, such
as reversible lanes, the closing of HOV facilities at specific times of day, the opening of
HOV facilities to general purpose uses at specific times of day, or construction closures.
For example, suppose you have:
• Input network with a default hourly lane capacity coded as CAP
• Cube Avenue model period is 180 minutes with three 60-minute time segments
• In the last hour of the period some shoulder lanes available in the prior two hours are no
longer available
You can set the default capacities for all links in all segments with the static script
statement:
C=li.CAP*li.LANES1*3
Then use the DYNAMIC statement to set capacity in the third time segment when the
shoulder lanes become unavailable:
DYNAMIC C[3]=li.CAP*li.LANES2*3
where LANES1 and LANES2 contain the available lanes during the first two hours and
the last hour, respectively.
Cube Avenue > Control statements > DYNAMICLOAD
DYNAMICLOAD
DYNAMICLOAD is the dynamic analog of the static PATHLOAD statement. Most of the
keywords have the same syntax and meaning as the corresponding keywords of the
PATHLOAD statement, so only the differences are noted in this section.
Furthermore, it is intended to allow some other clauses of the PATHLOAD statement to
be applied to dynamic loading once the relevant functionality has been implemented.
• D E MA N D D IS T R IB = random/uniform
• D E MA N D IS H OU R LY = t/f
• IN CLU D E J = list
• E XCLU D E J = list
• V OL[ n] = list
• P A T H = time/cost/list
• E XCLU D E GR P = list
• PACKETSIZE = value
• P E N I = list
• P E N IFA CT OR = value
• N OA CCE S S = real
The DYNAMICLOAD statement may only occur in PROCESS PHASE = ILOOP. A static
assignment script must contain one or more PATHLOAD statements but may not
contain a “PARAMETERS MODELPERIOD= SEGMENTS=” clause nor a
DYNAMICLOAD statement. A dynamic traffic assignment must include a
“PARAMETERS MODELPERIOD= SEGMENTS=” clause and at least one
DYNAMICLOAD statement. It may also contain one or more PATHLOAD statements, in
which case simultaneous dynamic and static loadings will occur. See “Combined use of
DYNAMICLOAD and static PATHLOAD” on page 1116 for a description on running
combined DYNAMICLOAD and static PATHLOAD in the same run.
Several keywords of the DYNAMICLOAD statement require time-segmented lists as
inputs (these lists contain one item per time segment). If you enter a single value that
contains one or more occurrences of __TS__, Cube Avenue expands the value into a
list by replacing the __TS__ with the integers representing the time segments, such as
1, 2, and so forth. For example, entering PATH=LW.COST__TS__ is equivalent to
entering PATH=LW.COST1, LW.COST2, LW.COST3, and so forth.
DEM ANDDISTRIB
The DYNAMICLOAD DEMANDDISTRIB= clause may take, as its value, “RANDOM” or
“UNIFORM”. This clause allows the vehicle departure distribution to be either uniform
random (default) or uniform constant. Under the latter condition, packets depart
uniformly spaced across a time segment. For example, 15 minute time segment with 150
packets will have a packet departing every 6 seconds.
BUILDALLPATHS
For example:
DYNAMICLOAD PATH=TIME, BUILDALLPATHS=T, PACKETSIZE=1,
VOL[1]=MW[110+__TS__], EXCLUDEGRP=1 ; loading for free roads
DYNAMICLOAD PATH=TIME, BUILDALLPATHS=T, PACKETSIZE=1,
VOL[2]=MW[120+__TS__] ; loading for toll roads
PATH
The DYNAMICLOAD PATH= keyword may take, as its value, “TIME,” “COST,” or a list
of input link attributes one per time segment:
• In the first two cases, the path will be built to minimize the appropriate time varying function.
• In the last case, a time varying function to be minimized will be constructed by using the
value from the appropriate link attribute in each time segment (that is, LI. Variables or
LW.Variables). One attribute must be declared for each time segment. For example, with
two time segments and custom LW variable CTIME, proper syntax would begin with:
DYNAMICLOAD PATH=LW.CTIME, LW.CTIME, (etc...)
The predicted disutility for a vehicle of traveling down a link is therefore dependent on
the time segment in which the vehicle expects to enter that link. You can use the
macro expansion of _TX to abbreviate the list of link variables.
DEM ANDISHOURLY
The DYNAMICLOAD DEMANDISHOURLY = keyword is, by default, false. It determines
whether the demand volumes for each time segment are supplied as an absolute value
in vehicles or as a rate in vehicles per hour. For example, suppose that there is a
segment of 15 minutes, and the corresponding expression in a DYNAMICLOAD VOL[n]
= clause evaluates to thirty. If DEMANDISHOURLY, then the demand is 30 vph and 7½
vehicles will depart the origin during the time segment. Otherwise thirty vehicles depart
the origin during the time segment, giving a departure rate of 120 vph.
VOL[n]
PACKETSIZE
NOTE: Citilabs
recommends setting PACKETSIZE to 1 or 2 when in Packet Allocation
mode (PACKETS=PA).
M W [n]
The DYNAMICLOAD MW keyword specifies skims. The value must take the form:
TRACE(time, expression, penalty)
where:
• time is the start time, specified in minutes since the beginning of the model period. It
indicates that the skim should be for vehicles departing their origins at the specified start
time. Negative values indicate that the start time is in the 'warm up' period.
• expression is the expression evaluated and summed for each link on the route.
• penalty is an optional list of turn penalty sets to include in the skim.
You can use the special expression, PATHCOST, to skim the value of the DYNAMIC
PATH clause. If the expression contains the string __TS__, it will be evaluated as a
dynamic expression that varies by time segment.
Cube Avenue > Control statements > DYNAMICLOAD > Combined use of DYNAMICLOAD and static PATHLOAD
• There must be at least one instance of PATHLOAD in phase ILOOP; there may be more
than one.
• No variables are vectorized by segment and all apply to the model period as a whole.
• There is a single “static” time segment and it runs same as the Highway program has
always run.
Cube Avenue > Control statements > DYNAMICLOAD > Combined use of DYNAMICLOAD and static PATHLOAD > Case 2:
Dynamic assignment
• There must be at least one instance DYNAMICLOAD in phase ILOOP; there may be more
than one.
• There is one time segment for each of the segments listed with the SEGMENTS=
PARAMETER and phase ILOOP will be executed for each of them. During each of these
executions of ILOOP, a single item from the list of matrix expressions in each
DYNAMICLOAD statement is evaluated (and paths built, packets created, etc.). No
PATHLOAD statements are executed during any of these executions of phase ILOOP.
• If there are any instances of PATHLOAD, an additional execution of PHASE ILOOP occurs
prior to any of the executions described above. During this execution of phase ILOOP, no
DYNAMICLOAD statements are executed but PATHLOAD statements are. The volumes
assigned are assumed to apply to the model period so the volumes applicable to each of
the time segments get preloaded with PATHLOAD-VOLUME*(length of segment)/(model
period).
• Phase ADJUST is executed for each time segment. The results (except for volumes) are
carried forward to the corresponding execution of ILOOP during the next iteration. After
ADJUST has been executed for each time segment, aggregate values applying to the
model period are calculated from the results individual time segments. These aggregate
results are used for the calculation of convergence statistics. If there are any PATHLOAD
statements in phase ILOOP, then these values (except for the volumes) will be carried
forward to the “static” execution of phase ILOOP during the next iteration.
Note that none of the discussion above depends on the ordering of PATHLOAD and
DYNAMICLOAD statements. It is their presence or absence from the ILOOP PHASE of
the script (as a whole) that is significant.
Cube Avenue > Control statements > FILEO
FILEO
Specific to Cube Avenue FILEO are the following keywords and subkeywords:
• P A CKE T LOG
m AFTERITER
m ARRIVALTIME
m DEPARTTIME
m DESTINATION
m FORMAT
m MUSTMEETALL
m ORIGIN
m SELECTGROUP
m SELECTLINK
The below Highway program output files are no t supported under FILEO if running a
dynamic assignment process under AVENUE. These include:
• E S T MD A T O
• E S T MICP O
• S U B A R E A MA T O
Note that a FILEO PATHO may be specified but it may not have dynamic paths written
to it during a dynamic assignment run under AVENUE. If a DYNAMICLOAD PATHO=T
control is found in the ILOOP PHASE, a fatal error will be generated. Some users have
keys implemented in their application scripts to turn on or off the generation of the
PATHO file. This will allow the script to run with the PATHO file being specified as long
as no dynamic paths are directed to the output file during the dynamic run.
You may skip ahead to:
• Output data
FILE O k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
Output data
Cube Avenue produces additional output data over that produced by the Highway
program. The dynamic assignment process implemented in Cube Avenue automatically
appends additional results variables onto the NETO output network using an indexing
convention similar to that used by the Highway program when performing static
assignment. The output NETO network will include all NETI input variables unless
explicitly excluded with the EXCLUDE keyword and any additional variables included
with the INCLUDE keyword and the following dynamic results variables:
• TIMESt_1 and TIME_1
• VITSt_1
• QUEUEVSt_1
• BLOCKVSt_1
For vehicles arriving on a link during a particular time segment, TIMESt_1 stores the
amount of time that the vehicles spent traversing the link segment (averaged over all
such vehicles). TIME_1 is similar, but applies to the model period (excluding any “warm
up” segments).
The reported values are effectively the sum of two components: the base time
calculated from function TC and the queue time resulting from storage and capacity
constraints.
Cube Avenue > Control statements > FILEO > Output data > SPEEDSt_1 and SPEED_1
This field contains the ratio between distance and the time (as defined above). It does
not take turn penalties or junction modelling into account.
Cube Avenue > Control statements > FILEO > Output data > VfSt_1, VfSMP_1, VSt_1 and VSMP_1
The volume of traffic entering the link, in volume field f, during time segment, t. VSt_1 is
the result of applying the V function to V1St_1, V2St_1, etc.
At origin zone centroid connectors, the values in the volume fields should correspond to
the appropriate matrix row totals.
Note there are two very different situations that can result in low volumes entering
downstream links (that is, links other than origin zone centroid connectors). If there is
very low demand for travel on the link, the flow will be low because the link is empty. At
the other extreme, a link that is full of traffic may block further vehicles from entering.
The values in the fields labelled with “MP” instead of a time segment number contain
aggregate values for the “model period” (that is, excluding any “warm up” segments).
Cube Avenue > Control statements > FILEO > Output data > VITSt_1
VITSt_1
The number of vehicles on each downstream link at the end of time segment, t, is
recorded in this field. The value is found by summing across all packets of vehicles that
are flowing or queuing on the link. At origin zone centroid connectors, the field value will
be zero, but this is just a convention indicating that data has not been collected for these
links.
Cube Avenue > Control statements > FILEO > Output data > QUEUEVSt_1
QUEUEVSt_1
This measures the average number of vehicles queuing on the link during time segment
t.
Packets of vehicles can be made to queue by either of two mechanisms. First, if the
packet tries to move onto a full link, it will be “blocked,” and it will queue until space
becomes available on the next link. Second, links and turns in the network are
associated with capacities and capacity bottlenecks may delay packets to ensure that
these capacities are not exceeded; the vehicles affected queue while waiting to
proceed, but are not recorded as “blocked.”
Cube Avenue > Control statements > FILEO > Output data > BLOCKVSt_1
BLOCKVSt_1
This records the number of vehicles in the queue that will remain in the queue at the end
of the simulation. The value will always be less than or equal to the queue variable.
Values can only increase in subsequent time segments.
Cube Avenue > Control statements > FILEO > Output data > AVGQDELAYSt_1 and AVGQDELAY_1
PARAMETERS
Sets general parameters. Keywords include:
• CA P LIN KE N T R Y
• COMB IN E
m GENPKTBYITER
m ITERLOADINC
m PACKETS
• MA XP T H P E R S E G
• MOD E LP E R IOD
m SEGMENTS
• P KT P T H S IZ
• P R E S E R V E MW
• V E H P E R D IS T
All the parameters from Highway are also available in Cube Avenue. This page only
mentions those parameters that are new or different in Cube Avenue.
P A R A ME T E R S k e y wo rd s
Ke y wo rd S ub k e y wo rd D e s c rip tio n
PATHLOAD
PATHLOAD is the static assignment path builder from the Highway program. See
“PATHLOAD” on page 270 for a description of this command statement and its
associated keywords and usage.
If a PATHLOAD statement is present in a Cube Avenue run, an extra initial execution of
the ILOOP is performed for every iteration. During this execution, all variables take values
associated with the model period; PATHLOAD statements are executed but DYNAMICLOAD
statements are not executed.
During dynamic simulation, the static loads (generated from PATHLOAD statements) are
present (and constant) in every time segment. The capacity, which is available for
packets, is reduced by the static loading. See “Combined use of DYNAMICLOAD and
static PATHLOAD” on page 1116 if implementing both command statements in the
same run.
The following Highway PATHLOAD keywords and their subkeywords are not supported if
using static PATHLOAD statements in a dynamic assignment process with DYNAMICLOAD
in effect.
• E S T MO
• PAT HO
Cube Avenue > Theory
Theory
This section discusses the theory behind Cube Avenue:
• Cube Avenue algorithm
NOTE: In packet allocation modes (PA and RPA), a new 'best path' is calculated on each
iteration, but no additional packets are generated. The existing packets are re-allocated
to the new best path. Unless PACKETS GENPKTBYITER is in effect, new packets are never
introduced. Thus, the computational demands of this mode are far lower than Packet
Splitting. When using Packet Allocation mode or Random Packet Allocation mode,
Citilabs recommends setting PACKETSIZE to 1 or 2.
• Times
• Speeds
Cube Avenue > Theory > Cube Avenue calculations > Volumes
Volumes
During the ILOOP phase, the matrix cells in the demand trip matrix are calculated and
split into packets. Paths are calculated for each packet and the packets are written to (a
temporary file on) disk. On the second and subsequent iterations, the packets are
appended to the existing disk file; the paths etc. from previous iterations are retained.
At the start of the simulation (that is, the ADJUST phase), all the link volume fields, for all
time segments, for the current iteration are cleared to zero. The packets are read from
disk and the stored values of flow are multiplied by the appropriate factor.
As the simulation progresses, the packets are released onto the network and move
along their predetermined paths. As they move from link to link the network volume fields
are updated as follows:
• When a packet departs the origin, the volume for the origin zone centroid connector is
updated.
• When a packet moves from a link to another link, the volume fields for the second link, and
for the turn between the two links, are updated. Note that the volume fields are updated for
a single time segment; the segment in which the first link is left.
An update to the volume fields for a given link or turn in a given time segment proceeds
as follows:
• First the packet is examined to determine which of the 1000 possible volume fields are
present.
• The values of V1, V2, …, V1000 are increased by the values stored in the packet.
• If the volumes are for a link, the function, V, is executed to update the total volume; if the
volumes are for a turn, the function, T, is used instead. Note that in the absence of a user-
defined function, these functions default to simple summation over all volumes.
At the end of the iteration, the convergence tests decide whether Cube Avenue should
continue or stop. If the latter choice is made, the volumes will be written to the output
network.
Cube Avenue > Theory > Cube Avenue calculations > Times
T imes
Logically, Cube Avenue maintains two components of link time (called flow time and
block time) and one component of turn time for each time segment. The link time is the
sum of the flow time and the block time.
Prior to any calculations, flow times for all time segments are initialized to the T1 values
read from the input network (or set by code in phase LINKREAD). Similarly turn times
are initialized from the “EstimatedDelay” values stored in the intersection file, and from
times in the turn penalty file. Any turns where these defaults do not yield a value are
initialized to zero. Block times are initialized to zero. The network time fields are
calculated as the sum of the blocked and flow times.
There are two kinds of turns in Cube Avenue: unmodeled and modeled. Unmodeled
turns are those where there is no modeling or where there is a fixed turn penalty.
Unmodeled turns never change their time and they do not apply capacity “gates” to
regulate the movement of packets from their preceding link. Modeled turns are those
with function turn penalties or with intersection models. In both cases the times are
updated for each time segment on each iteration but in the former case the capacities
neither change from segment to segment nor from iteration to iteration.
During path building, the link times are taken from the network time field. The costs are
taken by applying the cost function to these fields.
Prior to simulation, all blocked times are zeroed. As the simulation progresses the
packets move from link to link. Sometimes the packets take longer than the sum (flow
time + turn time) to do so. The program tracks in which time segments these excess
vehicle minutes occur.
Before a segment begins, the queues for each modeled turn are noted. In the first time
segment these are taken from the “InitialQueue” values stored in the intersection file. In
subsequent time segments they are found by looking at the packets simulated to be
waiting to make the relevant movement.
After a segment has been simulated, the blocked time for the segment becomes the
average excess minutes per vehicle, incurred during the segment. The flow times are
updated by running the appropriate TC functions for the segment volumes. The turn
times are updated by running the intersection model with the previously noted initial
queues and the turning volumes obtained from the simulation.
The time fields in the network for the segment are now updated to be the sum of blocked
and flow times. Any user code for the ADJUST phase is executed.
Cube Avenue > Theory > Cube Avenue calculations > Speeds
Speeds
The link speeds are not used during the path building or simulation. They are calculated
immediately prior to network output as Speed = 60 Distance / Time. Note that the
speeds do not take turn times into account.
Cube Avenue > Theory > Functions and built-ins
• TimeSegment
• SegmentStart
• Period
Storage
There is a new script variable, STORAGE, that may be set during the LINKREAD
phase. Refer to the description in “LINKREAD phase” on page 1103.
Cube Avenue > Theory > Functions and built-ins > TimeSegment
T imeSegment
This is the time segment number. The user script may not assign values to this variable.
It takes the value zero during a static assignment, or during the static phase of a
combined assignment. It takes values 1, 2, 3, etc. as the dynamic time segments are
being processed.
TIMESEGMENT is iterated differently depending on the Avenue phase. Be aware that:
• The ILOOP phase loops through only the dynamic time segments, and thus will work
correctly with any TIMESEGMENT conditionals.
• The ADJUST phase is also executed within a dynamic time segment loop, but finishes with
TIMESEGMENT being set to 0. During this static time segment, a final run-through the
PHASE=ADJUST statements is performed.
Cube Avenue > Theory > Functions and built-ins > SegmentStart
SegmentStart
This is the time in minutes between the start of the modeled period and the start of the
time segment currently being processed. User script may not assign values to this
variable. It takes the value zero during a static assignment, or during the static phase of
a combined assignment. Note that this is a signed value, with negative numbers
indicating the current segment is a “warm-up” segment and non-negative values
indicating that this segment is within the model period.
Cube Avenue > Theory > Functions and built-ins > Period
Period
This is the duration of the period currently being processed in minutes. User script may
not assign values to this variable. It is the duration of the model period during a static
assignment, or during the static phase of a combined assignment. It is the duration of the
current time segment when time segments are being processed.
Cube Avenue > Theory > Functions and built-ins > Time, Cost, Vol, and AVGQDELAY
In a Cube Avenue dynamic assignment, this will result in both link variables having the
cost values applicable to the last time segment. (Although the values for each time
segment in turn will be assigned to the link variables, they are not vectored, and the
costs associated with one time segment overwrite those associated with the previous
one.) To correctly calculate costs by user class, more work variables must be used:
IF (TIMESEGMENT=1)
LW.TRUCK_COST1=DISTANCE+TIME
LW.CAR_COST1=DISTANCE/2+TIME*1.5
ENDIF
IF (TIMESEGMENT=2)
LW.TRUCK_COST2=DISTANCE+TIME
LW.CAR_COST2=DISTANCE/2+TIME*1.5
ENDIF
Note here that TIMESEGMENT=2 is explicitly tested, instead of indirectly with an ELSE
statement. The last time segment normally iterated in an ADJUST phase is 0 — which is
not a desired in this example.
The new variables can be used in a DYNAMICLOAD statement. For example:
DYNAMICLOAD PATH=LW.TRUCK_COST__TS__
Cube Avenue > Examples
Examples
This section contains examples of Cube Avenue scripts:
• Example 1: Program
• Example 3: LINKREAD
• Example 5: Centroids
• Example 6: ILOOP
• Example 7: ADJUST
Example 1: Program
Call Cube Avenue just as you call other Cube Voyager programs, with “RUN PGM=....”
Place all statements and keywords that control the run in a “RUN... ENDRUN” block.
You can specify an output print file after a “PGM=AVENUE PRNFILE=” statement.
; Do not change filenames or add or remove FILEI/FILEO
; statements using an editor. Use Application Manager.
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
FILEO NETO = "{SCENARIO_DIR}\OUTPUT.NET"
FILEI NETI = "{SCENARIO_DIR}\INPUT.NET"
FILEI MATI[1] = "{SCENARIO_DIR}\INPUT.MAT"
ENDRUN
Cube Avenue > Examples > Example 2: Add parameters
• COMBINE specifies the method of combining iterations together. In this case, the method is
AVE, successive averages. AVE is the recommended method for equilibrium dynamic
assignment.
Example 3: LINKREAD
Just as in the Highway model, Cube Avenue reads the input network and uses either
user expressions or default rules to initialize important link variables. This example
shows:
• DISTANCE — Used with other variables to calculate default T0 and STORAGE values.
• STORAGE — Number of vehicles that can physically fit on a link (should not be zero).
• LINKCLASS — Function index number for calculating congested time and cost.
• C — Flow rate capacity, in vehicles per model period. You might need to convert from
hourly capacities.
; Do not change filenames or add or remove FILEI/FILEO
; statements using an editor. Use Application Manager.
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
FILEO NETO = "{SCENARIO_DIR}\OUTPUT.NET"
FILEI NETI = "{SCENARIO_DIR}\INPUT.NET"
FILEI MATI[1] = "{SCENARIO_DIR}\INPUT.MAT"
PARAMETERS MAXITERS=10, COMBINE=AVE,
MODELPERIOD=90, SEGMENTS=30,30,30,30 ;30 min warm-up
PHASE=LINKREAD
DISTANCE=LI.FEET/5280 ;converting to miles
SPEED=LI.MPH
T0=60*DISTANCE/SPEED ;time in minutes
C=LI.LANES*LI.LNCAP*1.5 ;scale to model period
STORAGE = DISTANCE*LI.LANES*LI.VEHPERLNMI
IF (STORAGE=0) STORAGE=9999999
LINKCLASS = LI.FTYPE
ENDPHASE
ENDRUN
Cube Avenue > Examples > Example 4: Simplifying LINKREAD
Example 5: Centroids
Centroid connectors connect zones to the network; they do not represent physical road
features. Therefore, in Cube Avenue, you must define these links to have infinite (that is,
very large) capacity, infinite storage, and zero travel time.
Because links with zero capacity and storage can cause problems in dynamic
assignment, you must find such links and give them large capacity and storage values,
also.
This example assigns all centroid connectors LINKCLASS=2 using the ZONES
variable.
; Do not change filenames or add or remove FILEI/FILEO
; statements using an editor. Use Application Manager.
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
ENDRUN
Cube Avenue > Examples > Example 6: ILOOP
Example 6: ILOOP
During each main iteration, Cube Avenue loops through all the input zones, creates
packets for assignment, and builds dynamic (time-varying) paths.
The statement DYNAMICLOAD PATH=COST tells Cube Avenue to build dynamic paths using
congested travel costs by time segment. By default, this is the same as TIME, which is
initially the free-flow link travel time.
The input matrix for this example contains three tables, one for each half hour of the
model period. The statement PACKETSIZE=1 groups the input vehicle trips into
packets with a target size of one vehicle (recommended for the default Packet Allocation
mode). The tables listed in VOL[1] specify the matrix to use for each time segment,
including warm-up.
; Do not change filenames or add or remove FILEI/FILEO
; statements using an editor. Use Application Manager.
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
FILEO NETO = "{SCENARIO_DIR}\OUTPUT.NET"
FILEI NETI = "{SCENARIO_DIR}\INPUT.NET"
FILEI MATI[1] = "{SCENARIO_DIR}\INPUT.MAT"
PARAMETERS MAXITERS=10, COMBINE=AVE, CAPFAC=1.5,
MODELPERIOD=90, SEGMENTS=30,30,30,30 ;30 min warm-up
PHASE=LINKREAD
IF (A<=ZONES||B<=ZONES) LINKCLASS=2
IF (LINKCLASS==2||STORAGE==0) STORAGE=9999999
IF (LINKCLASS==2||C==0) C=9999999
IF (LINKCLASS==2) T0=0
PHASE=ILOOP
DYNAMICLOAD PATH=COST, PACKETSIZE=1,
VOL[1]=mi.1.1,mi.1.1,mi.1.2,mi.1.3
ENDPHASE
ENDRUN
Cube Avenue > Examples > Example 7: ADJUST
Example 7: ADJUST
When a script calls one or more DYNAMICLOAD statements, Cube Avenue simulates the
movement of packets through the network during the ADJUST phase.
After simulating packets and recording link volumes, Cube Avenue uses delay functions
to calculate congested travel times by segment. By default, Cube Avenue adjusts all
links using the standard BPR formula:
TC[1] = T0 *(1 + 0.15* (V/C) ^ 4)
; Do not change filenames or add or remove FILEI/FILEO
; statements using an editor. Use Application Manager.
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
ENDRUN
Cube Avenue > Examples > Example 8: Enhancing ADJUST
• LI.J represents a calibration parameter coded directly into the network, based on facility
type.
The example introduces a custom COST function that incorporates vehicle operating
costs and tolls into route-choice behavior. The units of COST are monetary.
; Do not change filenames or add or remove FILEI/FILEO
; statements using an editor. Use Application Manager.
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
ENDRUN
Cube Avenue > Examples > Example 9: Packet logs
• DEPARTTIME / ARRIVALTIME — Lists departure and arrival times (in seconds) of output
packets
• SELECTGROUP — List link groups that output packets must pass through
• MUSTMEETALL — Set to F, specifying that links specify an area; hence output packets
must pass through at least one of the specified links, but not necessarily all of the links
• AFTERITER — Delays writing the packet log until the specified iteration
• FORMAT — Specifies that the output be written to a binary log file rather than default text
format
RUN PGM=AVENUE PRNFILE="{SCENARIO_DIR}\OUT.PRN"
where:
• N is the number of modeled time segments
In addition, when the “_TS_” notation is used within MW brackets for VOL, Cube
Avenue substitutes the expression with an MW vector that contains the number of time
segments (replacing “_TS_” with the time segment’s index).
RUN PGM=AVENUE PRNFILE=“{SCENARIO_DIR}\OUT.PRN”
FILEO NETO = "{SCENARIO_DIR}\OUTPUT.NET"
FILEI NETI = "{SCENARIO_DIR}\INPUT.NET"
FILEI MATI[1] = "{SCENARIO_DIR}\INPUT.MAT"
FILEO PACKETLOG = "{SCENARIO_DIR}\PACKET.LOG",
ORIGIN=1-10, DESTINATION=1-10,
DEPARTTIME=1800-3600, ARRIVALTIME=1800-3600,
SELECTLINK=(L=101-1903*), SELECTGROUP=3,
MUSTMEETALL=F, AFTERITER=9, FORMAT=BIN
PARAMETERS MAXITERS=10, COMBINE=AVE, CAPFAC=1.5,
MODELPERIOD=90, SEGMENTS=4*30, MaxPthPerSeg=10
PHASE=LINKREAD
IF (A<=ZONES||B<=ZONES) LINKCLASS=2
IF (LINKCLASS==2||STORAGE==0) STORAGE=9999999
IF (LINKCLASS==2||C==0) C=9999999
IF (LINKCLASS==2) T0=0
IF (LI.TOLL>0) AddToGroup=3
PHASE=ILOOP
MW[1]=mi.1.1
MW[2]=mi.1.1,MW[3]=mi.1.2,MW[4]=mi.1.3
DYNAMICLOAD PATH=COST, PACKETSIZE=1,
VOL[1]=MW[__TS__]
PHASE=ADJUST
Function TC[1]=T0+LI.D0+(0.25*15)*((V/C-1)+
SQRT((V/C-1)^2+((16*LI.J*V/C*DIST^2)/15^2)))
Function TC[2]=T0
Function COST[1]=TIME*{VOT}+DISTANCE*{VOC}+LI.TOLL
Function COST[2]=TIME
ENDPHASE
ENDRUN
Cube Cluster > Using Cube Cluster
The following control statements are available in the Cube Voyager Matrix and Highway
programs to implement IDP
If this model is distributed, the final results will be different than the standalone case, for
the cluster nodes not using zone 1 will use different seeds.
However, each node’s random numbers could be explicitly spawned from the same
seed (or, the necessary random series could be otherwise generated ahead of time).
For example:
X=RANDSEED(12345)
All cluster nodes executing this command will use the same random series. This
potentially defeats the purpose of using random number generation to begin with.
Citilabs recommends against using Cluster with models with random generation, unless
absolutely necessary.
Cube Cluster > Using Cube Cluster > Working with Cube Cluster > Using Cluster with HIGHWAY
• Use of Cluster can have a very small effect on volumes generated by the HIGHWAY
program. During the ADJUST phase, when iteration volumes are combined, the final
assigned volumes might vary slightly over different numbers of cluster nodes.
Please see the PARAMETERS COM BINE EQUI sub-keyword, which controls the Standard
equilibrium processing in Highway. When ENHANCE is set to 2 (Bi-conjugate Frank-
Wolfe algorithm), the effect is most noticeable. The differences are less pronounced
with ENHANCE = 1 (Conjugate Frank-Wolfe algorithm), and extremely minimal with
ENHANCE = 0 (standard Frank-Wolfe algorithm, the default for EQUI).
The difference in all cases is negligible, and an unavoidable aspect of floating point
arithmetic when distributed over cluster nodes. If this is an issue for your application,
Citilabs recommends standardizing the number of cores for the model.
Cube Cluster > Using Cube Cluster > Working with Cube Cluster > Intrastep distributed processing (IDP)
This statement will invoke intrastep distributed processing in the program unless the
global switch is off. Before running the job in the main computer, all the sub-process
computers participating in the DP must be started and in the wait mode with the correct
file name to wait for. The ProcessID and the process numbers in the ProcessList are
used to make up the name of the wait file. See “Utilities” on page 1181 for tools and
examples of how to start multiple instances of Cube Voyager in WAIT mode with the
appropriate settings prior to starting a distributed run.
The ProcessID is the prefix for the file names used to communicate with the sub-
processes. ProcessList is a list of sub-processes to use for DP. It is a list of numbers
and put in as individual numbers or ranges (for example, ProcessList=1,5,10-20,25).
Each sub-process must be assigned a unique process number.
MinGroupSize is the minimum distributed zone group size. If there are more sub-
processes than there are zone groups of this size, then some sub-processes will not be
used. For example, if there are 100 zones and MinGroupSize is 20 and ProcessList=1-
10, only 4 sub-processes will be used to process 20 zones each and the main process
will process 20 zones itself.
SavePrn is a switch to control if the sub-process print files should be saved or not. The
default is F (false) for this keyword. The IDP process automatically merges the script
generated information (from Print statements etc.) and error messages from sub-
process print files into the main print file so there is little reason to save the sub-process
print files except for debugging purposes.
With the example of ProcessID='TestDist' and ProcessList=1-4 above, four sub-
processes will be used. The script files that each of the sub-process is looking for is
{ProcessID}{Process#}.script. So in this example, the 4 sub-process will start with the
following script file to look for:
Sub 1 : TestDist1.script
Sub 2 : TestDist2.script
Sub 3 : TestDist3.script
Sub 4 : TestDist4.script
Cube Voyager must be started on each of the processor nodes for each of the sub-
processes and the above script names and common working directory set and then
press the Wait Start button to go into wait mode. Cube Voyager can also be started with
command line parameters:
Voyager TestDist1.script /wait
This will put Cube Voyager in the wait mode automatically. If the current directory is the
work directory, then no drive/path is needed when specifying the script file name,
otherwise, full path name should be used when specifying the script file.
If the processor nodes of your cluster are separate single processor computers
connected via a local network then you will need to start an instance of Cube Voyager
on each of the computers in your cluster and set the appropriate script name for that
node. Each processor node in the cluster should correspond to one of your process
numbers set with the ProcessList= keyword. For example, on the first computer in the
cluster, Cube Voyager would be launched and placed into wait mode after setting the
Input Job File and the common working directory. Note that the common working
directory when using networked processing nodes must be mapped on all processing
nodes to the same physical location which is the working directory. If the processing
nodes are all nodes on a common multiprocessor machine then multiple instances of
Cube Voyager can be started and put into wait mode directly on the multiprocessor
machine and the working directory can simply be the model folder on the multiprocessor
machine. Note also that both these conditions can apply. A computer cluster for
distributed processing could be a mixture of a multiprocessor machine with several
processing nodes connected to additional single or multiprocessor machines across a
local area network. See “Utilities” on page 1181 for additional information on getting
multiple instances of Cube Voyager open and configured in wait mode.
When all the sub-processes are in wait mode, start the Cube Voyager run like a normal
run in the main computer.
Cube Cluster > Using Cube Cluster > Working with Cube Cluster > Multistep distributed processing (MDP)
Also, add the following statement in the CLUSTER script at the end of the distributed
script block:
EndDistributeMULTISTEP
This statement will invoke MDP in Pilot unless the global switch is off. Before running the
job in the main computer, the sub-process node participating in this MDP must be
started and in the wait mode with the correct file to wait for. See “Utilities” on page 1181
for additional information on getting multiple instances of Cube Voyager open and
configured in wait mode. The Pro cessID and the Pro cessNum number are used to make
up the name of the wait file. Pro cessID is the same as defined above for IDP. Pro cessNum
is a single process number since the steps are distributed to one process only.
When a block of operations is distributed to another processing node, the main
computer will continue running the script without waiting for the sub-process on this other
processing node to finish. It is the user’s responsibility to check for sub-process
completion before using output files generated by the sub-process. When a sub-
process is done, it will create a file named {ProcessID}{Process#}.script.end. Use the
W ait4Files command to wait for the .end file to be created in Pilot. For example:
Wait4Files Files=TestDist1.script.end, TestDist2.script.end,
TestDist3.script.end, CheckReturnCode=T,
UpdateVars=vname,Matrix.xname, PrintFiles=Merge, DelDistribFiles=T
The Files keyword specifies a list of all the files to wait for and the CheckReturnCo de
keyword specifies if the return codes from the sub-processes should be checked. When
true, the whole run will stop if a sub-process returns with a code 2 (fatal) or higher.
The UpdateVars keyword specifies a list of global variables computed in Pilot and logged
from individual programs that should be merged back from the sub-process run. Any
variables with the first part of the name matching an UpdateVars name will be merged
back. For example, for UpdateVars=vname,Matrix.xname, variable
vname1,vnameabc,Matrix.xnamevar etc. will all be merged back to the main process.
Care must be taken to merge back ONLY the variables that need to be returned to the
main process. Consider the following example:
ThisVar=1
DistributeMULTISTEP ProcessID='TestDist', ProcessNum=5
Run pgm=Matrix
...
EndRun
Run pgm=Network
...
EndRun
EndDistributeMULTISTEP
ThisVar=2
During execution, after the W ait4Files statement, the variable ThisVar will have the value
of 1. This is because the subprocess inherits a copy of all the global variables to start
with (ThisVar=1), so even though the subprocess never modifies the value of ThisVar,
the update process will change ThisVar back to 1. The setting of ThisVar to 2 in the
main process will be overwritten in this case.
The PrintFiles keyword controls the disposition of the print files from the sub-processes. It
can be “MERGE,” “MERGESAVE,” “DELETE,” or “SAVE.” MERGE means the print
files will be merged back into the main print file then deleted. MERGESAVE means to
merge the files but not delete them. DELETE means no merge but delete them and
SAVE means no merge but save them. The default is SAVE.
The DelDistribFiles keyword controls the disposition of the MDP temporary
communication files. The default is true, meaning to remove all temporary files.
Cube Cluster > Using Cube Cluster > Working with Cube Cluster > Multistep distributed processing (MDP) > Examples
Exam ples
Using both Intra and Multi Step Distribution with 12 processing nodes (main, GroupA 1-
4, GroupB 1-4, GroupC 2-4) to do AM, PM and Off-Peak assignments in parallel:
DistributeMULTISTEP ProcessID='GroupA', ProcessNum=1
; the following 2 steps will be distributed to sub-process GroupA1
Run pgm=Matrix
DistributeINTRASTEP ProcessID='GroupA',ProcessList=2-4
...
EndRun
Run pgm=Highway
DistributeINTRASTEP ProcessID='GroupA',ProcessList=2-4
...
EndRun
EndDistributeMULTISTEP
DistributeMULTISTEP ProcessID='GroupB', ProcessNum=1
; the following 2 steps will be distributed to sub-process GroupB1
Run pgm=Matrix
DistributeINTRASTEP ProcessID='GroupB',ProcessList=2-4
...
EndRun
Run pgm=Highway
DistributeINTRASTEP ProcessID='GroupB',ProcessList=2-4
...
EndRun
EndDistributeMULTISTEP
; run the following 2 steps while the sub-processes are running
Run pgm=Matrix
DistributeINTRASTEP ProcessID='GroupC',ProcessList=2-4
...
EndRun
Run pgm=Highway
DistributeINTRASTEP ProcessID='GroupC',ProcessList=2-4
...
EndRun
; wait for all the sub-processes to finish before continuing
Wait4Files Files=GroupA1.script.end, GroupB1.script.end,CheckReturnCode=T
Run pgm=Network
...
Cube Cluster > Using Cube Cluster > Working with Cube Cluster > Procedures that disable intrastep distributed processing
• Matrix program
m
FREQUENCY
m
RENUMBER
m
REPORT MARGINREC
m REPORT MARGINS
m
FILEI RECI
m
LOG
The following commands work in IDP mode but their behavior may be different in IDP:
• ABORT — The main process and any subprocess that encountered this command will abort
that process but other processes will continue to execute until the end. The main process
will then abort the run.
• EXIT— The main process and any subprocess that encountered this command will stop the
current ILOOP phase for that process but other processes will continue to execute until the
end of the ILOOP phase.
• ARRAY/SORT— Each process has its own arrays so the arrays will have to be filled in and sort
on each process.
• FIRSTZONE —
The first zone processed in the current processor. It will be 1 for a normal (non-
DP) run and will be the first zone to process in a DP run or a run with the SELECTI
keyword. For example, ‘IF (I=FirstZone)’ to perform initialization on the first zone
processed.
• LASTZONE — The last zone processed in the current processor. It will be “zones” in a normal
run and will the last zone to process in a DP run or a run with the SELECTI keyword. For
example, “IF (I=LastZone)” to perform finalization on the last zone processed.
• THISPROCESS — The current process number. It will be -1 for a normal run, 0 for the DP main
controller, and the process number in a DP sub-process. With this a script can tell if it is
running in non-DP mode (ThisProcess = -1), it is running as the main (ThisProcess = 0), or
it is running as a node (ThisProcess > 0).
Cube Cluster > Using Cube Cluster > Working with Cube Cluster > Using IDP for steps that summarize zonal values
This step can be restructured into two steps, one to get the summary for each Cluster
node and a second step to combine the multiple data records for each zone type into a
single record for each zone type:
; Cluster script
run pgm=matrix
DISTRIBUTEINTRASTEP PROCESSID='TESTDIST', PROCESSLIST=1-3
zdati=lu.dbf, z=zone ; has fields ZoneType and SFDU
; write to temp reco file, use more precision on SFDU field
reco=tlusum.dbf, fields=ZoneType(3.0),SFDU(13.5)
array SFbyType=9,SFOcc=9
zones=3000
if (i = FirstZone) ; can not use if (i=1)
SFOcc[1]=0.91 SFOcc[2]=0.92 SFOcc[3]=0.93
SFOcc[4]=0.94 SFOcc[5]=0.95 SFOcc[6]=0.96
SFOcc[7]=0.97 SFOcc[8]=0.98 SFOcc[9]=0.99
endif
SFbyType[zi.1.ZoneType]=SFbyType[zi.1.ZoneType]+zi.1.SFDU*SFOcc[zi.1.ZoneType]
if (i = LastZone)
loop zt=1,9
ro.ZoneType=zt
ro.SFDU=SFbyType[zt]
write reco=1
endloop
endif
endrun
Control statements
This section describes the control statements for Cube Cluster:
• DISTRIBUTE
• DISTRIBUTEMULTISTEP
• ENDDISTRIBUTEMULTISTEP
• WAIT4FILES
• DISTRIBUTEINTRASTEP
Cube Cluster > Control statements > DISTRIBUTE
DISTRIBUTE
The DISTRIBUTE statement globally controls the DP options to turn on/off intrastep or
multistep distribute processing. Keywords include:
• MU LT IS T E P
• IN T R A S T E P
D IS T R IB U T E k e y wo rd s
Ke y wo rd D e s c rip tio n
DISTRIBUTEMULTISTEP
Invoke multistep distributed processing. Keywords include:
• P R OCE S S ID
• P R OCE S S N U M
• COMMP A T H
D IS T R IB U T E MU LT IS T E P k e y wo rd s
Ke y wo rd D e s c rip tio n
ENDDISTRIBUTEMULTISTEP
Statement to end current MULTISTEP subprocess.
Cube Cluster > Control statements > WAIT4FILES
WAIT4FILES
When a block of operations is distributed to another computer, the main computer will
continue running the script without waiting for the sub-process to finish. It is the user’s
responsibility to check for sub-process completion before using output files generated by
the sub-process. When a sub-process is done, it will create a {ProcessID}
{Process#}.script.end file. Use the Wait4Files command in the Pilot program to wait for
the .end file to be created. Keywords include:
• FILE S
• CH E CKR E T U R N COD E
• D E LD IS T R IB FILE S
• P R IN T FILE S
• UPDAT EVARS
W A IT 4FILE S k e y wo rd s
Ke y wo rd D e s c rip tio n
FILES |S| Specifies a list of all the files to wait for. In addition to a
string constant, a Pilot string variable can be used to set
the file names by putting it within @ characters (for
example, Files=@MyFile@).
The variable can be a comma-separated list of files with
no spaces; for example:
MYFILES=’Node1.script.end,Node2.script.end’
Wait4Files Files=@MYFILES@,
CheckReturnCode=T, DelDistribFiles=T
PRINTFILES |S| Controls the disposition of the print files from the sub-
processes. It can be “MERGE,” “MERGESAVE,”
“DELETE,” or “SAVE.” MERGE means the print files will be
merged back into the main print file then deleted.
MERGESAVE means to merge the files but not delete
them. DELETE means no merge but delete them and
SAVE means no merge but save them. The default is
SAVE.
DISTRIBUTEINTRASTEP
Programs : Matrix, Highway
Invoke intrastep distributed processing. Currently only available in Matrix and Highway.
• COMMP A T H
• MIN GR OU P S IZE
• P R OCE S S ID
• P R OCE S S LIS T
• SAVEPRN
D IS T R IB U T E IN T R A S T E P k e y wo rd s
Ke y wo rd D e s c rip tio n
Utilities
This section describes:
• Cluster executable
• Utility functions
Cube Cluster > Utilities > Cluster executable
Cluster executable
You may use the cluster.exe utility program to start multiple processing nodes on the
local machine. In this section there is information on:
• Cluster Dialog Box
• In Time to Wait for Response, enter the number of seconds Cube Cluster should wait for a
response from a node before determining that the node is unavailable.
• Click List Nodes to return the status of all processing nodes within the chosen Work Directory.
• Click Start Nodes to start all listed processing nodes (remote or local). Or, click S ta rt S e le c te d to
only start the selected node(s).
• Click Close Nodes to close all listed processing node (remote or local). Or, click Clo s e S e le c te d
to only close the selected node(s).
• Check H id e N e w N o d e s to minimize cluster nodes to the system tray. The nodes will be
hidden after they are Started. This is the same as clicking Hide on the associated Voyager
instance. Hiding is useful when the user wishes to minimize window clutter. (For more, see
page 15).
Cube Cluster > Utilities > Cluster executable > Running Cluster from the Command Line
These command line options correspond to the Cluster dialog box shown above.
Cube Cluster > Utilities > Cluster executable > Starting processing nodes in Cube Cluster
Utility functions
A number of utility functions were added to the Cube Voyager system to allow more
flexibility in performing distributed processing:
• FilesExist('file1|file2|file3...') — This function will check for the existence of one or more
files. The function takes one string argument (constant or variable) and if there are more
than one file to check, they are put into one string and separated by '|'. The return value is
the number of files that exist. If none of the files exist, then the return value will be zero.
This can be use instead of the Wait4Files command if you only want to check if a node is
done but don’t want to wait for it to get done.
The following is an example for using the NumReadyNodes function when there are two
separate groups of Cube Cluster nodes that may be available to participate in a DP run,
the script wants to select the one with the most available nodes:
IF (NumReadyNodes(‘DP1’,’1-10’) > NumReadyNodes(‘DP2’,’11-20’))
MyProcessID=’DP1’
MyProcessList=’1-10’
ELSE
MyProcessID=’DP2’
MyProcessList=’11-20’
ENDIF
RUN PGM=Matrix
DistributeIntraStep ProcessID=@MyProcessID@, ProcessList=@MyProcessList@
Utilities > Shortest Path
Shortest Path
This section describes the Shortest Path calculation utilities included in Cube Voyager.
Topics include:
• Introduction
• Examples
Utilities > Shortest Path > Introduction
Introduction
If the user desires to run the path function a multiple number of times, the GUI-driven
shortest path build tool in Cube Base may not be a preferable method (see “Highway
path display” on page 265 of the Cube Base Reference Guide).
Therefore, a Cube Voyager program has been developed to run the path function
directly. With this, the user can input the following parameters directly in the script:
1. Cost Specification
4. Include expressions
6. Turn Penalty
7. Turn Volume
With the help of this Voyager program, the user can save the files in two formats, i.e.
.DBF and .TXT.
Utilities > Shortest Path > Keywords and Usage
• — This option also allows the user to specify the number of times the
MA XCOS T IN CR E A S E
maximum path is allowed to increase in order to meet a minimum number of paths.
Utilities > Shortest Path > Keywords and Usage > Path Limit Options > Behavior of Path Limit Options
• Origin 1 has paths to destination 5, 6, 7, 8, 9, 10 with costs of 15, 16, 17, 18, 19, 20
respectively
• Origin 2 has paths to destination 5, 6, 7, 8 , 9, 10 with costs of 25, 26, 27, 28, 29, 30
respectively
• Origin 3 has paths to destination 5, 6, 7, 8, 9, 10 with costs of 55, 66, 71, 81, 91, 99
respectively
• Origin 4 has paths to destination 5, 6, 7, 8, 9, 10 with costs of 55, 66, 87, 88, 98, 99
respectively
• Parameters
m
Maximum Path Cost = 28, Minimum Paths = 3, Maximum Paths = 5, Number of times to
increase the maximum path cost to get minimum number = 2
Results:
• Origin 2 outputs paths to 5, 6, 7, 8 (reached the maximum cost and the number of paths is
above the minimum paths).
• Origin 3 outputs paths to 5, 6 ,7. Since no path is below the maximum cost, the maximum
cost is increased 1 time from 28 to 56 that results in 1 path (5), so the maximum cost is
increased a second time from 56 to 84 that results in getting 4 paths (5, 6, 7, 8) but only 3
paths are displayed that have lowest cost.
• Origin 4 outputs paths to 5, 6. Since no path is below the maximum cost, the maximum cost
is increased 1 time from 28 to 56 that results in 1 path (5), so the maximum cost is
increased a second time from 56 to 84 that results in getting 2 paths (5, 6). Even though it
is still less than the number of minimum paths, it has reached the limit of number of times to
increase the maximum cost allowed so it cannot increase the maximum cost anymore.
One practical example of using the path limit option is to find PT access points from a
zone. For example, the objective is to identify all the PT stop nodes within 0.28 miles
with a maximum of 5 stops from each origin. If the function identifies the number of PT
stops as less than 3 within 0.28 miles, the function will then search within 0.56 miles, and
subsequently 0.84 miles until it gets the minimum of 3 PT stops.
Utilities > Shortest Path > Keywords and Usage > Saving Output Files
• — For the output files as .DBF, the fields ORG, DST, NODE, COST1
D a ta b a s e (.D B F) file s
and COST2 will be included. The COST2 field will always be available in the .DBF format,
even when no additional trace is specified. Note that when appending to a .DBF file, the
existing file must have the fields listed above already in it (or basically, it should be a file
that was created previously by the same path save function).
In your script, you may specify the PRINTM ODE=SUM M ARY command. Cube will print only
the last line (destination line) in the output print file instead of the whole path. This
provides the path cost information for each path without detailed data on each node
used on the path. The path-building process will be significantly faster, producing a
much smaller print file. See “Example 2 — use of SUMMARY parameter” on page 1193.
NOTE: Path-building speed is maximized with SUM M ARY enabled, and without the
additonal trace value (AddTrace ). The summary option is also the only way to build node-
to-node paths, which overcomes the 32,000 zone limit and allows building paths a
maximum cost or distance from the origin.
As the user runs the script, the results of the program run will be either appended or
overwritten depending upon the user requirements. In this way, the user can get the
outputs for the different sets of origins and destinations in the same output file and obtain
the past cost trace information for each origin and destination selected by the user.
Utilities > Shortest Path > Examples
Examples
Examples include:
• Voyager Script
Voyager Script
The path building may be invoked within a Voyager script with:
RUN PGM=CUBE
[CtrlFile=commandfile] Parameters='/Command /CloseWhenDone /Minimize /NoSplash'
If a CtrlFile is not specified, control commands can be placed between the RUN and
ENDRUN statement of the script. The commands will be copied to a temporary file first
and passed to Cube as the first parameter.
There must be only one CtrlFile , itself a script. The Command File can have blank lines
or comment lines (;) in it. Each statement must be within a FUNCTION and
ENDFUNCTION (or ENDPROCESS) statement. It is designed to work like Voyager
script, but no COMPUTE, IF and LOOP type statements are allowed. Multiple
FUNCTION/ENDFUNCTION blocks can be used in the Command File and they will be
executed by Cube one at a time.
An example Command File for shortest path build function is below. Note that the
BUILDPATH function option is required to enable the path building mode.
Utilities > Shortest Path > Examples > Voyager Script > Example 1 — Multiple destination fields from a single origin
;optional parameters:
fileformat=dbf ; dbf or txt, default to txt
filemode=append ; append or overwrite, default to overwrite
LinkSelection="SPDCLASS < 50" ; use of expression
AddTrace="LINKGRP1" ; use of expression
MaxPathCost=13
MinPathPerOrigin=4
MaxPathPerOrigin=6
MaxCostIncrease=2
turnpeni="C:\...\path.pen" ; the turn penalty file
turnvoli="C:\...\turnvol.dbf" ; the turn volume file
UsePenSets=4 ; default to 1 if turnpeni specified, otherwise it is ignored
UseTurnVols=true ; default to true if turnvoli specified, otherwise ignored
; each Destination keyword below will build a set of paths and save to
; output file
Origin="District=5"
Destination="District=1"
Origin="13" Destination="11"
Destination="12" ; use of multiple destination fields from a single origin
close
endfunction
Utilities > Shortest Path > Examples > Voyager Script > Example 2 — use of SUMMARY parameter
Consequently, to invoke the path-building function from a script file (*.S) or a text file
(*.txt), the following syntax may be used:
*"C:\program files (x86)\Citilabs\Cube\Cube.exe" commandfile /Command
[/CloseWhenDone] [/Minimize] [/NoSplash]
If Cube is in the system path, then just "*Cube.exe ..." should work without specifying the
full path to Cube.exe. The following two approaches may be used to invoke the shortest
path build function. The user needs to have the control file as (*.S), (.txt) or any ASCII
file format. Then, run the respective command in Cube.
• *"C:\Program Files (x86)\Citilabs\CubeVoyager\Voyager.exe" "C:\...\Pathbuildtest.S" /Start
OR
• *"Cube.exe" C:\...\Pathbuildtest.txt /Command /CloseWhenDone /Minimize /NoSplash
function=BUILDPATH
; required parameters:
neti="C:\...\UNLOADED.NET"
pathprinto="C:\...\pathlist1.dbf"
CostSpec="Distance"; expression
; optional parameters:
fileformat=dbf ; dbf or txt, default to txt
filemode=append ; append or overwrite, default to overwrite
LinkSelection="Distance > 0" ; expression
AddTrace="LINKGRP1" ; expression
MaxPathCost=13
MinPathPerOrigin=4
MaxPathPerOrigin=6
MaxCostIncrease=2
turnpeni="C:\...\path.pen"
turnvoli="C:\...\turnvol.dbf"
UsePenSets=4 ; default to 1 if turnpeni specified, otherwise ignored
;UseTurnVols=true ; default to true if turnvoli specified, otherwise ignored
; each Destination keyword below will build a set of paths and save to output file
Origin="District=1"
Destination="District=1000"
Origin="2" Destination="1000"
;Destination="12"
close
endfunction
Utilities > Link Consolidation
Link Consolidation
This section describes the Link Consolidation function available by invoking Cube.exe
from a Voyager script.
Sections include:
• Introduction
• Example
Utilities > Link Consolidation > Introduction
Introduction
The Cube.exe Link Consolidation function works the same as the tool in Network
Window (see “Link consolidation” on page 507 of the Cube Base Reference Guide).
This consolidation function may be called by invoking Cube.exe from a Voyager script.
The Function will consolidate a series of links with same characteristics, and no cross
streets, into a single link. When the network is displayed in true shape mode (connected
to a shapefile by means of a VPR file), consolidating the links will also update the
shapefile to maintain the true shape display linkage.
Utilities > Link Consolidation > Keywords and Usage
• FU N CT ION LIN KCON S OLID A T E function option is required to enable the link consolidation
mode.
• T URNPENI — filename of the input turn penalties (*.PEN) associated with the network, if
applicable.
• T URNPENO — filename of the output turn penalties (*.PEN), updated to reflect the new
connecting nodes. Optional.
• Each link attribute (field) of the input network may be associated with a mode to specify
what value goes into the consolidated link. The consolidation mode keywords below define
the type of consolidation for each link attribute.
• D E FA U LT T XT MOD E — the default consolidation mode for text attributes, when unspecified
(see list above)
Utilities > Link Consolidation > Example
Example
In this script, an input binary network is consolidated with a true shape linkage.
• Examples
Utilities > Build Network from Feature Class > Introduction
Introduction
The Cube.exe Build Network from Feature Class function works similarly to the tool in
Data Manager (see “Build network from shape file” on page 171 of the FCube Base
Reference Guide). Cube performs this function when called from a Voyager script.
The command-mode tool will generate a Cube network from the line information in a GIS
shapefile (.SHP) and its associated data. The output network is a binary network
(.NET). The tool does not currently support reading and outputting geodatabases.
Utilities > Build Network from Feature Class > Keywords and Usage
The optional CtrlFile is itself a Voyager script, and lists the Voyager commands required
for the network building. If a CtrlFile is not used, control commands can be placed
between the RUN and ENDRUN statement in the script. They will be copied to a temp
file and passed to Cube as the first parameter.
The CtrlFile can have blank lines or comment lines (;). Each function must be within a
FUNCTION and ENDFUNCTION (or ENDPROCESS) statement. It is designed to work
like TP+ script but no Compute, If, Loop-type statements are allowed.
Below are the commands for supporting the Build Network function.
• — this command must follow RUN PGM, or be the first
FU N CT ION S H A P E 2N E T W OR K
command in the CtrlFile. This is required to enable the build network from shape mode.
• With the P A R A ME T E R S keyword, or at the Windows command line, you may specify:
m
/ c o mma nd puts Cube in command mode and is required.
m
/ Clo s e W he nD o ne , / Minimize , and / N o S p la s h are optional, but recommended when running
from Voyager.
Keywords for Build Network are listed below. (You may also skip ahead to an
Examples).
• SHPI — The path and name of the input line shapefile (SHP). Two SHPIs may be optionally
specified, one containing points, and the other lines.
• — Optional input binary network (.NET). When specified, nodes from NETI will be
NET I
used. Otherwise, if there is a point shape file (SHPI), then it will be used with the node
number field specified in POINTNODENUMFIELD (see below).
• — Field in the point file containing node numbers. Required if you specify a
P OIN T N OD E N U MFIE LD
point file. Optional; no default value.
• — Specify T to join the point shapes and line shapes together using the ID,
J OIN LIN KN OD E
FROM_ID, and TO_ID fields. This option is useful when the ID fields do not contain node
numbers, such as shape files exported from TransCAD software. Default is F.
When selected and the line shape has a zero-value A-node, Cube Base searches
the point file for the record where the point file’s ID field matches the line file’s
FROM_ID, and uses that record’s node number. Similarly if the line shape has a
zero-value B-node, Cube Base searches the point file for the record where the point
file’s ID field matches the TO_ID, and uses that record’s node number. If Cube Base
finds no matching ID field in the point file, then Cube Base searches for nodes by
location.
If selected, do not set ANODEFIELD to FROM_ID and do not set BNODEFIELD to TO_ID.
NOTE: This property is available only if you specify a point file, the point file contains
an ID field, and the line file contains both FROM_ID and TO_ID fields.
• NET O— The path and name of the output network to be created. The destination will be a
standalone binary network (.NET).
NOTE: The build network tool only uses the node data for determining the node
numbers. It does not import node attributes into the output network.
• — Field in the line file that contains the A-node. Default values are A, ANODE
A N OD E FIE LD
and FROM_ID in that precedence.
If you specify a field other than A, Cube Base renames that field A in the output
network. If a field named A already exists, Cube Base renames that field A0 in the
output file. (In this case, if A0 exists, Cube Base renames that field A1, and so on.)
If the specified field contains a nonzero number, Cube Base assigns that number to
the node. If the field contains a zero and you do not specify a point file, Cube Base
automatically assigns a sequential number to the node.
• — works like ANODEFIELD described above. Default values are B, BNODE
B N OD E FIE LD
and TO_ID in that precedence.
• LE V E LFIE LD — Integer field that contains the shape level. Optional; no default value.
If specified, Cube Base only connects shapes that have the same level unless
specific connection criteria are met. Cube Base can accommodate levels between 0
and 254.
Use this field if the shapefile defines multiple shapes (not all connected to a single
node) at all intersections between shapes—for example, if the shapefile breaks two
intersecting lines into four lines.
Cube Base ensures that each trip entering an intersection can exit. Each level
containing an inbound link must contain an outbound link, and each level containing
an outbound link must contain an inbound link. Furthermore, the reverse link of a two-
way link does not count as a matching inbound or outbound link to itself. If necessary,
Cube Base connects shapes at different levels, provided there are four or more
shapes connected at a single point.
• — T or F. Select True to clear all values in the A-node and B-node fields
CLE A R A B V A LU E S
within the input line file. (See A N OD E FIE LD and B N OD E FIE LD ). Cube Base either finds node
numbers in the point file, if specified, or within the shape data. Otherwise, it automatically
assigns sequential numbers.
Cube will save the updated version of the input line file, along with the output network.
Default is F.
• D IR E CT ION OP T ION— the direction of output links. Use 1 for All one-way, 2 for All two-way,
and 3 for D IR E CT ION FIE LD below. Default is 1.
• D IR E CT ION FIE LD — the direction indicator field name if D IR E CT ION OP T ION (above) is 3.
The value of DIRECTIONFIELD for each input link determines how Cube Base
processes it when building the network:
m
If value is 1, the output link is one-way in the indicated direction (A to B).
m
If value is -1, the output will be a one-way link in the opposite direction (A to B order
reversed).
m
If value is 2, the output will be two-way; ie, two one-way links are written with opposing
directions.
• The output will also be two-way when the value is 0, and ZE R OA S 2W A Y (see below) is
set to T.
Cube Base renames this field to REV in the output file. If a field named REV already
exists, Cube renames that field REV0 in the output file. (Likewise, if REV0 also exists,
Cube renames that field to REV1, and so on.)
• ZE R OA S 2W A Y — Set to T to process shapes with a value of 0 in the indicator field
(D IR E CT ION FIE LD ) as two-way links. Default is F.
• — Starting number that Cube Base uses when adding new nodes. Must
S T A R T IN GN E W N OD E
be greater than the highest node number in the input file. Default value is 100 greater.
Utilities > Build Network from Feature Class > Examples
Examples
Example 1
In this standalone script (without command file), network shp2net.net is generated from
input shape file shp2net.shp.
RUN PGM=CUBE Parameters='/Command /CloseWhenDone /Minimize /NoSplash'
function=SHAPE2NETWORK
shpi="p:\dtown\shp2net.shp"
neto="p:\dtown\shp2net.net"
AnodeField=A
BnodeField=B
LevelField=""
ClearABValues=T
DirectionOption=1
DirectionField=""
AddDistanceField=Y
DistanceScale=2.22
NodeGroupingLimit=1
StartingNewNode=1000
HighestZone=30
endfunction
Utilities > Build Network from Feature Class > Examples > Example 2
Example 2
Node data from network or point shape layer can be used in the batch
SHAPE2NETWORK process. If there is a NETI then its nodes will be used, else if there
is a point shape file, then it will be used with the node number field specified in
PointNodeNumField.
RUN PGM=CUBE Parameters='/Command /CloseWhenDone /Minimize /NoSplash'
function=SHAPE2NETWORK
neti="p:\dtown\base.net"
shpi="p:\dtown\shp2net.shp"
neto="p:\dtown\shp2net.net"
AnodeField=A
etc...
endfunction
Utilities > Build Network from Feature Class > Examples > Example 3
Example 3
function=SHAPE2NETWORK
shpi="p:\dtown\nodes.shp" ; point shape
shpi="p:\dtown\shp2net.shp" ; line shape
neto="p:\dtown\shp2net.net"
PointNodeNumField="NODENUM"
AnodeField=A
etc...
endfunction
Utilities > UB2TPP
UB2TPP
Utility program UB2TPP can be used to convert FTA New Start User Benefit matrix files in
SUMMIT binary format to standard TP+/Cube Voyager format.
The following control statements are available in the Cube Voyager UB2TPP utility
program.
S ta te me nt D e s c rip tio n
FILEI
Inputs data file.
MATI
Ke y wo rd D e s c rip tio n
FILEO
Outputs data files.
MATO VARO
Ke y wo rd D e s c rip tio n
PARAMETERS
Sets general parameters.
HEADERONLY
Ke y wo rd D e s c rip tio n
TPP2UB
Use the TPP2UB utility program to convert standard binary TP+/Cube Voyager format
matrices to FTA New Start User Benefit matrix files in SUMMIT binary format.
The following control statements are available in the Cube Voyager TPP2UB utility
program.
FILEI
Inputs data files.
MATI VARI
Ke y wo rd D e s c rip tio n
FILEO
Outputs data files.
MATO
Ke y wo rd D e s c rip tio n
PARAMETERS
Set general parameters. The program must have values for all PARAMETERS. They
may be coded directly with the PARAMETERS statement, they may be read in on the
VARI file which was the result of a VARO file from UB2TPP or they may be read in on a
VARI file that is hand coded.
TRNCOEF
AUTOCOEF
PURPOSE
TOD
ALTNAME
P A R A ME T E R S k e y wo rd s
Ke y wo rd D e s c rip tio n
SYNCHIMP
Use the SYNCHMP utility program to convert SYNCHRO data to Cube Voyager
intersection data format.
NOTE: Cube has a SYNCHRO data import wizard accessible from the File > Tools menu.
The following control statements are available in the Cube Voyager SYNCHMP utility
program.
FILEI
Inputs data files.
LAYOUTI
LANESI
PHASINGI
TIMINGI
VOLUMEI
FILE I k e y wo rd s
Ke y wo rd D e s c rip tio n
FILEO
Outputs data files.
NODEO
LINKO
JUNCDATAO
Ke y wo rd D e s c rip tio n
PARAMETERS
Sets general parameters. The values of these parameters are stored in the associated
SYNCHRO input CSV data files.
PLANID
VOLDATE
VOLTIME
UNITS
P A R A ME T E R S k e y wo rd s
Ke y wo rd D e s c rip tio n
Saturn conversion
The SaturnPath utility program converts output from the Saturn assignment program into
a Cube Voyager path file.
The Cube installation program installs this program in the Cube directory (C:\Program
Files\Citilabs\Cube\SaturnPath.exe in standard installations). You can access this
program through Windows Explorer, the Command line or a batch file.
This section discusses:
• Running from program window
• Output Voyager Path File — Enter the new file you want to create containing a Cube Voyager path
file
• — Click to run the utility and convert the specified input into a Cube Voyager-
Convert
formatted path file and write the results to the specified output file.
If you specify all three parameters (setting the start flag to “GO”), the program
automatically starts converting the input file. If there are no errors during the conversion,
the program automatically writes the output file. If the specified output file does not exist,
the program will close automatically, too; otherwise, the program will prompt to overwrite
the file.
If you do not specify all three parameters, the program window will open, with fields
showing any parameter values that you did specify.
Frequently Asked Questions > Pilot and general syntax
2. How do I generate unique link ID strings using numeric values from A and B nodes?
Frequently Asked Questions > Pilot and general syntax > How do I do token replacement?
RUN PGM=NETWORK
FILEI NETI=@INHWYNET@
FILEO NETO=@OUTHWYNET@
ENDRUN
RUN PGM=HWYLOAD
FILEI NETI=@OUTHWYNET@
.....
ENDRUN
We can put all the substitution at the beginning of the file and change them there before
running the script. Alternatively, we can put the substitution strings in a separate file and
use the READ statement (Chapter 3, “General Syntax”) to insert it at run time:
READ FILE=sub.txt
RUN PGM=HWYNET
FILEI NETI=@INHWYNET@
.....
Frequently Asked Questions > Pilot and general syntax > How do I generate unique link ID strings using numeric values from
A and B nodes?
; Return the position in str2 where str begins. If str does not exist in
; str2, the value is 0. Both strings are case sensitive.
; Note: str is either a character constant '...', or a character variable
STRPOS(str,str2)
; The following statement will generate a unique link ID string for each
; link:
LINK_ID= LTRIM(STR(LI.1.A, 5, 0)) + '_' + LTRIM(STR(LI.1.B, 5, 0))
Frequently Asked Questions > Fratar
Fratar
1. How do I specify SETPA with both target values and growth factors for the same purpose?
Frequently Asked Questions > Fratar > How do I specify SETPA with both target values and growth factors for the same
purpose?
Highway
1. What does V1_1 represent in a loaded network?
3. Can Highway summarize calculated ratios such as summing volume/count ratios by lanes,
speed class, or rmse by volume group?
Frequently Asked Questions > Highway > What does V1_1 represent in a loaded network?
; Create a temporary network with only links that have a valid direction
; code. Assume dircode is an attribute in the link database and contains
; direction codes from 1 to maxcode
run pgm=network
neti=@inputnet@
neto=temp.net
if (dircode <= 0 || dircode > @maxcode@) delete
endrun
run pgm=hwyload
neti=temp.net
array FuncUsed=@maxcode@@maxcode@; dimension the array to cover all from-
; to direction code(@maxcode@x@maxcode@)
phase=linkread
phase=iloop
; Use the copy command to combine the function and penalty records into
; one file. If penalty functions are already defined in a file, that file
; can be combined with the generated penalty records to make a complete
; penalty file for loading.
Generation
1. Why do I get an incorrect result when using PTOT and ATOT in the Adjust Phase of
GENERATION to balance P and A?
Then ATOT(2) will be recalculated for each zone. A[2][1] will be adjusted correctly. But
for zone 2 and on, ATOT(2) is no longer the sum of original A[2][i]. Therefore the ratio of
PTOT(2)/ATOT(2) is not a constant. The correct way to specify a balance equation with
PTOT and ATOT is:
TEMPFAC=PTOT(2)/ATOT(2)
A[2]=TEMPFAC*A[2]
It is recommended that "Phase=Iloop" not be used; instead, let the program determine
where the Iloop phase should start.
Frequently Asked Questions > Network
Network
1. How do I re-compute link distances in Voyager?
3. How can I search for the closest node to an intersection record, and transfer information
from that intersection to the node record?
(This question is listed as a M atrix topic).
4. How are speed and capacity tables handled in Cube Voyager?
8. How can I remove invisible links that have no coordinates from a network?
10. Is there a way to output two-way link records from a network to text or DBF file?
14. Can Network read TRANPLAN networks in binary (UNIX) and ASCII formats?
17. How do I use Network to compare Volumes and VMT's on two networks and report the
frequency of percentage differences?
19. How do I merge a zonal data file into the node portion of a Voyager network?
phase=input filei=ni.1
if (renum(n)<>0) n=renum(n)
endphase
phase=input filei=li.1
if (renum(a)<>0) a=renum(a)
if (renum(b)<>0) b=renum(b)
endphase
endrun
Frequently Asked Questions > Network > How are speed and capacity tables handled in Cube Voyager?
The REPORT statement will generate a report on the speed and capacity table. If you
want to obtain the actual speed and capacity value for a link you can use the
SPEEDFOR(lanes,spdclass) and CAPACITYFOR(lanes,capclass) functions in
Netwo rk to obtain them.
Frequently Asked Questions > Network > How can I include coordinates in link records?
phase=input, filei=li.2
_temp=a
a=b
b=_temp
endphase
phase=linkmerge
totv=li.1.v_1+li.2.v_1
endphase
endrun
Frequently Asked Questions > Network > How can I compute a new node attribute using coordinates?
PHASE=LINKMERGE
; link processing statements
ENDPHASE
Frequently Asked Questions > Network > How can I remove invisible links that have no coordinates from a network?
This assumes TIME_1 is the congested time. If you do an assignment using a loaded
network as input, the new volume, time etc. will be sub-fixed with 2 and 3 etc. (such as
TIME_2, V_2). Also, please pay attention to the units of the variables involved. The
above equation assumes DISTANCE and TIME_1 are in miles and minutes, and the
resulting SPEED is in mph.
Frequently Asked Questions > Network > Is there a way to output two-way link records from a network to text or DBF file?
PHASE=LINKMERGE
COMPARE RECORD=1-2 ; compare link record 1 with 2
IF (_COMPARE = 0) ; if same
IF (A < B) ; if low to high, write out 2-way link
REVERSE=2
ELSE
DELETE ; delete high to low side of 2-way link
ENDIF
ELSE
REVERSE = 1 ; if not same write as 1 way
ENDIF
ENDRUN
; This step will build the network back from the DBF files
RUN PGM=HWYNET
LINKI=TESTLINK.DBF, RENAME=REVERSE-REV ; set the REV attributes
NODEI=TESTXY.DBF
NETO=TEST2.NET
ENDRUN
Frequently Asked Questions > Network > Why is the footer plotted different from my specification?
Netwo rkwill treat BASE as one field, YEAR as another field etc. It also sees the "-" in I-84
and assumes that it is a range but it doesn't know what “I” is. Anytime you want to
specify a string of characters with imbedded spaces or other special characters, you will
need to enclose them within " ". So changing the statement to:
FOOTER="BASE YEAR 1997 NETWORK",
" TREASURE VALLEY I-84 CORRIDOR STUDY"
FILEI LINKI={filename},VAR=A,1-5,B,6-10,ASGNGRP,11-11,DISTANCE,12-15,
SPEED1,17-20,SPEED2,21-24,DIRCODE,25-26,LINKGRP1,27-28,
LINKGRP2,29-30,LINKGRP3,31-32,CAPACITY,33-38,VOLUME,39-44,REV,45-45,
SELECT=(SUBSTR(RECORD,1,1)!='N'),
NODEI={filename},VAR=N,2-6,X,9-17,Y,20-28, SELECT=(SUBSTR(RECORD,1,1)=='N')
FILEO NETO={filename}
ZONES={max zones}
IF (SPEED1 > 0) TIME1=DISTANCE/SPEED1*60
IF (SPEED2 > 0) TIME2=DISTANCE/SPEED2*60
ENDRUN
Frequently Asked Questions > Network > Is there a sample setup for calculating two-way volume?
NETI=LOAD.NET, LOAD.NET
NETO=LOD1.NET
MERGE RECORD=F ; DO NOT MERGE RECORDS
; Index # of ways
IF (LI.2.A=0)
NUMWAYS=1 ; Oneway
ELSE
NUMWAYS=3 ; Twoway
ENDIF
ENDRUN
You can also use Cube to compute the 2-way volume by adding a new link attribute
(e.g. TOTV) and compute with the following equation for all links. (See the Network
Window chapter in the Cube Base Reference Guide).
TOTV=V_1 + V_1.R
Frequently Asked Questions > Network > How do I compute a new attribute indicating one-way links in Voyager?
phase=input, filei=li.2
_temp=a
a=b
b=_temp
endphase
phase=linkmerge
if (li.2.a == 0) ONEWAY=1
endphase
endrun
Frequently Asked Questions > Network > How do I use Network to compare Volumes and VMT's on two networks and report
the frequency of percentage differences?
; Comparison of VMT
BASE_VMT=L1.V_1*L1.DISTANCE
SUBJ_VMT=L2.V_1*L2.DISTANCE
VMT_DIFF=SUBJ_VMT-BASE_VMT
ENDRUN
Frequently Asked Questions > Network > Is there a function in Voyager to merge networks based on a condition?
phase=linkmerge
if (li.1.link_attribute=0)
; link_attribute=li.1.link_attribute
linkclass=li.1.linkclass
capacity=li.1.capacity ; should list all link attributes
:
:
else
linkclass=li.2.linkclass
capacity=li.2.capacity
:
:
endif
endphase
endrun
Frequently Asked Questions > Network > How do I merge a zonal data file into the node portion of a Voyager network?
neti=dtown.net
nodei[2]=zonedata.txt,
var=n, beg=1, len=5, ; name the zone field 'N'
var=sfdu, beg=6, len=12,
var=mfdu, beg=13, len=21
neto=dtown_zdat.net
endrun
If the file is a DBF, then rename ZONE to N using the RENAME sub-keyword. For
example:
neti=dtown.net
nodei[2]=zonedata.dbf, rename=zone-n ; rename the zone
; field to 'N'
neto=dtown_zdat.net
endrun
Frequently Asked Questions > Network > How do I flag or delete unconnected nodes globally?
run pgm=network
neti=simple.net
nodei[2]=used_n.dat, var=n
neto=new.net
merge record=f
phase=nodemerge
; if (n2.n==0) UNUSED=1 ; to flag unused nodes only
if (n2.n==0) delete ; delete unused nodes
endrun
Frequently Asked Questions > Matrix & Distribution
2. How can I convert a Voyager matrix to ASCII format without any zero-value cells skipped in
the output file?
Finally, use Netwo rk to merge the street name info back into the network.
run pgm=network
neti=a.net
nodei[2]=node.dat, var=n, beg=1, len=5, var=name, beg=7, len=30, typ=a
neto=a2.net
endrun
Frequently Asked Questions > Matrix & Distribution > How can I convert a Voyager matrix to ASCII format without any zero-
value cells skipped in the output file?
Example 1
; Will have to remove the first two columns to get a true
; matrix
run pgm=matrix
mati=input.mat ; a Voyager matrix with series of zeros
mato=mat.txt mo=1 dec=0 pattern=ij:v fields=4,4,6 maxfields=20
zones=20
mw[1]=mi.1.1
jloop
if (mw[1][j]=0) mw[1][j]=0.0001
endjloop
endrun
Frequently Asked Questions > Matrix & Distribution > How can I convert a Voyager matrix to ASCII format without any zero-
value cells skipped in the output file? > Example 2
Example 2
run pgm=matrix
mati=testmat
jloop
list='\\',mi.1.1[j](6),file=testfile
endjloop
list='\n',file=testfile
endrun
Frequently Asked Questions > Matrix & Distribution > How do I do non-50/50 balancing of PA matrices?
We assume that there are 100 trips produced in zone 1 and attracted to zone 2; and
200 trips produced in zone 2 and attracted to zone 1. The above equation will end up
with 150 trips going from zone 1 to zone 2 : (100 + 200) * 0.5 = 150. The equation will
also yield the same result from zone 2 to zone 1: (200 + 100) * 0.5 = 150.
The above equation can also be expressed as:
MW[1] = (MI.1.1 * 0.5) + (MI.1.1.T * 0.5)
To do non-50/50 balancing, we can vary the two factors but keep the total to 1.0 (100%,
unless we also want to factor the total up or down). Changing the first factor to 0.9 and
the second factor to 0.1 will yield a 90/10 split with 90% going from the production end to
the attraction end:
MW[1] = (MI.1.1 * 0.9) + (MI.1.1.T * 0.1)
This resembles an AM Peak condition, with most people going from their home
(production zone) to their jobs (attraction zone).
Frequently Asked Questions > Matrix & Distribution > How do I split a zone into four sub-zones?
zones=945
if (z<743)
list=z(5),z(5),file=zone_eq.txt
elseif (z=743)
list= ' 743 743 10 \n',
' 743 946 20 \n',
' 743 947 30 \n',
' 743 948 40',
file=zone_eq.txt
else
list=z(5),z(5),file=zone_eq.txt
endif
endrun
run pgm=matrix
mati=input.mat
mato=output.mat mo=1
mw[1]=mi.1.1
; renumber zones according to "zone_eq.txt"
renumber file=zone_eq.txt
endrun
Frequently Asked Questions > Matrix & Distribution > What do the statistics in a FREQUENCY report mean?
TrnBuild
1. How does TrnBuild calculate fares?
3. Why is the total number of trips reported by the TrnBuild module less than the input trip
matrix total?
Frequently Asked Questions > TrnBuild > How does TrnBuild calculate fares?
Introduction
This chapter introduces you to Cube Voyager. Topics include:
• Design concepts
• Program features
Getting Started
This chapter describes how to get started using Cube Voyager. Topics include:
• Installation
Cube Cluster
This chapter discusses Cube Cluster, an optional extension you can use with Cube
Voyager. Topics include:
• Using Cube Cluster
• Control statements
• Utilities
General Syntax
General Syntax
This chapter describes the general syntax found in Cube Voyager. Topics include:
• Introduction to Cube Voyager control statements
Pilot Program
This chapter describes the Pilot program, the basic driver for Cube Voyager application
programs. Topics include:
• Using Pilot program
• Control statements
• Fratar
• Highway
• Generation
• Network
• TrnBuild
Fratar
Fratar
This chapter discusses Fratar distribution, a process for modifying a matrix values.
Topics include:
• Using Fratar
• Control statements
Highway Program
This chapter discusses the Highway program. Topics include:
• Using the Highway program
• Phases
• Control statements
• Theory
The junction file is part of the Highway program. For information about the junction file,
see Chapter 7, “Intersection Modeling.”
Intersection Modeling
Intersection Modeling
This chapter discusses intersection modeling, part of the Cube Voyager Highway
program. Cube 6.4 version supports HCM 2010 methods for modeling of All-Way stop
controlled, Two-Way stop controlled and Roundabout intersections.
Topics include:
• Introduction to intersection modeling
• Control statements
• Common keywords
• Signal-controlled intersections
• All-way-stop-controlled intersections
• Roundabouts
• Priority junctions
Highway Program : Phases
Highway Program : Control statements : FILEO
Highway Program : Control statements : FILEO : QUEUEDATA Example
Highway Program : Control statements : PARAMETERS : TRACESUMMARY Example
Highway Program : Control statements : PARAMETERS : TRACESUMMARY Example
Highway Program : Control statements : PATHLOAD
Highway Program : Control statements : PATHLOAD
Intersection Modeling : Introduction to intersection modeling : Methodology for U-Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for U-Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for U-Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Intersection Modeling : Introduction to intersection modeling : Methodology for Free Right Turns at Signalized Intersections
Network Program
Network Program
This chapter discusses the Network program. Topics include:
• Introduction to the Network program
• Control statements
• Theory
Matrix Program
This chapter describes the Matrix program. Topics include:
• Using the Matrix program
• Control statements
Distribution Program
This chapter discusses the trip distribution process. Topics include:
• Introduction to the Distribution program
• Control statements
Generation Program
This chapter discusses the Generation program. Topics include:
• Introduction to Generation program
• Control statements
• Processes
• Phases
• Control statements
• Reports
• Theory
• Examples
• Troubleshooting
Public Transport Program : Control statements : CROWDMODEL : Example 2
Public Transport Program : Theory : Network simplification : Line-line legs
Public Transport Program : Theory : Crowding : Crowding process
Public Transport Program : Theory : Crowding : Crowding process
Public Transport Program : Examples : Public transport crowding
TRNBUILD Program
TRNBUILD Program
This chapter discusses the TRNBUILD program. Imported from TP+, TRNBUILD is an
alternative to the Public Transport program for modeling public transit. Topics in this
chapter include:
• Using TRNBUILD in Cube Voyager
• Introduction to TRNBUILD
• Control statements
Cube Avenue
This chapter discusses Cube Avenue, an optional extension to Cube Voyager. Topics
include:
• Using Cube Avenue
• Control statements
• Theory
• Examples
Utilities
Utilities
This chapter describes the utility programs included with Cube Voyager. Topics include:
• Shortest Path
• Link Consolidation
• UB2TPP
• TPP2UB
• SYNCHIMP
• Saturn conversion