Question: my lingo code is not running ( solving ) please correct it for me and provide me the runnable code: SETS: TIME / 1 .

my lingo code is not running (solving) please correct it for me and provide me the runnable code:
SETS:
TIME /1..4/;
! Define parameters for each period directly;
DATA:
Demand(1) :=200;
Demand(2) :=250;
Demand(3) :=230;
Demand(4) :=210;
! Define constants;
SetupCost :=500;
UnitProdCost :=15000;
HoldingCost :=500;
VARIABLES:
Q(TIME)>=0; ! Number of cars to be produced in each period;
I(TIME)>=0; ! Inventory level at the end of each period;
z(TIME) binary; !1 if production is initiated, 0 otherwise;
! Objective function to minimize total costs;
MIN = @SUM(TIME: SetupCost * z(TIME)+ UnitProdCost * Q(TIME)+ HoldingCost * I(TIME));
! Inventory balance constraints;
@FOR(TIME:
IF(TIME =1) THEN
I(1)= Q(1)- Demand(1);
ELSE
I(TIME)= I(TIME-1)+ Q(TIME)- Demand(TIME);
ENDIF;
);
! Ordering link constraint ensuring that orders only occur if indicated by z(TIME);
@FOR(TIME:
Q(TIME)<=10000* z(TIME);
);
! Set initial inventory to zero;
I(0) :=0;
MODEL:
END;

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!