# non anticipativity constraint

• 6 replies
• 220 views

• Newcomer
• 27 replies

Dear all,

I must to set the non anticipativity constraints in aimms for the stochastic problem.

Then for s scenarios and x decision variable I must to write that

x1=x2=x3=..xs

How can I write this in aimms?
Thanks

### 6 replies

where x is a binary variable

Userlevel 5
+5

@graleo , you can try the below approach. Have two indices in your set of Scenarios - s1 and s2.

NonAnticipativity(s1, s2)|s1 <> s2,

Definition: x(s1) = x(s2)

This will generate many constraints like x1 = x2. x1 = x3 .. x1 = xs, x2 = x1 and so on. Some of them would be redundant, you could modify the index domain as

NonAnticipativity(s1, s2) | s2 = s1+1 and s1 < last(Scenarios)

This will generate, x1 = x2, x2 = x3, x3 = 4 and so on.

Dear @mohansx

thanks for your replay. But I didn’t understand how write it.

How can I write this in aimms?
Best

GL

Userlevel 5
+5
1. Make sure you have two indices in the set of scenarios - let’s call these si and sj
2. Create a new constraint, in the index domain attribute - write
(si,sj) | sj = si + 1 and si < last(Scenarios)
3. In the definition attribute, write
x(si) = x(sj)

Dear @mohansx

I have only one index for the scenario. Then I can not insert another index.

the scenario set has s index and it is defined as 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Then I have the binary variable X(i,j,k,s). I want that X(i,j,k,’1’)=X(i,j,k,’2’)=...=X(i,j,k,’10’).

How can I write this in compact way?

I wrote all equation now:

X(i,j,k,’1’)=X(i,j,k,’2’)

X(i,j,k,’2’)=X(i,j,k,’3’)

X(i,j,k,’3’)=X(i,j,k,’4’)

X(i,j,k,’4’)=X(i,j,k,’5’)

X(i,j,k,’5’)=X(i,j,k,’6’)

X(i,j,k,’6’)=X(i,j,k,’7’)

X(i,j,k,’7’)=X(i,j,k,’8’)

X(i,j,k,’8’)=X(i,j,k,’9’)

X(i,j,k,’9’)=X(i,j,k,’10’)

X(i,j,k,’1’)=X(i,j,k,’10’)

Is it right?

Best

GL

Userlevel 5
+5

@graleo , you can have any number of indices in a set. Add 2 indices to your scenario set and follow instructions in my previous comment:https://community.aimms.com/aimms-developer-12/non-anticipativity-constraint-440#post1020

How to add multiple indices: https://how-to.aimms.com/Articles/272/272-using-multiple-indices-for-one-set.html