Originally posted by: miroumariem
Hi,
i have a production problem that i need to model, my problem consists of keep producing till the stock reach its maximal level, and for the consumption of products limited to a minimal stock, when its reached, the production starts again ... but this is not the case with my model which doesnt wate to reach the minimal stock to restart.
can you help me plz ?
and here is my both files of the model and the data :
{int}T=...;
{int}machine=...;
{int}Article=...;// product
intProdCap[machine][Article]=...;//machine capacity for produce one unit from product p
intImax[Article]=...;//maximal stock
intImin[Article]=...;// minimal stock
intD[Article][T]=...;// Demand of article p during period T
intinvI_Prod[Article]=...;// stock initial d'article p
// decision data
dvarint P[machine][Article][T];// quantity to produce
dvarint I[machine][Article][T];// quantity to hold
//EXPRESSIONS
dexprfloat Production =
sum(minmachine,pinArticle,tinT)P[m][p][t];
dexprfloat stockage=
sum(minmachine,pinArticle,tinT)I[m][p][t];
//ovjective function maximize the productivity
maximize(Production+stockage) ;
// constraints
subjectto
// sign constraint
{forall(minmachine,pinArticle,tinT)
{P[m][p][t] >=0;
I[m][p][t]>=0; }
// capacity constraints
forall(minmachine,pinArticle,tinT)
P[m][p][t] <=ProdCap[m][p] ;
forall(minmachine,pinArticle,tinT)
{
I[m][p][t] <=Imax[p];
I[m][p][t]>=Imin[p] ;
}
// inventory balence
forall(minmachine,pinArticle,tin1..20)
I[m][p][t+1]==I[m][p][t]+P[m][p][t+1]-D[p][t+1] ;
forall(minmachine,pinArticle)//pour t==1
I[m][p][1]==invI_Prod[p]+P[m][p][1]-D[p][1] ;
// constraint to assure when I[m][p][t]reach the maximal stock we don't produce until we reach the minimal stock but this constraint work only one day after
//reaching the maximal stock and after that the system strart to produce which is wrong !!
forall(minmachine,pinArticle,tin1..20)
(I[m][p][t]>=54)=> (P[m][p][t+1] ==0) ;
}
executedisplay{
writeln();
writeln(" //\\Productivité//\\ = ",Production+stockage);
}
and the .dat:
Article = {1}; // product
invI_Prod= [24]; // initial stock
machine= {1}; // machine
Imax= [57]; // maximal stock
Imin= [5]; // minimal stock
ProdCap = [[15]] ; // production capacity
T= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21}; // Period
D= [[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6]]; // demand
#CPLEXOptimizers#DecisionOptimization