Creating a user-defined attribute

1.  From the Network menu, choose User-defined attributes.

The List (Attributes) opens and the display is already restricted to user-defined attributes.

Notes: If you select the entry Only user-defined in the selection list, only the user-defined attributes are displayed. If you select All attributes, all attributes of all objects are listed. If you Only network object types, only the attributes of the network object types are listed.

2.  On the toolbar, click the Create button .

The Create user-defined attribute window opens.

3.  Select the object type from the Network object list, for which you want to define a user-defined attribute.

4.  Confirm with OK.

The Create user-defined attribute (<network object type>) window opens.

5.  Make the desired changes.

Element

Description

Attribute ID

Unique attribute name

Note

An attribute ID must start with a character. Allowed are letters, figures as well as the special characters -, _ and /.

Code

Unique code of the attribute

Name

Name of the attribute

Comment

Description of the attribute (optional)

Data type

Use the list to select a data type. Select from the following data types:

Bool

For logical statements, that is true (Yes) or false (No)

Note

If the Allow empty value option is selected for default values, the Empty option is enabled.

File

Reference to a file

Surface

Surface according to your settings (Specifying standard units for length and speed)

Integer

Whole number

Precise duration

Precise duration, with decimal places, e.g. 35.004s

Speed

Speed in kilometers per hour

Floating-point number

Real number with a fixed number of decimal places (Selecting a decimal point)

Length (kilometers/miles)

Long length according to setting (Specifying standard units for length and speed)

Length (meter/foot)

Short length according to setting (Specifying standard units for length and speed)

Long text

String with an unlimited number of characters in case of an undefined Max. length

Alternatively, under Max. length, you can enter a value > 255.

Text

String with a maximum string length of 255

Currency

Number with a fixed number of decimal places, e.g. to display cost attributes (Selecting a decimal point).

Time

Duration in seconds, display format 12h35min12s

Time

Time in format hh:mm:ss (12:23:12) or hh:mm (12:23)

Subattribute type

From the drop-down list, choose the desired entry:

  • Empty
  • Analysis time intervals (subattributes of the type AHPI are created for analysis time intervals)
  • Time interval set [name of time interval set]: With this selection you can enter fixed values for user-defined time intervals. An important use case is, for example, the input of count values per time interval, which can be used as input for dynamic matrix correction.
Attribute type Data attribute

If this option is selected, you can enter the values directly.

Formula attribute

If this option is selected, the attribute values are generated based on a formula. In most cases, you will select the type Integer. With the functions Text to number and Number to text you can use the types Text and Long text in combination with formulas.

Note

For the following network objects, which are not always available, you can only create formula attributes:

  • PuT paths
  • PuT path legs
  • PrT paths
  • PrT paths on link level
  • Path sequences
  • Path sequence items
  • Connecting journeys
  • Transfers and stop area walk times in stop
  • OD pairs
  • Main OD pairs
  • Directed edge course
Type-dependent attributes

Depending on the selected Type, you can also specify the following attribute values and options:

Element

Description

Default value

Input field for a default value

Note

If you do not enter a value for numerical attributes, the empty value is interpreted as 0 in case of arithmetic operations.

Allow empty value

If the option is selected, empty values are permitted in case of numerical or boolean data attributes.

If the option is not selected, a value must be entered.

Minimum

If the option has been selected, you can enter a minimum permitted value.

Note

If you do not want to define a minimum permitted value, select theUnlimited option.

Maximum

If the option has been selected, you can enter a maximum permitted value.

Note

If you do not want to define a maximum permitted value, select the Unlimited option.

Decimal places

Number of decimal places

Max. length

Maximum number of characters

Options for split / connect

For some types, the following option is provided for the calculation of attribute values when splitting or connecting links.

Copy values (default setting)

  • If the option has been selected, an identical attribute will be created for both new links when splitting a link (Splitting a link).
  • If the option has been selected, the attribute will be created for just one of the links when connecting the links (Deleting a node).

Scale values

  • If the option has been selected, the attribute will be distributed to each new link in proportion to the length of the two new links. The total of both values thus equals the original value.
  • If this option has been selected, the attribute is summed up when connecting the links.

Note

You can verify the Values are copied/scaled setting in the Scalable column of the network file. 0 means that the values are copied, 1 means that the values are scaled.

Cross-section logic

For attributes of network object types that have a direction (like links or connectors), you need to specify how the cross-section values shall be calculated. The cross-section value is determined on the basis of the values of the two directions. You have the following options:

  • Sum
  • Mean
  • Minimum
  • Maximum

Depending on the selected option, the total, mean, minimum, or maximum of the two directions will be used as cross-section value.

Ignore blocked directions

If this option has been selected, blocked directions are ignored in the calculation.

Attribute whose values enter the formula

Use the button to select direct or indirect attributes (and subattributes, if provided) of the network object type.

The selection is done in a separate window (Selection of attributes).

Notes

Make sure that your formula does not contain direct or indirect circular references.

In the List (Attributes), you can change the formula of a user-defined attribute by clicking the symbol in the Formula column to open the formula editor.

Click this button to select an operator for the formula. The selection available depends on the operand type, of which the values are used in the formula.

Available operators and their priority:

The parenthesis operator has the highest priority. Click the symbol to insert it. In the following, the other operator groups are listed in decreasing priority:

1. unary operator:

  • ! Negation of a subsequent term

2. multiplicative binary operators:

  • * generates the product of two terms
  • / generates the quotient of two terms

3. additive binary operators:

  • + generates the sum of two terms

Note

You can also use this function to merge two texts.

  • - generates the difference of two terms

4. relational binary operators:

  • > compares two terms as to which one is "greater"
  • >= compares two terms as to which one is "greater" or whether they are "equal"
  • <= compares two terms as to which one is "smaller" or whether they are "equal"
  • < compares two terms as to which one is "smaller"

5. binary equality operators:

  • = checks whether the two terms are equal
  • != checks whether the two terms are unequal
  • & links two terms with a logical AND
  • | links two terms with a logical OR

When binary operators have the same priority, the order of evaluation is from left to right (left associative).

Example 4/2/2 is evaluated as (4/2)/1 = 2, not as 4/(2/2) = 4

Click the button to select a function for the formula.

  • Min (x, y) forms the minimum of x and y
  • Max (x, y) forms the maximum of x and y.
  • Abs (x) absolute value of x.
  • Round (x,p) rounds x to p decimal places, the text ROUND(,) is inserted at the mouse pointer position.
  • Floor (x) rounds to the highest integer which is smaller or equal to x. FLOOR() is inserted at the mouse pointer position.
  • Ceil (x) rounds to the lowest integer which is higher or equal. CEIL() is inserted at the mouse pointer position.
  • Truncate (x) cuts the decimal places of x. TRUNCATE() is inserted at the mouse pointer position.
  • Reciprocal (x) generates the reciprocal value of x, that is 1/x; RECIPROCAL() is inserted at the mouse pointer position.
  • Percent (x, y) corresponds to 100*x/y, the text PERCENT(,) is inserted at the mouse pointer position.
  • Power (x, y) corresponds to xy, the text POW(,) is inserted at the mouse pointer position.
  • Root (x) generates the square root of x. The text SQRT() is inserted at the mouse pointer position.
  • Exp (x) generates the exponential function of x.
  • Log (x) generates the natural logarithm of x.
  • GEH statistics (x, y) calculates the GEH statistics for x and y.
  • If (b, w, f) forms a conditional branch that outputs value w if condition b is true, or outputs value f if condition b is false. The text If(,,) is inserted at the mouse pointer position.
  • Mod (x, y) calculates the remainder of a division of dividend x and divisor y. The text MODULO(x,y) is inserted at the mouse pointer position.

Examples

MODULO(5,2) = 1

MODULO(9,3) = 0

  • Div (x, y) calculates the integer quotient of dividend x and divisor y. The text IDIV(,) is inserted at the mouse pointer position.

Examples

DIV(5,2) = 2

DIV(9,3) = 3

DIV(7,−3 = −2

DIV(-7,−3 = 2

  • Sin (x) calculates the sine of x. SIN() is inserted at the mouse point position.
  • Cos (x) calculates the cosine of x. COS() is inserted at the mouse pointer position.
  • Tan (x) calculates the tangent of x. TAN() is inserted at the mouse pointer position.
  • ArcSin (x) calculates the arc sine of x. ARCSIN() is inserted at the mouse pointer position.
  • ArcCos (x) calculates arc cosine of x. ARCCOS() is inserted at the mouse pointer position.
  • ArcTan (x) calculates the arc tangent of x. ARCTAN() is inserted at the mouse pointer position.
  • Current iteration () has no parameters and shows the current value of the iteration counter within a feedback loop. For formula attributes, null is always shown. The text Iterationcounter() is inserted at the mouse pointer position.
  • Seconds returns the value of the character string in seconds.
  • MSA (x, y) returns the weighted mean of x and y. MSA(,) is inserted at the mouse pointer position. The calculation formula is MSA (x, y) = 1 / (IterationCounter() + 1) * x + IterationCounter() / (IterationCounter() + 1) * y. When using the function outside of the procedure sequence, the iteration counter is always 0. The result therefore equals the x-value (Average determination using the Method of Successive Averages (MSA)).
  • Text to number (x) converts a string x into a floating point number. The text STRTONUM() is inserted at the mouse pointer position.
  • Number to text (x) converts a floating point number x into a string. The text NUMTOSTR() is inserted at the mouse pointer position. Optionally, you can enter a number as second parameter for the number of decimal places.
  • Extract substring (x, s, n) extracts the n-th substring from a text string using a separator s. WORDN(,,) is inserted at the mouse pointer position.

Example

WORDN([TRAINNUMBER],"_",1) extracts from the text string of the attribute "train number" the substring that precedes the separator "underscore".

  • Variable value text inserts the current value of the specified variable into the formula. Write the desired variable name in the bracket, for example ("ID").
  • Variable value number inserts the current numerical value of the specified procedure variable into the formula. Write the desired variable name in the bracket, for example ("ID").

Note

If under User preferences you selected a point as your decimal separator, a comma is used as separator between the elements. Otherwise, a semicolon is used (Selecting a decimal point).

Click the button to open the Insert aggregation function window, in which you can select matrix conversion functions (Fundamentals: Using matrix conversion functions).

  • Matrix sum (x, b) calculates the sum of the matrix x, MATRIXSUM(,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix diagonal sum (x, b) calculates the sum of the diagonal of the matrix x, MATRIXDIAGONALSUM(,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix row sum (x, i, b) calculates the sum of the row i of the matrix x, MATRIXROWSUM(,,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix column sum (x, i, b) calculates the sum of the column i of the matrix x, MATRIXCOLSUM(,,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix minimum (x, b) finds the minimum of the items of matrix x, MATRIXMIN(,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix maximum (x, b) finds the maximum of the items of matrix x, MATRIXMAX(,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix average (x, b) calculates the average of all items of matrix x, MATRIXAVG(,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.
  • Matrix value (x, i, j) displays the value of row i and column j of matrix x, MATRIXVAL(,) is inserted at the mouse cursor position. Variable b is optional. If the value of b is not zero, only active OD pairs will be taken into account.

The button opens the Insert TableLookup window. Here, you can insert a function of the type TableLookup in the formula (Fundamentals: Using the TableLookup function). With this function, you can extract a value from any Visum table and edit it in the formula. This is useful, for example, when managing parameter values which are used for the calculation of attributes. Alternatively, you can, for example, transfer data from one network object to another.

Network object type

From the drop-down list, select the network object type which represents the base of the function. All following conditions of the function refer to the selected network object type. Procedure variables can also be selected.

Variable name

Enter a variable name which starts with a letter. The first matching value in the table is used for further calculation. If no matching value is found, an empty value is used.

Click this icon to insert a bracket term without content into the formula.
  1. ►  Confirm with OK.

The user-defined attribute is inserted. You can edit the values in the list.

Tip: Alternatively, you can add user-defined attributes as follows: