Hello Everyone,

I am currently working on a project where I am using the GAMS 41.5.0 to create a model for optimizing production scheduling. While defining the constraints for my model, I encountered some errors in lines 97 to 101 which I am unable to resolve. Here is a snippet of the problematic part of the code:

96 inventoryBalance(p,s,t)…

97 I(t,p,s) =e= I(t-1,p,s) + X(t,p,s) - sum(s_1$(s_1 = sPrec(p,s) and s_1<>s), X(t-rt(s,s_1),p,s_1)*a(p,s)) - d(t,p,s);

**** $148,135 148,135,148,135
98
99
100 productionSynchronization(p,s,s_1,t)(s_1<>s and s_1 = sPrec(p,s))…

**** $148,135,148,135,148,135

101 a(p,s)*X(t,p,s) =l= X(t-rt(s,s_1),p,s_1)*a(p,s_1);

The error messages I am receiving are:

Error 135: Incompatible operands for the relational operator.

Error 148: Dimension different - The symbol is referenced with more/less indices as declared.

I suspect that the issue might be related to the way I have structured the conditional statements inside the sum functions and the relational operators used in the equations.

I am having trouble formulating these constraints correctly to avoid these errors. Could anyone please assist me in correcting the formulation of these constraints to adhere to the proper syntax and logic?

Complete Code is in the Attachments

Thank you for your time and assistance!

Final_model_An improved model and heuristic for capacitated lot-sizing and scheduling in job shop problems.gms (5.59 KB)