Skip to main content
Solved

set and subset in the index domain

  • March 23, 2023
  • 2 replies
  • 89 views

Forum|alt.badge.img

Hi community!

I have a problem about a formulation and I am looking for help!

I have defined a set “Input” index i, and two subsets “input1d” index id and “input1s” index is.

 

Here is my formulation of a constraint:

Identifier : MassConservation12

Index domain : (i,id,is,r)

Definition : sum(t, S1(i,t,r))+Stock1(i,r-1)=sum(d, Y1(id,d,r))+sum(s, uu1(is,s,r))+Stock1(i,r)+ZZ1(id,r)

 

Should I modify the index domain in order to make clear that id and is are subsets of i?

 

Thank you!

Best answer by gabiservidone

Hey @Valque

I must say that I did not fully understood the goal/problem. When setting subsets, you need to reference which set is the ‘bigger’ set of that subset. So from that, anywhere which has i index defined, you can use id or is and it will work correctly. 

But looking to your contraint, I am missing a relation between i, id and is either on the sums, or in the domain of the contraint. You can also run the contraint only to (i, r) and use the subsets in sums. 

 

If this was not helpfull, and can you clarify a little bit more what is the problem you are facing?

 

2 replies

gabiservidone
Administrator
Forum|alt.badge.img+6
  • AIMMSian
  • 256 replies
  • Answer
  • April 4, 2023

Hey @Valque

I must say that I did not fully understood the goal/problem. When setting subsets, you need to reference which set is the ‘bigger’ set of that subset. So from that, anywhere which has i index defined, you can use id or is and it will work correctly. 

But looking to your contraint, I am missing a relation between i, id and is either on the sums, or in the domain of the contraint. You can also run the contraint only to (i, r) and use the subsets in sums. 

 

If this was not helpfull, and can you clarify a little bit more what is the problem you are facing?

 


Forum|alt.badge.img
  • Author
  • Enthusiast
  • 1 reply
  • April 23, 2023

Thank you it helped me a lot! I’ve been able to define it correctly!



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

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