exponents of a dynamic set

Hi everybody
I have these sets on a network:
set n nodes /1*10/
a(n,n) arcs;
set arcs has been evaluated and now in a constraint say f(a), I need to access to the second element of arc ‘a’ (Since a=(i,j) is an arc and I need to point to ‘j’ ) , and I don’t know what to do. Can anyone help me?
best: Maria


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/1WzRHzcNrYcJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Maria



Here is an example for using a, I, and j in a network model



focX(a(i,j))… TAU(a) + TOLL(a)+ T(j) =g= T(i);



as you can see, T is defined over I or j.





Hope this helps



Cheers

Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Maria a. Rad
Gesendet: Donnerstag, 1. November 2012 13:19
An: gamsworld@googlegroups.com
Betreff: exponents of a dynamic set



Hi everybody
I have these sets on a network:
set n nodes /1*10/
a(n,n) arcs;
set arcs has been evaluated and now in a constraint say f(a), I need to access to the second element of arc ‘a’ (Since a=(i,j) is an arc and I need to point to ‘j’ ) , and I don’t know what to do. Can anyone help me?
best: Maria


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/1WzRHzcNrYcJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Renger
thanks for ur time. Since I do not piont to the exponents of the dynamic set in my constraint, this way does not work. This is the exact constraint:

set n nodes /1*10/
a(n,n) arcs;

  • here a(n,n) is evaluated as:
    n1 n2 n3 n4 n5

n1 YES YES YES
n2 YES YES YES
n3 YES YES YES YES
n4 YES YES YES
n5 YES YES YES

f(n,a) . . Z(n,a)+ y(?) =e=0;
In which ‘?’ means the second exponent of a something like ord(a(*,2)) (which is not correct!)
Cheers
Maria


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/LH4CAI10AqAJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Maria



I do not quite understand what Z(n,a) could be. Usually you have the flow on an arc, defined as f(a), but Z(n,a) refers to a node and some arc (but not necessarily the arc connecting to n).

I think you really want to have Z(a), but that is up to you.



Anyway, this would work in your setting (you cannot define Z as Z(a,n), because a is an assigned set, so you have to define it over all I,j. This is not a problem as the equation can be declared over a (e.g. f(n,a(I,j)).



set n nodes /n1*n10/

a(n,n) arcs;



table arcs(n,n)

n1 n2 n3 n4 n5



n1 1 1 1

n2 1 1 1

n3 1 1 1 1

n4 1 1 1

n5 1 1 1

;



alias(n,i,j);

a(i,j)= YES$arcs(i,j);



alias(n,i,j);



variables

Z(n,i,j),

y(n);



equation f(n,i,j);



f(n,a(i,j))…

Z(n,a)+ y(j) =G= 0 ;



Cheers


Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Maria a. Rad
Gesendet: Donnerstag, 1. November 2012 19:49
An: gamsworld@googlegroups.com
Betreff: Re: exponents of a dynamic set



Hi Renger
thanks for ur time. Since I do not piont to the exponents of the dynamic set in my constraint, this way does not work. This is the exact constraint:

set n nodes /1*10/
a(n,n) arcs;

  • here a(n,n) is evaluated as:
    n1 n2 n3 n4 n5

n1 YES YES YES
n2 YES YES YES
n3 YES YES YES YES
n4 YES YES YES
n5 YES YES YES

f(n,a) . . Z(n,a)+ y(?) =e=0;
In which ‘?’ means the second exponent of a something like ord(a(*,2)) (which is not correct!)
Cheers
Maria


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/LH4CAI10AqAJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

哦。

发自我的 iPad

在 2012-11-2,15:12,Renger van Nieuwkoop 写道:

Hi Maria



I do not quite understand what Z(n,a) could be. Usually you have the flow on an arc, defined as f(a), but Z(n,a) refers to a node and some arc (but not necessarily the arc connecting to n).

I think you really want to have Z(a), but that is up to you.



Anyway, this would work in your setting (you cannot define Z as Z(a,n), because a is an assigned set, so you have to define it over all I,j. This is not a problem as the equation can be declared over a (e.g. f(n,a(I,j)).



set n nodes /n1*n10/

a(n,n) arcs;



table arcs(n,n)

n1 n2 n3 n4 n5



n1 1 1 1

n2 1 1 1

n3 1 1 1 1

n4 1 1 1

n5 1 1 1

;



alias(n,i,j);

a(i,j)= YES$arcs(i,j);



alias(n,i,j);



variables

Z(n,i,j),

y(n);



equation f(n,i,j);



f(n,a(i,j))…

Z(n,a)+ y(j) =G= 0 ;



Cheers


Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Maria a. Rad
Gesendet: Donnerstag, 1. November 2012 19:49
An: gamsworld@googlegroups.com
Betreff: Re: exponents of a dynamic set



Hi Renger
thanks for ur time. Since I do not piont to the exponents of the dynamic set in my constraint, this way does not work. This is the exact constraint:

set n nodes /1*10/
a(n,n) arcs;

  • here a(n,n) is evaluated as:
    n1 n2 n3 n4 n5

n1 YES YES YES
n2 YES YES YES
n3 YES YES YES YES
n4 YES YES YES
n5 YES YES YES

f(n,a) . . Z(n,a)+ y(?) =e=0;
In which ‘?’ means the second exponent of a something like ord(a(*,2)) (which is not correct!)
Cheers
Maria


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/LH4CAI10AqAJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.