Skip to main content

Suppose A is my library/module.  It would be very useful if AIMMS allowed modelers to programmatically reference or collect constraints/variables defined within a specific library/module e.g., A::Constraints or A.getAllConstraints()” which would return the set of constraints that are in A.

 

This would enable better modularization, selective model construction, and more scalable large-model development.

I know there are workarounds this, like choosing constraints by a binary parameter, defining a set for the constraints you want to include, etc. but they all require manual overhead and careful maintenance effort.

 

Best,

Gorkem

Let s_libAConstraints be a subset of AllIdentifiers and let libA be a library.

Then the assignment

libAConstraints := libA * AllConstraints ;

will place all constraints in the library libA in the set s_libAConstraints.

Does this answer your question?


Yes, and thanks. I didn't know such an easy solution exists. 

Best, 

Gorkem


NewImplemented

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

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