Skip to main content
Solved

Disable some of Constraints in Model through a user interface

  • August 14, 2019
  • 1 reply
  • 260 views

Hi All,

I want to create a user interface or page where i can control some of the constraints to toggle and run the model.

e.g. Lets say we have 10 set of constraints and I want to run the model with 8 currently while rest 2 I want to disable for the run. This needs to be dynamic

Is there any documentation available for the same or any example.


Regards
Ankit Bhagat

Best answer by mohansx

@AnkitBhagat

You can declare subsets of the predeclared sets AllVariables and AllConstraints and use them in the math program declaration to control which constraints and variables are considered for the math program. See this article.

Note that variables with definitions will be considered as constraints as well.

You can use a binary parameter indexed over AllConstraints (IndexConstraints) and use this parameter to control which constraints are selected for the final math program.

ModelConstraints will now be {IndexConstraints | bpSelectConstraint(IndexConstraints) } and your end users will be able to change the value of bpSelectConstraint(IndexConstraints) from the UI

1 reply

mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • Answer
  • August 14, 2019
@AnkitBhagat

You can declare subsets of the predeclared sets AllVariables and AllConstraints and use them in the math program declaration to control which constraints and variables are considered for the math program. See this article.

Note that variables with definitions will be considered as constraints as well.

You can use a binary parameter indexed over AllConstraints (IndexConstraints) and use this parameter to control which constraints are selected for the final math program.

ModelConstraints will now be {IndexConstraints | bpSelectConstraint(IndexConstraints) } and your end users will be able to change the value of bpSelectConstraint(IndexConstraints) from the UI


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

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