Home > Process Behavior Procedures and Reference > Process Behavior Reference > Activity and Resource Attributes in Array Indices

Activity and Resource Attributes in Array Indices

Activity and Resource attributes are internally implemented as global arrays of attribute values (one value for each activity in the model or one value for each resource in the model). Use the methods and functions explained below to index these global arrays.

Activity attributes use the forms A.x, A.x[i], A.x[ActId(a)], and A.x[ActId(a),i] where “x” is the attribute name, “i” is a direct index into the array, and “a” is the activity ID of any activity. See Simulation Functions for methods of obtaining Activity ID for other activities, such as the LoadCustomDataIndex() function.

Resource attributes use the forms R.x, R.x[i], R.x[ResId(r)], and R.x[ResId(r),i] where “x” is the name of the resource attribute, “i” is the direct index into the array, and “r” is the resource ID of the resource. See the ResId() and AcqResId() functions in Resource Functions for examples of accessing specific Resource IDs. Note that A.x[i,j] and R.x[i,j] are not permitted.

By default, all Activity and Resource attributes are initialized to 0.

Form

Description

A.x

The Activity attribute A.x of the transaction’s current Activity

A.x[i]

The (i)th element of the Activity attribute A.x of the transaction's current Activity

A.x[i,j]

Not allowed

A.x[ActId(a)]

The Activity attribute A.x of Activity (a)

A.x[ActId(a),i]

The (i)th element of Activity attribute A.x of Activity (a)

R.x

The Resource attribute R.x of the transaction’s acquired Resource.

Only legal when the transaction has acquired exactly one Resource or the form is used within an acquisition expression.

R.x[i]

The (i)th element of Resource attribute R.x of the transaction's acquired Resource.

Only legal when the transaction has acquired exactly one Resource or the form is used within an acquisition expression.

R.x[i,j]

Not allowed

R.x[ResId(r)]

The Resource attribute R.x of Resource (r)

When (r) is omitted within resource acquisition constraint expressions, ResId() is evaluated in the context of each available resource.

R.x[ResId(r),i]

The (i)th element of Resource attribute R.x of Resource (r)

When (r) is omitted within resource acquisition constraint expressions, ResId() is evaluated in the context of each available resource.

ResId is not required when you use the following forms as the first index of a Resource attribute since each form returns a Resource ID:

Related Topics

Expressions