writing constraints

Problems with syntax of GAMS
Post Reply
mlftx
User
User
Posts: 5
Joined: 1 year ago

writing constraints

Post by mlftx »

How can I write this on GAMS? Take into account that kp is an alias of k so: alias(k,kp).
Image
Tatjana
User
User
Posts: 8
Joined: 5 years ago

Re: writing constraints

Post by Tatjana »

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;
Post Reply