Question: model ModelName uses mmxprs declarations weeks = 1 . . 1 0 worker = 1 . . 9 0 HClassic : array (

model ModelName
uses "mmxprs"
declarations
weeks =1..10
worker =1..90
HClassic : array(weeks) of real
HTouch : array(weeks) of real
BClassic : array(weeks) of real
BTouch : array(weeks) of real
Pslow : array(weeks) of real
Pfast : array(weeks) of real
Ct : array(weeks) of real
DClassic : array(weeks) of real
DTouch : array(weeks) of real
IlevelC : array(weeks) of mpvar
IlevelT : array(weeks) of mpvar
IonhandC : array(weeks) of mpvar
IonhandT : array(weeks) of mpvar
BackorderC : array(weeks) of mpvar
BackorderT : array(weeks) of mpvar
ProductionC : array(weeks) of mpvar
ProductionT : array(weeks) of mpvar
Overtime : array(weeks,worker) of mpvar
Qfast : array(weeks) of mpvar
Qslow : array(weeks) of mpvar
Stock : array(weeks) of mpvar
obj:linctr
end-declarations
HClassic :: [0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,50]
HTouch :: [0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,120]
BClassic :: [0.50,0.50,0.50,0.50,0.50,0.50,0.50,0.50,0.50,40]
BTouch :: [0.70,0.70,0.70,0.70,0.70,0.70,0.70,0.70,0.70,100]
Pslow :: [24,24,24,24,18,18,18,18,18,18]
Pfast :: [36,36,36,36,36,36,36,36,36,36]
Ct :: [2700,2700,2700,2700,2700,2700,2700,2700,2700,2700]
DClassic :: [28224,28597,29356,29591,30383,30934,31086,31410,31793,32257]
DTouch :: [12053,11941,12235,12270,12326,12389,12466,12536,12620,12732]
!IlevelC in week0=1900
ProductionC(1)=25000
IlevelC(1)=1900+ ProductionC(1)- DClassic(1)
forall(t in 2..10) IlevelC(t)= IlevelC(t-1)+ ProductionC(t)- DClassic(t)
!IlevelT in week0=1300
ProductionT(1)=15000
IlevelT(1)=1300+ ProductionT(1)- DTouch(1)
forall(t in 2..10) IlevelT(t)= IlevelT(t-1)+ ProductionT(t)- DTouch(t)
forall(t in weeks) IlevelC(t)= IonhandC(t)+ BackorderC(t)
forall(t in weeks) IlevelT(t)= IonhandT(t)+ BackorderT(t)
forall(t in weeks)4*ProductionC(t)+8*ProductionT(t)<=90*Ct(t)+ sum(n in worker)Overtime(t,n)
!Stock(0)=2000
!Qslow(0)=40000
!Qslow(-1)=40000
Stock(1)=2000+ Qfast(1)+40000- ProductionC(1)- ProductionT(1)
Stock(2)= Stock(1)+ Qfast(2)+40000- ProductionC(2)- ProductionT(2)
forall(t in 3..10) Stock(t)= Stock(t-1)+ Qfast(t)+ Qslow(t-2)- ProductionC(t)- ProductionT(t)
forall(t in weeks, n in worker) Overtime(t,n)<=300
forall(t in weeks) Qslow(t)<=40000
obj:=sum(t in weeks)IonhandC(t)*HClassic(t)+ sum(t in weeks) IonhandT(t)*HTouch(t)+
sum(t in weeks) BackorderC(t)*BClassic(t)+ sum(t in weeks) BackorderT(t)*BTouch(t)+
sum(t in weeks)(0.3875*sum(n in worker) Overtime(t,n))+ sum(t in weeks) Qfast(t)*Pfast(t)+
sum(t in weeks) Stock(t)*0.20+ sum(t in weeks) Qslow(t)*Pslow(t)
minimize(obj)
writeln("Begin running model")
writeln("Optimal Value is: ", getsol(obj))
forall(t in weeks)
writeln("ProductionC(",t,")=",getsol(ProductionC(t)))
forall(t in weeks)
writeln("ProductionT(",t,")=",getsol(ProductionT(t)))
forall(t in weeks)
writeln("IlevelC(",t,")=",getsol(IlevelC(t)))
forall(t in weeks)
writeln("IlevelT(",t,")=",getsol(IlevelT(t)))
forall(t in weeks)
writeln("IonhandC(",t,")=",getsol(IonhandC(t)))
forall(t in weeks)
writeln("IonhandT(",t,")=",getsol(IonhandT(t)))
forall(t in weeks)
writeln("BackorderC(",t,")=",getsol(BackorderC(t)))
forall(t in weeks)
writeln("BackorderC(",t,")=",getsol(BackorderT(t)))
forall(t in weeks)
writeln("Stock(",t,")=",getsol(Stock(t)))
forall(t in weeks)
writeln("Qfast(",t,")=",getsol(Qfast(t)))
forall(t in weeks)
writeln("Qslow(",t,")=",getsol(Qslow(t)))
writeln("End running model")
end-model
Why this Xpress code does not working. It gives 0 for all values. Can you fix it?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!