0
votes

I have difficulty formulating the constraints correctly. Dumbed down version of the problem:

There are 12 time units, 3 products, demand d_{i,t} for the product i at time $t$ is known in advance and the resources r_{i,t} (all 8, product i uses the non-i resources) necessary for product i at time t are known as well. We need to minimize holding costs h_i by deciding how much of product i we need to produce at time t, this is called x_{i,t}. Starting inventory for every product is 6. To help I introduce stock level s_{i,t}. This equates to the following formulation:

http://i.imgur.com/iK2uZGT.png

I got this working using the Excel solver but I need to do this in AIMMS. The Stock variable s is giving me issues, I can't get it to work using an if statement to condition on if t=1 nor would I know how to split it in two constraints, given the first iteration of the second constraint would need to reference the first constraint.

1
Just found out that MathJax doesn't work on SO, I'll quickly make it in LaTeX - Jan van der Vegt
Did you try to add it as it is with t = 1? AIMMS will remove the variable that is out of index. - Ioannis

1 Answers

2
votes

You can specify index domain in your constraint attributes as follows:

(t,i) | t > 1

if t > 1 statement should work if the set of time instances is a subset of integers. If not - you should use ord(t) > 1, i.e.

if ord(t) > 1
then
Your_Constraint
endif