The tree structure of the model explorer in AIMMS allows you as a modeller to structure your project and make it easy to maintain a good overview. Especially if your model becomes larger, having a well structured model will allow you to quickly find the identifiers you need. For AIMMS, the structure and order of the tree are not important: if you want, you could even declare all your identifiers under one declaration section.
One of the nice things is that you can actually use the information from the tree structure in your model: each section or declaration section that you introduce in your model will automatically create a new set in AIMMS with the same name as the section. This new set is a subset of the predefined set AllIdentifiers and it will contain all identifiers that are declared under the section or declaration section.

Example of structured model tree
- Input_Section
- Set_declarations
- Location_declarations
- Transport_declarations
- Output_Section
As you can see from the above list, AIMMS will convert the spaces in the names of the (declaration) sections into underscores. This conversion is done because identifiers in AIMMS cannot contain spaces.
From the above list, you can also see that no separate set is created for the declaration section “Declaration” under the section Output Section. The reason for this is that no two identifiers in AIMMS can have the same name. The only exception to this rule is declaration sections that can all share the name Declaration. This means that for declaration sections, AIMMS will only automatically create the subset of AllIdentifiers if it has a different name than the default name Declaration.
The set Set_declarations from the example above will only contain the element ‘Locations’. The set Input_Section will not only contain all the identifiers declared under it explicitly, but it will also contain the sets that are automatically created because of the (declaration) sections under it. This means that it will also contain the elements ‘Set_Declarations’, ‘Location_declarations’, and ‘Transport_declarations’.
Note that any of the indices declared with sets are seen as separate elements in the set. For example, the set Locations has three indices: loc, locFrom, and locTo. These three indices will be three separate elements in both the sets Input_Section and Set_declarations.
A typical example use for these automatically created sets is that you are able to empty specific parts of your model. For example, if you want to empty all the identifiers in your model that are related to input, you can do so with the following statement:
empty Input_Section ;
Similarly, with the write statement you can also write the contents of all identifiers declared under the given section to a file as follows:
write Input_Section to file "values_of_identifers_under_Input.txt" ;
If you want to see the exact contents of such a automatically created set, you can assign its contents to a set you declared in your model. Please keep in mind that you will have to declare this set to be a subset of AllIdentifiers. If you have such a subset of AllIdentifiers, e.g. mySubSet, you can use the following statement:
mySubSet := Input_Section ;to assign the contents of the automatically created set to the set mySubset, after which you can inspect the data of mySubSet.














