How can I write this on GAMS? Take into account that kp is an alias of k so: alias(k,kp).
writing constraints
Re: writing constraints
Hi mlftx.
Please specify your question by giving some example of what you want to do. The image that you attached is - at least for me - not visible.
Just guessing, you might benefit from reading about Conditional Expressions, Assignments and Equations:
https://www.gams.com/latest/docs/UG_CondExpr.html
Thereby you can, for instance, make an assignment that only happens under certain constraints. Try out this code to get an idea:
Set
facility /facility1, facility2, facility3/
harbour /harbour1, harbour2/
facility_to_harbour(facility,harbour)
/facility1.harbour1 YES
facility2.harbour2 YES
facility3.harbour2 YES/;
Parameter quantity(facility,harbour);
quantity(facility,harbour)$facility_to_harbour(facility,harbour) = 3;
Display facility_to_harbour, quantity;
Please specify your question by giving some example of what you want to do. The image that you attached is - at least for me - not visible.
Just guessing, you might benefit from reading about Conditional Expressions, Assignments and Equations:
https://www.gams.com/latest/docs/UG_CondExpr.html
Thereby you can, for instance, make an assignment that only happens under certain constraints. Try out this code to get an idea:
Set
facility /facility1, facility2, facility3/
harbour /harbour1, harbour2/
facility_to_harbour(facility,harbour)
/facility1.harbour1 YES
facility2.harbour2 YES
facility3.harbour2 YES/;
Parameter quantity(facility,harbour);
quantity(facility,harbour)$facility_to_harbour(facility,harbour) = 3;
Display facility_to_harbour, quantity;