Dear all,

I want to write a code in the MainExecution section.

I want to consider in the first cycle a constraint, but I wan't to consider this constraint in the second cycle.

How can I write this?

Thanks

Best

GL

# write a code

Page 1 / 1

Dear all,

I have this error in my code:

The set "Integers" does not denote a subset of the set "e_set".

How can I solve it?

Thanks.

Best

GL

I have this error in my code:

The set "Integers" does not denote a subset of the set "e_set".

How can I solve it?

Thanks.

Best

GL

Are you able to share the project with instruction of how to reproduce the error?

I want to consider in the first cycle a constraint, but I wan't to consider this constraint in the second cycle.

Please review below article, it shows you how to select/deselect multiple variables and constraints from a math program.

https://how-to.aimms.com/Articles/175/175-select-variables-and-constraints-for-math-program.html

For your case, it might be easiest to declare a parameter with Initial data as 1. Say, pConstraintActive.

In the Index domain of the constraint you want to use in cycle 1 and not use in Cycle 2, include this parameter.

**code:**

(i, j) | pConstraintActive

This will make the constraint active only if pConstraintActive has a nonzero value.

Now, your procedure will be.

**code:**

!solve with constraint

pConstraintActive := 1;

solve MathModel;

!solve without constraint

pConstraintActive := 0;

solve MathModel;

Note that you will need to store the results between two subsequent runs so that you don't lose the results from the first solve run when you run the solve statement the second time.

dear @mohansx ,

thanks for your replay. However, how can I relate this parameter to the constraint?

Best

GL

thanks for your replay. However, how can I relate this parameter to the constraint?

Best

GL

how can I relate this parameter to the constraint?

The parameter must go in the index domain condition of the constraint.

**code:**

Constraint your_constraint {

IndexDomain: (i,j)

Definition: constraint definition;

}

must become

**code:**

Constraint your_constraint {

IndexDomain: (i,j)|pConstraintActive

Definition: constraint definition;

}

dear @mohansx

how should be the pareto curve if one function is minimized and another function is maximized?

Thanks

GL

how should be the pareto curve if one function is minimized and another function is maximized?

Thanks

GL

### Reply

## Sign up

Already have an account? Login

**Please use your business or academic e-mail address to register**

## Login to the community

No account yet? Create an account

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.