Hey everyone,
I´m currently using Aimms to build a model for my Bachelor Thesis. I have never worked with Aimms before so I´m pretty clueless in some regard.
So my problem is the following constraint:
sum [i, aSP(h,i)*x(i,t)] + sum [j, sum [m, aFP(h,m)*(y(j,m,t))]] <= Capacity(h)
Here x(i,t) and y(j,m,t) are the decision variables which represent the accepted requests for two Product types. i are the different types of Product x and j are different types for Product y. t stands for different Periods. aSP and aFP indicate if product x(i) or y(j) needs Ressource h for its production.
I have declared Capacity(h) as a parameter with values for each h.
My Problem is now that the Programm takes these values for each seperate period, but the capacity in period 2 is of course lower than the capacity in period 1 and so on. I also cant just declare Capacity parameters for each period, because the remaining capacity in the periods after period 1 depend on the sold products and therefore the already used capacity in prior periods.
I think the capacity must be declared as a variable, but all my tries to make it work that way failed.
If anyone knows how i can deal with this problem, i would be very happy for your help.
Best answer by mateusarakawa
Hi,
I think the capacity must be declared as a variable
I agree with you.
If you create VarAvailableCapacity(h,t) with attribute range “nonnegative” and use in this constraint, you should also create other constraint to control its value.
Constraint_AvailableCapacity
Index domain: (h,t)
Definition:
VarAvailableCapacity(h,t)
=
Parameter_InitialCapacity(h)

! Sum used capacity in previous periods
sum [(i,t_aux)  (ord(t_aux) < ord(t)), aSP(h,i)*x(i,t_aux)] + sum [(j,t_aux)  (ord(t_aux) < ord(t)), sum [m, aFP(h,m)*(y(j,m,t_aux))]]
Remark: Your period set “t” must be ordered correctly.
“t_aux” is other index name for set “t”.
You can also use this sentence directly in your existing constraint:
sum [i, aSP(h,i)*x(i,t)] + sum [j, sum [m, aFP(h,m)*(y(j,m,t))]]
<=
Parameter_InitialCapacity(h)

! Sum used capacity in previous periods
sum [(i,t_aux)  (ord(t_aux) < ord(t)), aSP(h,i)*x(i,t_aux)] + sum [(j,t_aux)  (ord(t_aux) < ord(t)), sum [m, aFP(h,m)*(y(j,m,t_aux))]]
Hope it helps.