Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If statement with constraint #49

Open
gabarlacchi opened this issue Jan 30, 2017 · 2 comments
Open

If statement with constraint #49

gabarlacchi opened this issue Jan 30, 2017 · 2 comments

Comments

@gabarlacchi
Copy link

Hi,
I'have a problem with a particularly constraint on my CSP problem.
My decision variable is a matrix, and i apply some constraints. One of this is:
for e in range(exams):
for a in range(columns):
for y in range(exams):
if y != e:
if time_table[y,a] > time_table[e,a]: #time_table -> decision matrix
model += time_table[e,a] >= time_table[e,a] + exams_duration[e];
It doesn't work. I saw that the problem is within the IF statement. I would like to know what i'm doing wrong. My problem is "scheduling exams in a period with a number of rooms (moreover exams_duration, rooms_capacity and so on)". I have to force that an exams scheduled in a particularly time, start after the duration of the previous exams, if it exists.
thanks for the help,
Regards
Gabriele

@ehebrard
Copy link
Collaborator

ehebrard commented Jan 30, 2017 via email

@gabarlacchi
Copy link
Author

It works! thank you very much for the quick answer, very nice.
Cheers
Gabriele

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants