Formulation of a constriaint equation.

Problems with modeling
Post Reply
MRizzo
User
User
Posts: 1
Joined: 4 years ago

Formulation of a constriaint equation.

Post by MRizzo »

Hi, Thanks in advance, Recently i've been working on a university problem in which i need to allocate the optimun schedule for some clases, my only inconvinient is one constriaint, which is the following

Having a set of:

S : students "s" of the Uni
C : Classes "c" of the uni"
and the binary variable
Ysc: 1 if student "s" can attend office Hour for class "c"
The constraint is attached on the image This constraint serves the function of ensuring that if a student is enrolled in another class , and
that class is offered during the same time period as the office hour time period considered for
class , then the student cannot attend the office hour for the considered time.
Captura.PNG
Captura.PNG (6.78 KiB) Viewed 1740 times
How can i model this ?
Last edited by MRizzo 4 years ago, edited 1 time in total.
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Formulation of a constriaint equation.

Post by Renger »

Hi
I assume that the problem is in the c' not equal to c. You can do this with an if condition:

Code: Select all


equation eq_sum(c,s)
alias(c, cc);

eq_sum(c,sc)
  ....   - sum(cc$(not sameas(cc,c), ... 

Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply