Using matrix combination functions

A matrix combination function allows you to transform a set of matrices to a matrix of the same dimension.

Matrix combination functions are used as follows:

Matrix combination function (MatrixList (matrix reference via properties))

  • The matrix combination functions provided are: sum, average, maximum, minimum and product. You can call the keywords SUM, AVERAGE, MIN, MAX, PRODUCT via the functions in formulas. The calculation is performed per element:
  • MatrixList represents a set of matrices that can be identified via the matrix reference in parentheses.

A matrix combination with MatrixList, e.g., can be used as an expression in calculations with ForEach.

Example:

You want to add the demand matrices of mode choice for all demand strata.

ForEach(MODE M)

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

:= SUM(MatrixList([DMODELCODE] = "M01" & [MODECODE] = M[CODE] & [MATRIXTYPE] = 3 & [DEMANDSTRATUM\ISHOMEBASED] = 1))

Iteration is performed on all modes of the model. In addition, matrices with the same properties (listed in parentheses on the right-hand side of the assignment symbol) are added up. In this case, the matrix reference is not unique. It does not describe an individual matrix. For the respective target matrix, the ModeCode attribute of the matrix must correspond to the Code of the mode upon which iteration is being performed. For the set of matrices listed on the right-hand side of the assignment symbol, four properties are defined. Please note that it only makes sense to evaluate the indirect, user-defined attribute of the demand stratum if the DemandStratumCode attribute of the matrix contains a value.