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.
How can i model this ?
Formulation of a constriaint equation.
Formulation of a constriaint equation.
Last edited by MRizzo 4 years ago, edited 1 time in total.
Re: Formulation of a constriaint equation.
Hi
I assume that the problem is in the c' not equal to c. You can do this with an if condition:
Cheers
Renger
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), ...
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