Solved

# Adding an Initial inventory in AIMMS

• Explorer

First, let me introduce myself (as its my first post):

Im and Industrial Engineer student making my end of master project studying the scheduling of a production plant. My tutor recommended me AIMMS to solve the MIP scheduling problem and, as you might have guessed none of us used this tool ever

So far so good, i have found a scientific paper that solves my particular problem ( i dont think i can upload the paper, so I’ll upload only the good stuff)

If AIMMS has a good thing its that it was easy (even for me) to introduce most of the constraints and definitions. So i made (most) of them

But theres one that particularly bothers me, restriction (2) and in a lesser way (7). This ones check the inventory stock at the the end of a certain T time, but if T=0, then it check It-1 (which it doesnt exist). And if T=1, it check It=0

The thing is that I created a Parameter that holds the Initial Inventory and i wanted to keep as close as the formulation previously showed, so i went ahead and made some “adjustments” that worked in my head, but didnt work in reality.

I havent used AIMMS, but i have some minor experience in coding, so you will probably see where I am going with that: If t-1>0, you check the constraint on Inventario_Final (Final Inventory on English) otherwise, you check over the parameter Inventario_Inicial (Starting Inventory).

But I have a nasty error that i cant solve. Maybe you experts could help me😉

PD: as a bonus, here you have the files (in Spanish, that is, sry)

icon

Best answer by Marcel Hunting 10 July 2023, 15:06

View original

### 2 replies

Userlevel 5
+4

Hi @gmdaniel79. You can formulate this constraint using

``Inventario_Final(i,t)=if t=First(Periodo) then    Inventario_Inicial(i)else    Inventario_Final(i,t-1)endif+sum((s), Asignacion_Lotes(i,s)-Prediccion_Demanda(i,t))``

Thanks @Marcel Hunting, it seems to work. 😊

I will do further testing soon, but so far so good