Hi Renger

Thank you for your help. I’ll try to make the problem clear

–The problem is " Exams scheduling in an university"

–The set “i” indicate the indexes for courses ( for example for the course “Dynamic programming” i is equal to 1, for “Econometric” i = 2 and so on)

–For each course, due to the number of registered students, we may have two or more codes which ( set c ), for example if the capacity of the class for the econometric is 10 and 14 students register for the class, we have code 1 and code 2 for econometric.

– There are 3 groups of students ( based on which semester they are experiencing and j=1,2,3) For example for the first group, 3 different courses are available ( i=1,2,3) and for the second one, 4 courses are availbe ( i= 4,5,6,7) and so on

– We have a set called Ij which indicates the available courses for student group j ( for example I1= 1,2,3 as I said before )

– There is a set called Ci which indicates the available codes for course j ( for example if i=1(econometric), C1=1,2)

How can I define a set like Ci ?so in a constraint, when i=1 , Ci should return 1,2 , In other words, C(‘1’)= /1,2/

I attach the paper that I’m trying to write the model for to make the problem more clear

From: renger@vannieuwkoop.ch

To: gamsworld@googlegroups.com

Subject: RE: AW: related sets

Date: Mon, 12 Jan 2015 10:37:11 +0000

Hi Bahman

Here you can see the techniques used: â€œordâ€ as well as â€œsameasâ€. You might have to adjust it slightly to your needs.

Next time it would be better to send also the relevant Gams code (with the definitions of the sets and your attempts of the equation, because this would make it much easier to find an answer and test the possible solution)

Cheers

Renger

Alias(c,cc), (f,ff);

Eq19_3(f,ff,b)$(ord(f) lt ord(ff))…

sum((i,c), z(i,c,b,f)) =L= M sum((i,c), z(i,c,b,ff));

(based on your wish to have a set l that lags 1 and 2 periods with regard to t, not with regard to the equation you send).

Eq17_3(i,j)$(ord(l) >2)…

Sum((s,t)(not sameas(s,i)), x(s,j,t-2,t) =L= (1 â€“ sum(t, x((i,j,t-1,t) * M);
\
\
\
Eq7_3(i,c,cc,b)(not sameas(c,ss) …

Sum(f, z(i,c,b,f) = sum(f, z,i,cc,b)

Cheers

Renger

From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Bahman Alipour Shandiz

Sent: Sonntag, 11. Januar 2015 21:22

To: gamsworld@googlegroups.com

Subject: RE: AW: related sets

Thanks for your reply

This is the link of my previous question, I’ve uploaded the constraints there

https://groups.google.com/forum/#!searchin/gamsworld/bahman$20alipourr/gamsworld/f5LtplbOcR8/DGyIWEpXIJ4J

From: renger@vannieuwkoop.ch

To: gamsworld@googlegroups.com

Subject: AW: related sets

Date: Sun, 11 Jan 2015 19:25:56 +0000

Hi Bahman

Send the constraint, because it is not clear from your question how this second set is used in the constraint.

Renger

Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Bahman Alipour

Gesendet: Sunday, January 11, 2015 03:05

An: gamsworld@googlegroups.com

Betreff: related sets

Hello,

In my model, I have a set of days which is shown by t /t1*t10/ , Also I have another set which is related to set t. I mean, in the constraints, for example when t=t1 the second set should return {1,2} , if t=t2, the second set should return {2,3} and so on.

I tried this one :

set

t /t1*t10/

rt(t1) /1,2/;

but apparently it does not work, can anybody help me please?

–

2251-712X-8-28.pdf (479 KB)