A simple question about modeling with lingo Error Code: 63

15 views Asked by At

I would like to model the scheduling of a latex glove production line. The purpose of the model is to solve for how many different types of glove molds make the most sense to place on each glove line. Here are the parts of my model that are relevant to my problem , where the attribute "sizetest" is used to represent the size of each mold. When I click "solve" , lingo reports an error for the bold letter part of the code: "Model is ill defined , Check for undefined indices and/or conditions in expression : ……" error code The rest of my code is working fine. Thank you in advance.

MODEL: 
SETS: 
route:……; 
line:…… ; 
mould:……, sizetest; 
……; 
output(mould,line):solution;
output2(route,line):solution2; 
……; 
ENDSETS 

DATA: 
glove,line,mould,sizetest,……=@ole('D:\……\APS.xls'); 
……; 
ENDDATA

!Objective function: minimize the use of production lines; 
min = @sum(line(L):@if(@sum(mould(M):solution(M,L)) #GT# 0,1,0)); 

!The difference in size between the largest and smallest molds installed on each line is no more than 2 sizes.; 
**@for ( line(L) |@sum(route(R) :solution2 ( R,L ) ) #GT# 0: ( @max ( mould(M) | solution(M,L) #GT# 0 : @sum (  size(S) : mouldsize( M,S ) ) ) - @min ( mould(M) | solution(M,L) #GT# 0 : @sum ( size(S) : mouldsize( M,S ) ) ) )  <= 10 ); **

!The production period for each type of glove does not exceed the delivery period;
……;


!The number of installations of each mold does not exceed the existing stock level; 
……;

!Only one process route can be implemented per line; 
……;

!The number of molds installed per line does not exceed the capacity of the line; 
……; 
END

If I read in the results of solution and solution2 as known conditions from Excel and then add the following snippet to the DATA section, it displays properly:

@text() =  @writefor (line(L) | @sum(mould(M) :solution ( M,L )  ) #GT# 0: 'Line',L,'MaxSize:' , @max (  mould(M) | solution ( M,L )  #GT# 0: sizetest(M) ) ,@NEWLINE(1)  );
0

There are 0 answers