Hi All
I am currently working on some aggregate planning modeling. Since I am a total beginner in GAMS modeling I wanted to ask some of the members who have done aggregate problems to guide me through...
The issue is that I can't get a fully feasible solution. It seems that the number of spent hours Ru(t) of the workers is not reflected fully in the solution. The model, however, gives a feasible solution but it doesn't look like it calculated all the (i). Apart from this, the model seems to be fine.
Here's a short part:
Set
i 'products' / prod1*prod22 /
t 'periods' / Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec/;
...
...
...
Variable
X(i,t) 'units of product i to be produced in period t'
Inv(i,t) 'units of product i to be left over as an inventory in period t'
Ru(t) 'man-hours of regular labor used during period t'
Ou(t) 'man-hours of overtime labor used during period t'
z 'total cost...';
Positive Variable X, Inv, Ru, Ou;
Equation cost, con1, con2, con3, con4;
cost.. z =e= sum((i,t), c(i,t)*X(i,t) + h(i,t)*Inv(i,t)) + sum((t),oc(t)*Ou(t) + rc(t)*Ru(t));
con1(i,t).. X(i,t) + Inv(i,t-1) - Inv(i,t) =e= d(i,t);
con2(t).. sum(i, m(i)*X(i,t) - Ou(t) - Ru(t)) =e= 0;
con3(t).. Ou(t) =l= o(t);
con4(t).. Ru(t) =l= r(t);
Model Aggregate / all /;
solve Aggregate using lp minimizing z;
Display X.l, Inv.l, Ru.l, Ou.l;
I have tried to model it through sum(i,t) as it ranges from 1*22 products. I have also attached the gms file if there will be the need.
Greatly appreciate your time and effort...thanks in advance!.
Aggregate Planning... would appreciate any help... thanks
Aggregate Planning... would appreciate any help... thanks
- Attachments
-
- HALF WORKING2.gms
- (6.29 KiB) Downloaded 159 times
Re: Aggregate Planning... would appreciate any help... thanks
Hi,
Can you explain why exactly you think that the number of spent hours Ru(t) of the workers is not reflected fully in the solution? And can you also explain what is meant by [...] it doesn't look like it calculated all the (i)
Looking at the solution listing I see man hours of regular labor in every time step
Comparing the produced units with the demand, it seems that everything is fine:
results in
Apparently the demand is satisfied by the production in every time step. There is no usage of inventory.
I hope this helps!
Fred
Can you explain why exactly you think that the number of spent hours Ru(t) of the workers is not reflected fully in the solution? And can you also explain what is meant by [...] it doesn't look like it calculated all the (i)
Looking at the solution listing I see man hours of regular labor in every time step
Code: Select all
---- VAR Ru man-hours of regular labor used during period t
LOWER LEVEL UPPER MARGINAL
Jan . 23.3619 +INF .
Feb . 19.4252 +INF .
Mar . 17.4269 +INF .
Apr . 17.0250 +INF .
May . 17.5526 +INF .
Jun . 18.4554 +INF .
Jul . 19.2164 +INF .
Aug . 22.1324 +INF .
Sep . 22.8366 +INF .
Oct . 28.6152 +INF .
Nov . 25.6973 +INF .
Dec . 39.6094 +INF .
Code: Select all
parameter rep(i,t,*);
rep(i,t,'demand') = d(i,t);
rep(i,t,'production') = X.l(i,t);
rep(i,t,'slack') = d(i,t) - X.l(i,t);
display rep;
Code: Select all
---- 189 PARAMETER rep
demand production
prod1 .Jan 111370.000 111370.000
prod1 .Feb 5279.000 5279.000
prod1 .Mar 4979.000 4979.000
prod1 .Apr 4579.000 4579.000
prod1 .May 4306.000 4306.000
prod1 .Jun 4687.000 4687.000
prod1 .Jul 54453.000 54453.000
prod1 .Aug 50375.000 50375.000
prod1 .Sep 69807.000 69807.000
prod1 .Oct 78995.000 78995.000
prod1 .Nov 67727.000 67727.000
prod1 .Dec 104796.000 104796.000
prod2 .Jan 178636.000 178636.000
prod2 .Feb 31006.000 31006.000
prod2 .Mar 32969.000 32969.000
prod2 .Apr 31684.000 31684.000
prod2 .May 25732.000 25732.000
prod2 .Jun 28546.000 28546.000
prod2 .Jul 111062.000 111062.000
prod2 .Aug 104549.000 104549.000
prod2 .Sep 122797.000 122797.000
prod2 .Oct 145173.000 145173.000
prod2 .Nov 187389.000 187389.000
prod2 .Dec 221340.000 221340.000
prod3 .Jan 32178.000 32178.000
prod3 .Feb 1339.000 1339.000
prod3 .Mar 1089.000 1089.000
prod3 .Apr 990.000 990.000
prod3 .May 641.000 641.000
prod3 .Jun 883.000 883.000
prod3 .Jul 16992.000 16992.000
prod3 .Aug 15631.000 15631.000
prod3 .Sep 18361.000 18361.000
prod3 .Oct 23307.000 23307.000
prod3 .Nov 25414.000 25414.000
prod3 .Dec 35901.000 35901.000
prod4 .Jan 22446.000 22446.000
prod4 .Feb 20362.000 20362.000
prod4 .Mar 21085.000 21085.000
prod4 .Apr 22889.000 22889.000
prod4 .May 23344.000 23344.000
prod4 .Jun 24552.000 24552.000
prod4 .Jul 30075.000 30075.000
prod4 .Aug 35263.000 35263.000
prod4 .Sep 40577.000 40577.000
prod4 .Oct 54152.000 54152.000
prod4 .Nov 49972.000 49972.000
prod4 .Dec 67850.000 67850.000
prod5 .Jan 8199.000 8199.000
prod5 .Jun 3314.000 3314.000
prod5 .Jul 5377.000 5377.000
prod5 .Aug 7556.000 7556.000
prod5 .Sep 9364.000 9364.000
prod5 .Oct 10648.000 10648.000
prod5 .Nov 8036.000 8036.000
prod5 .Dec 14004.000 14004.000
prod6 .Jan 26876.000 26876.000
prod6 .Feb 836.000 836.000
prod6 .Mar 768.000 768.000
prod6 .Apr 451.000 451.000
prod6 .May 542.000 542.000
prod6 .Jun 487.000 487.000
prod6 .Jul 14883.000 14883.000
prod6 .Aug 14773.000 14773.000
prod6 .Sep 26660.000 26660.000
prod6 .Oct 25494.000 25494.000
prod6 .Nov 24283.000 24283.000
prod6 .Dec 39164.000 39164.000
prod7 .Jan 21691.000 21691.000
prod7 .Feb 500.000 500.000
prod7 .Mar 568.000 568.000
prod7 .Apr 333.000 333.000
prod7 .May 467.000 467.000
prod7 .Jun 320.000 320.000
prod7 .Jul 10525.000 10525.000
prod7 .Aug 10702.000 10702.000
prod7 .Sep 15804.000 15804.000
prod7 .Oct 16761.000 16761.000
prod7 .Nov 17447.000 17447.000
prod7 .Dec 28032.000 28032.000
prod8 .Jan 15342.000 15342.000
prod8 .Jun 4725.000 4725.000
prod8 .Jul 5061.000 5061.000
prod8 .Aug 7147.000 7147.000
prod8 .Sep 8104.000 8104.000
prod8 .Oct 8440.000 8440.000
prod8 .Nov 7818.000 7818.000
prod8 .Dec 13069.000 13069.000
prod9 .Jan 7976.000 7976.000
prod9 .Jun 5192.000 5192.000
prod9 .Jul 3920.000 3920.000
prod9 .Aug 3428.000 3428.000
prod9 .Sep 4857.000 4857.000
prod9 .Oct 4000.000 4000.000
prod9 .Nov 4400.000 4400.000
prod9 .Dec 4000.000 4000.000
prod10.Jan 2936.000 2936.000
prod10.Feb 3164.000 3164.000
prod10.Mar 3006.000 3006.000
prod10.Apr 3189.000 3189.000
prod10.May 3649.000 3649.000
prod10.Jun 2853.000 2853.000
prod10.Jul 2486.000 2486.000
prod10.Aug 2569.000 2569.000
prod10.Sep 1667.000 1667.000
prod10.Oct 5146.000 5146.000
prod10.Nov 893.000 893.000
prod10.Dec 2634.000 2634.000
prod11.Jan 7491.000 7491.000
prod11.Feb 8728.000 8728.000
prod11.Mar 8192.000 8192.000
prod11.Apr 7863.000 7863.000
prod11.May 9651.000 9651.000
prod11.Jun 7419.000 7419.000
prod11.Jul 6273.000 6273.000
prod11.Aug 8475.000 8475.000
prod11.Sep 6184.000 6184.000
prod11.Oct 11723.000 11723.000
prod11.Nov 9344.000 9344.000
prod11.Dec 12250.000 12250.000
prod12.Jan 18909.000 18909.000
prod12.Feb 17625.000 17625.000
prod12.Mar 17314.000 17314.000
prod12.Apr 17599.000 17599.000
prod12.May 17602.000 17602.000
prod12.Jun 19503.000 19503.000
prod12.Jul 15122.000 15122.000
prod12.Aug 16061.000 16061.000
prod12.Sep 18849.000 18849.000
prod12.Oct 19854.000 19854.000
prod12.Nov 15986.000 15986.000
prod12.Dec 21299.000 21299.000
prod13.Jan 564755.000 564755.000
prod13.Feb 631290.000 631290.000
prod13.Mar 546298.000 546298.000
prod13.Apr 516362.000 516362.000
prod13.May 497366.000 497366.000
prod13.Jun 559438.000 559438.000
prod13.Jul 501661.000 501661.000
prod13.Aug 616222.000 616222.000
prod13.Sep 602904.000 602904.000
prod13.Oct 735149.000 735149.000
prod13.Nov 635363.000 635363.000
prod13.Dec 1121354.000 1121354.000
prod14.Jan 39609.000 39609.000
prod14.Feb 64066.000 64066.000
prod14.Mar 62365.000 62365.000
prod14.Apr 52663.000 52663.000
prod14.May 52690.000 52690.000
prod14.Jun 57152.000 57152.000
prod14.Jul 46115.000 46115.000
prod14.Aug 63343.000 63343.000
prod14.Sep 57366.000 57366.000
prod14.Oct 61703.000 61703.000
prod14.Nov 63921.000 63921.000
prod14.Dec 91380.000 91380.000
prod15.Jan 114651.000 114651.000
prod15.Feb 110192.000 110192.000
prod15.Mar 88169.000 88169.000
prod15.Apr 109574.000 109574.000
prod15.May 121963.000 121963.000
prod15.Jun 110528.000 110528.000
prod15.Jul 105006.000 105006.000
prod15.Aug 108857.000 108857.000
prod15.Sep 107498.000 107498.000
prod15.Oct 166586.000 166586.000
prod15.Nov 124678.000 124678.000
prod15.Dec 189077.000 189077.000
prod16.Jan 27327.000 27327.000
prod16.Feb 27978.000 27978.000
prod16.Mar 25481.000 25481.000
prod16.Apr 26406.000 26406.000
prod16.May 34403.000 34403.000
prod16.Jun 28022.000 28022.000
prod16.Jul 29013.000 29013.000
prod16.Aug 31849.000 31849.000
prod16.Sep 30579.000 30579.000
prod16.Oct 44572.000 44572.000
prod16.Nov 37828.000 37828.000
prod16.Dec 48539.000 48539.000
prod17.Jan 5304.000 5304.000
prod17.Feb 5699.000 5699.000
prod17.Mar 4751.000 4751.000
prod17.Apr 4616.000 4616.000
prod17.May 5382.000 5382.000
prod17.Jun 5756.000 5756.000
prod17.Jul 4104.000 4104.000
prod17.Aug 4455.000 4455.000
prod17.Sep 4711.000 4711.000
prod17.Oct 6213.000 6213.000
prod17.Nov 5628.000 5628.000
prod17.Dec 8395.000 8395.000
prod18.Jan 44924.000 44924.000
prod18.Feb 40923.000 40923.000
prod18.Mar 35962.000 35962.000
prod18.Apr 36698.000 36698.000
prod18.May 43310.000 43310.000
prod18.Jun 30939.000 30939.000
prod18.Jul 34177.000 34177.000
prod18.Aug 37865.000 37865.000
prod18.Sep 42038.000 42038.000
prod18.Oct 55488.000 55488.000
prod18.Nov 42846.000 42846.000
prod18.Dec 62176.000 62176.000
prod19.Jan 55970.000 55970.000
prod19.Feb 60087.000 60087.000
prod19.Mar 63943.000 63943.000
prod19.Apr 55775.000 55775.000
prod19.May 57827.000 57827.000
prod19.Jun 66551.000 66551.000
prod19.Jul 49348.000 49348.000
prod19.Aug 59475.000 59475.000
prod19.Sep 56998.000 56998.000
prod19.Oct 75269.000 75269.000
prod19.Nov 71235.000 71235.000
prod19.Dec 106759.000 106759.000
prod20.Jan 13732.000 13732.000
prod20.Feb 13110.000 13110.000
prod20.Mar 12258.000 12258.000
prod20.Apr 10672.000 10672.000
prod20.May 14122.000 14122.000
prod20.Jun 13364.000 13364.000
prod20.Jul 8775.000 8775.000
prod20.Aug 11166.000 11166.000
prod20.Sep 10685.000 10685.000
prod20.Oct 13236.000 13236.000
prod20.Nov 10607.000 10607.000
prod20.Dec 17867.000 17867.000
prod21.Jan 11182.000 11182.000
prod21.Feb 12636.000 12636.000
prod21.Mar 12320.000 12320.000
prod21.Apr 10581.000 10581.000
prod21.May 13142.000 13142.000
prod21.Jun 11819.000 11819.000
prod21.Jul 9161.000 9161.000
prod21.Aug 10149.000 10149.000
prod21.Sep 11643.000 11643.000
prod21.Oct 15573.000 15573.000
prod21.Nov 14119.000 14119.000
prod21.Dec 19339.000 19339.000
prod22.Jan 7558.000 7558.000
prod22.Feb 8530.000 8530.000
prod22.Mar 8477.000 8477.000
prod22.Apr 11232.000 11232.000
prod22.May 14968.000 14968.000
prod22.Jun 15346.000 15346.000
prod22.Jul 11485.000 11485.000
prod22.Aug 13002.000 13002.000
prod22.Sep 13287.000 13287.000
prod22.Oct 20442.000 20442.000
prod22.Nov 17984.000 17984.000
prod22.Dec 24571.000 24571.000
I hope this helps!
Fred