Generating a matrix with zero values

1.  In the Matrices window, on the toolbar, click the  Create matrices icon.

The Create matrices window opens.

Tips: Alternatively, in the Matrices window, you can right-click in the navigator and select Create matrices from the shortcut menu or select Create from menu Edit > Matrices. The symbol and the shortcut menu entry are both provided in the Matrices list (Opening a list).

2.  Select the Matrix attributes tab.

Note: The tab is only relevant if you have selected the option Insert a fixed number of matrices.

Element

Description

Number

Freely selectable matrix number, with multiple matrices the numbers are incremented from next available number upwards

Code

Short name of the matrix

Name

Long name of the matrix

Matrix type

Type of Visum matrices

  • Demand matrix
  • Skim matrix

Network object reference type

Network object reference of Visum matrices:

  • Matrices with zone dimension
  • Matrices with main zone dimension
  • Matrices with stop area dimension

Data source type

Data matrix

Select this option to insert a matrix that contains the value 0 for all relations.

Formula matrix

Select this option to insert a matrix that is automatically calculated from other matrices or attributes. Click the Edit formula button to specify the calculation (Creating a matrix calculated from a formula).

Edit new matrices after creating

Select this option to open the created matrices in the Matrix editor and edit them.

3.  In the Type of data source section, select the option Data matrix.

4.  Select the Set of matrices tab.

5.  Make the desired changes.

Element

Description

Insert a fixed number of matrices

If the option is selected, specify in the appropriate box the number of matrices you would like to insert.

Note

When creating more than one matrix, the matrix numbers will be continuously ascending. All created matrices have the same properties.

Insert matrices via matrix reference

If the option is selected, you can create one or more matrices and specify their properties (values of the matrix attributes). For new matrices, you can specify the values of the matrix attributes through references which you input as code (Fundamentals: Using matrix references for demand calculation).

Edit new matrices after creating

Select this option to open the created matrices in the Matrix editor and edit them.

6.  In the Type of data source section, select the option Define without formula.

7.  Confirm with OK.

The new matrix is created with zero values for all OD pairs and opened in a matrix editor window. In the Matrices window, a new matrix entry is displayed.

Insert matrices via matrix reference

You can create a matrix and set its attribute values. Use the analogue spelling of matrices by properties (Selecting matrices through properties).

Example

Matrix([CODE] = "Bus" & [NAME] = "Bus" & [MATRIXTYPE] = 3 & [OBJECTTYPEREF] = 2)

A demand matrix will be generated with the dimension Zones, for which the code and name are set.

By using the ForEach and Context keywords, you can create multiple matrices with the same properties.

Examples of ForEach/Context
  • ForEach([DSEGCODE])

Matrix([CODE] = "X" & [MATRIXTYPE] = 3 & [OBJECTTYPEREF] = 2 & [DSEGCODE] = CONTEXT[DSEGCODE])

For each demand segment, a demand matrix with the dimension Zones is generated for which the code is set to X.

  • ForEach([MODECODE] in {"Bus", "Tram"})

Matrix([DSEGCODE] = "PT" & [MODECODE] = context[MODECODE])

Two matrices are generated for which the attribute values ModeCode and DSegCode are defined.

  • ForEach ([DSTRATCODE])

Matrix([CODE] = "Utility" & [MODECODE] ="C" & [DMODELCODE] = "M01" & [DSTRATCODE] = CONTEXT[DSTRATCODE] & [MATRIXTYPE] = 4)

For each demand stratum a skim matrix (Matrix type = 4) is generated with the name "Utility". For these matrices the attributes for the code of the demand model (M01), the mode code (C) and the code of the demand stratum are defined.

  • ForEach ([MODECODE] in {"C", "Bike", "PT"})

Matrix([CODE] = "TotalHomebased" & [MATRIXTYPE] = 3 & [MODECODE] = CONTEXT[MODECODE])

For mode C, Bike and PT in each case a demand matrix (Matrix type = 3) is generated and the values of the attributes Code and ModeCode are set. The ModeCode is derived from the specific value in the defined amount.

Note: You can also create additional matrices through processes in the procedure sequence (Combining matrices and attribute vectors during the procedure sequence run)