Search found 6 matches

by SvenTH
1 month ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 322

Re: Problems with looping and indices

Hi all, Hi Renger, this is even closer, but index 'trips' doesn't count up if there is another tour starting in 'i1'. I just took a second tour in your code: Sets i 'locations' / i1 * i9 /; alias (i,j); set trips /1*2/; parameter xt(i,j,trips), x(i,j); variable nexti; x('i1','i2') = 1; x('i2','i6') ...
by SvenTH
1 month ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 322

Re: Problems with looping and indices

Hi all, Hi Renger, thanks again for your help. At least, your soultion is close, but not exactly what I want to do. Index 'trips' should only increase, if there is another trip starting in node 'i1'. In this case, there should only be one trip which is i1 - i2 - i6 - i3 - i5 - i9 - i4 - i1. Hope you...
by SvenTH
1 month ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 322

Re: Problems with looping and indices

Hi all, Hi Renger, thank you very much for your reply! This code works well if I just jump back once, but I need to jump back for several times. I copied one of these trips in your code but didn't manage to get the right xt by now. Do you have an idea how to solve this issue? My trip looks like i1 -...
by SvenTH
1 month ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 322

Re: Problems with looping and indices

Hi all, Hi Renger at least, there is still a little issue. If my delivering route is not in a sorted row like i1 - i2 - i3 - i5 - i1 but maybe i1 - i2 - i5 - i3 - i1 then Parameter xt looks like: INDEX 1 = v1 t1 i1.i2 1.000 i2.i5 1.000 This apparently is because nexti (in this case 'i3') is smaller ...
by SvenTH
1 month ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 322

Re: Problems with looping and indices

Hi Renger,

works perfectly, thanks a lot!

Regards
Sven
by SvenTH
1 month ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 322

Problems with looping and indices

Hi all, i am new to GAMS and try to implement a complex vehicle routing problem. I did quite well but one thing isn't working at all: There is routing variable x(i,j,t) which has location indices i and j, and index for time period t. Later in my code I want to add a vehicle index v to this, so i hav...