Model Debugging

Dear All,

I wrote the attached model below, but I got an infeasible integer solution and am working on debugging the model.
Thesis Model Replication.gms (9.78 KB)
In the pre-solve stage, I got the below error.
image.png
So, I thought I was missing indicating in the constraint that (j, i)∈A_j^- and j ∈ S. My question is, how to write these two conditions in the constraint?
image.png
But when I’m using the dollar option, it gives me error 148.
image.png
Would someone help me to solve this condition?

I really appreciate any help you can provide.

Dear All,

I’ll appreciate any guidance on the above topic.

Best Regards
Omar

I couldn’t be familiar in your code, but, as I know, if you want to use a set indices in the $ condition, you should use with “ord”.
For example;

sum(i$(ord(AMinus) > 5), x(i,j)) .....etc

Because you defined “AMinus” as a set. (but, still, I am not quite sure this is what you mean)
But, I dont know how you can write the condition for “∈”.

Send you entire model, so we can reproduce. Looking at the equation in isolation makes no sense. We don’t even know what Aminus is in your code. -Michael

I added it in the first post, but kindly find it attached

Thanks for your support
Thesis Model Replication.gms (9.8 KB)