Hi,
I have a very basic question as I am not an experienced User in GAMS, but I couldn't figure this one out.
Does anyone know, how to write this in GAMScode? My problem is to include the j<>i correctly.
Best regards
How to write this constraint in GAMS Code? Topic is solved
How to write this constraint in GAMS Code?
- Attachments
-
- 2019-09-30 15_12_12-Raviv2013_Article_StaticRepositioningInABike-sha.pdf - Adobe Acrobat Reader DC.jpg (7.21 KiB) Viewed 4748 times
-
- User
- Posts: 118
- Joined: 7 years ago
- Location: Rosario - Argentina
Re: How to write this constraint in GAMS Code?
Hi, I guess you have to define the set, subset and alias.
for example:
for example:
Code: Select all
sets
i /i1*i10/
v /v1*v10/
N0(i) /i1,i3,i4,i5/
;
alias(i,j);
eq(i,v)$N0(i).. sum(j$(N0(j) and ord(j) ne ord(i)),x(i,j,v)) =e= sum(j$(N0(j) and ord(j) ne ord(i)),x(j,i,v))
Re: How to write this constraint in GAMS Code?
Hi
You could also use instead of .
Cheers
Renger
You could also use
Code: Select all
$(not sameas(i,j))
Code: Select all
$(ord(i) ne ord(j))
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Re: How to write this constraint in GAMS Code?
I thank both of you for your quick and helpful answers!