New attribute for library: Required Units

Related products: AIMMS Language
New attribute for library: Required Units

Having the same quantity declared in multiple libraries and modules was the source of many problems and unexpected behavior. Starting in AIMMS 4.79 we move away from this and follow this new recommendation/best practice:

Declare all your quantities at one location in your main model and do not declare them in a library or module. If your library or module needs a specific unit, use the new attribute Required Units to make sure that the main model will automatically declare this unit.

This new attribute, Required Units, is available for libraries and modules and it specifies which units the module or library needs to work correctly.


For example, until now, the WebUI library had its own quantity SI_Time_Duration declared because it needed the units and nminute]. In the new version, the WebUI no longer has this quantity. Instead, it specifies the new attribute as follows:


What will this do?

  • For a new model or for an existing model that does not have its own quantity SI_Time_Duration declared, this specification tells AIMMS to automatically add a quantity in the main model. This quantity will appear in a new section called “Quantities and Units,” which is added as the last section in the root node of your main model (see image below).
  • For an existing model that already contains the quantity SI_Time_Duration, this quantity is extended with two derived units and [minute] (unless these are already present).

You are free to adapt the automatically added quantities and/or units to your own needs, but of course you cannot delete the added units. They will be added again as soon as you restart the model with the WebUI library.

In AIMMS 4.79, the following libraries and modules are now using this new feature:

  • WebUI library
  • System modules: MultiStart, GMP_BendersDecomposition and GMPOuterApproximation
  • AimmsProGui library

So if you use any of these in your application, it could be that a quantity or unit is added to your main model. If this happens, a message will appear in the Message window, and also the comment of the quantity will tell you which units were added.

We don’t expect any real problems because of this change. It will just make it easier to understand which units come from which quantity. The only thing that we know of is that the suffix SolutionTime of a math program ‘suddenly’ may have a unit seconds, and this might lead to an error/warning about non-commensurate units in expressions where you use this suffix. The option ‘Solution Time has unit Seconds’ can be used to make sure that this suffix is always unitless, even if the unit is known in the main model.

Of course, this new attribute is not only for the generic libraries and modules that are shipped with AIMMS. You can (or should) use it in your own libraries as well, to make sure that you follow the recommendation/best practice stated above.

If you encounter any problems because of these changes, please let us know.




Be the first to reply!

Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator