Identifier attributes

Identifier attributes

The attributes of identifier declarations specify various aspects of the identifier which are relevant during the further execution of the model. Examples are the index domain over which the identifier is declared, its range, or a definition which expresses how the identifier can be uniquely computed from other identifiers. For the precise interpretation of particular attributes of each identifier type, you are referred to the AIMMS Language Reference, which discusses all identifier types in detail.

Attribute window

The attributes of an identifier are presented in a standard form. This form lists all the relevant attributes together with the current values of these attributes. The attribute values are always presented in a textual representation, consisting of either a single line or multiple lines depending on the attribute. Fig. 18 illustrates the attribute form of a variable ComponentFlow(f,c).

The attributes specify, for instance, that the variable is measured in Mmol/h, and provide a definition in terms of other parameters and variables.

Identifier attributes

Fig. 18 Identifier attributes

Default values

You do not need to enter values for all the attributes in an attribute window. In fact, most of the attributes are optional, or have a default value (which is not shown). You only have to enter an attribute value when you want to alter the behavior of the identifier, or when you want to provide a value that is different to the default.

Entering attribute text …

You can freely edit the text of almost every attribute field, using the mechanisms common to any text editor. Of course, you will then need to know the syntax for each attribute. The precise syntax required for each attribute is described in the AIMMS Language Reference book.

…or using attribute wizards

To help you when filling in attributes, AIMMS offers specialized wizards for most of them. These wizards consists of (a sequence of) dialog boxes, which help you make specific choices, or pick identifier names relevant for specifying the attribute. An example of an attribute wizard is shown is Fig. 19.

Example of an attribute wizard

Fig. 19 Example of an attribute wizard

In this wizard, the numerical range of a particular parameter or variable is specified as the user-defined interval [0,MaxFlowErrorBound]. After completing the dialog box, the result of filling in the wizard is copied to the attribute window with the correct syntax.

Mandatory use of wizards

Some of the attribute fields are not editable by hand, but require you to always use the associated wizard. AIMMS requires the use of wizards, whenever this is necessary to keep the model in a consistent state. Examples are (non-empty) Index and Parameter attributes of sets, as well ass the BaseUnit attribute of quantities.

Identifier reference support

Even when you decide to enter an attribute into a field manually, AIMMS still offers support to help you enter such a field quickly and easily. If your application contains a large number of identifiers and/or if the names of these identifiers are long, then it may be difficult to remember all the exact names. There are two ways to let AIMMS help you in filling in the appropriate names in an attribute field:

  • you can drag and drop the names from the model tree into the field, or

  • with the name completion feature you can let AIMMS fill in the remainder of the name based on only the first few characters typed.

Dragging identifiers

When filling in an attribute field, you can drag any identifier node in the model tree to a particular location in the attribute field. As a result, AIMMS will copy the identifier name, with its index domain, at the location where you dropped the identifier.

Name completion …

When you use the Ctrl-Spacebar combination anywhere in an attribute field, AIMMS will complete any incomplete identifier name at the current cursor position wherever possible. With the Ctrl-Shift-Spacebar combination AIMMS will also complete keywords and predefined procedure and function names. When there are more than one possibilities, a menu of choices is presented as in Fig. 20. In this menu the first possible extension will be selected and the selection will be updated as you type. When an identifier name is complete, applying name completion will cause AIMMS to extend the identifier by its index domain as specified in its declaration.

Name completion

Fig. 20 Name completion

… applied to the :: and . characters

By pressing Ctrl-Spacebar in a string that contains the :: or . characters, AIMMS will restrict the list of possible choices as follows.

  • If the name in front of the :: character is a module or library module prefix, AIMMS will show all the identifiers contained in the module, or all identifiers contained in the interface of the library module, respectively.

  • If the string to complete refers to a property in a PROPERTY statement, and the name in front of the . character is an identifier, AIMMS will show all properties available for the identifier (based on its type).

  • If the string to complete refers to an option in an OPTION statement, and the string in front of the . character refers to an element of the set AllSolvers, AIMMS will show all options available for that solver.

  • In all other cases, if the name in front of the . character is an identifier, AIMMS will show all the suffices available for the identifier (based on its declaration).