Hello guys,
We are working on our graduation thesis which is called 'Network Planning Location Model for Turkey Railway Freight Transportation'. We try to set our model on GAMS. While writing the model on GAMS, we could not write the difference sign (\) in GAMS. In the attachment, you can see the picture of the difference sign with the equation l E C \ {j}. I will be appreciated if you help us.
Kind regards,
How to write Difference Sign in GAMS?

 User
 Posts: 1
 Joined: 9 months ago
How to write Difference Sign in GAMS?
 Attachments

 MicrosoftTeamsimage (8).png (4.68 KiB) Viewed 2114 times
Re: How to write Difference Sign in GAMS?
Hi,
Assuming your set C contains the elements {i,j,k,l}, and j is just an element. Then, you can write the following:
Assuming your set C contains the elements {i,j,k,l}, and j is just an element. Then, you can write the following:
Code: Select all
sum(C$(not C('j')), function_here)
Re: How to write Difference Sign in GAMS?
This is not exactly doing what was asked for. If C('j') exists this will result in not summing over any elements in C. I think what isinsuyildiz is looking for is teh followingO'Jhene wrote: ↑8 months agoHi,
Assuming your set C contains the elements {i,j,k,l}, and j is just an element. Then, you can write the following:
Code: Select all
sum(C$(not C('j')), function_here)
Code: Select all
sum(C$(not sameas(C,'j')), function_here)
Fred
Re: How to write Difference Sign in GAMS?
Ah I see. That's interesting. Thanks!