Hello,
i have a problem with my GAMS Skript for a lot size problem.
I want to make sure, that the Variable Q(k,t) can only be certain values wich are defined in a parameter.
For example:
The box for the product k1 is big enough for 50 pieces.So Q(k1,t1) can be 50 pieces, 100 pieces or 150 pieces. So half boxes are not allowed.
For example a new Equations and paramter like below.
Behaelterbeg(k,t)…
Q(k,t) =e= a(k);
Paramter
a(k) /k1 50 or 100 or 150, k2 60 or 120 or 180, k3…/;
Thanks for your help and greetings from germany.
Here is the working skript with no addtion to solve problem:
$title CLSP
* Capacitated Lot Sizing Problem
* Modellformulierung
Sets
t Perioden
k Produkte
a Mengen;
Parameter
hc(k) Kosten der Lagerung einer Einheit von Produkt kueber eine Periode
ts(k) Ruestzeit fuer Produkt k
tb(k) Stueckbearbeitungszeit fuer Produkt k
sc(k) Kosten eines R�stvorgangs fuer Produkt k
Y0(k) Lageranfangsbestand von Produkt k
C(t) Kapazitet der Ressource in Periode t
d(k,t) Bedarf von Produkt k in Periode t
Positive Variables
Q(k,t) Produktionsmenge von Produkt k in Periode t
Y(k,t) Lagerbestand von Produkt k am Ende von Periode t ;
Binary Variables
gamma(k,t) binaere Ruestvariable von Produkt k in Periode t;
Variables
ZF Zielfunktionswert;
Equations
ZFkt Minimierung der Gesamtkosten
LBil(k,t) Lagerbilanzgleichung
KapRes(t) Kapazitaetsrestriktion
RuestBed(k,t) Ruestbedingung
;
ZFkt..
ZF =e= SUM((k,t), hc(k) * Y(k,t) + sc(k) * gamma(k,t));
LBil(k,t)..
Y0(k)$(ord(t)=1) + Y(k,t-1)$(ord(t)>1) + Q(k,t) - Y(k,t) =e= d(k,t);
KapRes(t)..
SUM(k, ts(k) * gamma(k,t) + tb(k) * Q(k,t)) =l= C(t);
RuestBed(k,t)..
tb(k) * Q(k,t) =l= C(t) * gamma(k,t);
* Daten der konkreten Instanz
sets t /t1*t6/
k /k1*k6/;
parameter
sc(k) /k1 20.0, k2 50.0, k3 40.0, k4 30.0, k5 50.0, k6 40.0/
hc(k) /k1 3.0, k2 5.0, k3 6.0, k4 4.0, k5 3.0, k6 2.0/
tb(k) /k1 1.0, k2 2.0, k3 1.0, k4 4.0, k5 2.0, k6 1.0/
ts(k) /k1 30, k2 100, k3 50, k4 40, k5 40, k6 2.0/;
* Keine Anfangslagerbestaende
y0(k)= 0;
* Periodenkapazitaet konstant
C(t)=10000;
*C(t)=400;
*sc(k)=100*sc(k);
table d(k,t)
t1 t2 t3 t4 t5 t6
k1 10 25 30 100 30
k2 5 40 10 60
k3 5 45 30 40 60
k4 40 20 15 80
k5 20 5 15 70 50
k6 10 15 5 20 30;
Model CLSP / all /;
CLSP.optcr=0.0;
solve CLSP minimizing ZF using mip;