New constraint "Activities occupy max time slots from selection"

Started by Christian Kemmer, January 28, 2012, 10:48:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Christian Kemmer

Hello,

I have one question regarding the new constraint "Activities occupy max time slots from selection"

What I want to do is the following:
I have six sub-activities with a duration of two hours in a group of students. At least one of these activities should be placed on Wednesday during the first 6 hours. This results in less different subjects for students on Wednesday, because they only have five or less activities in these six hours as the activity mentioned above has a duration of two hours.

I tried the following:
1. Create a new constraint "Activities occupy max time slots from selection"
2. Select the six activities with a duration of two hours
3. Switch to the second tab ("Time slots")
4. Now, I select all but the first six hours on Wednesday.
5. Enter "5" in "Max occupied

Is this a correct usage of that constraint? For me, it always results in unresolvable timetables, so I have deactivated the constraint. It might be unhappy coincidence, but perhaps I understood something wrong.

And one additional question to the GUI: Wouldn't it be better, if the unselected (empty / green-colored) cells are those, where the "Max occupied" activities should be placed?

Regards,

Christian Kemmer

Liviu Lalescu

Quote from: Christian Kemmer on January 28, 2012, 10:48:24 AM
Hello,

I have one question regarding the new constraint "Activities occupy max time slots from selection"

What I want to do is the following:
I have six sub-activities with a duration of two hours in a group of students. At least one of these activities should be placed on Wednesday during the first 6 hours. This results in less different subjects for students on Wednesday, because they only have five or less activities in these six hours as the activity mentioned above has a duration of two hours.


'five' -> you mean four? Because the activity takes 2 hours from 6.

Sorry, I understood now what you mean: on Wednesday, in the first 6 hours, the students will have at most 5 activities.

Quote

I tried the following:
1. Create a new constraint "Activities occupy max time slots from selection"
2. Select the six activities with a duration of two hours
3. Switch to the second tab ("Time slots")
4. Now, I select all but the first six hours on Wednesday.
5. Enter "5" in "Max occupied

Is this a correct usage of that constraint? For me, it always results in unresolvable timetables, so I have deactivated the constraint. It might be unhappy coincidence, but perhaps I understood something wrong.


5. Enter '5x2=10' in Max occupied. 5 activities each with duration 2 occupy 10 slots.

Quote

And one additional question to the GUI: Wouldn't it be better, if the unselected (empty / green-colored) cells are those, where the "Max occupied" activities should be placed?


It seems more intuitive to me as it is (X=selected). Plus: X is for break/not available/not allowed. So, X constrains something. Also in this constraint (activities occupy max time slots) it constrains these slots marked with X, not the empty ones.

Volker Dirr

Quote from: Christian Kemmer on January 28, 2012, 10:48:24 AM
What I want to do is the following:
I have six sub-activities with a duration of two hours in a group of students. At least one of these activities should be placed on Wednesday during the first 6 hours. This results in less different subjects for students on Wednesday, because they only have five or less activities in these six hours as the activity mentioned above has a duration of two hours.

Maybe I missunderstood, but i think it is easier to enter (and faster for the algorithm?) to set an activity tag to the activities with duration 2. (use modify subactivities. maybe call the tag "duartion 2").
then add a constraint a preferd times for the new activity tag. disallow all days, except wednesday hour 1-6.

Liviu Lalescu

Quote from: Volker Dirr on January 28, 2012, 05:49:22 PM
Quote from: Christian Kemmer on January 28, 2012, 10:48:24 AM
What I want to do is the following:
I have six sub-activities with a duration of two hours in a group of students. At least one of these activities should be placed on Wednesday during the first 6 hours. This results in less different subjects for students on Wednesday, because they only have five or less activities in these six hours as the activity mentioned above has a duration of two hours.

Maybe I missunderstood, but i think it is easier to enter (and faster for the algorithm?) to set an activity tag to the activities with duration 2. (use modify subactivities. maybe call the tag "duartion 2").
then add a constraint a preferd times for the new activity tag. disallow all days, except wednesday hour 1-6.

A single subgroup has 6 activities with duration 2 (and different subjects and teachers for them, so they are not equivalent) and other activities. Christian Kemmer wants that at least one activity from those 6 to be placed on Wed in the first 6 hours. So he needs constraint activities occupy max time slots from selection.

Christian Kemmer

Thanks a lot for your help. Liviu is right: I cannot use the activity tag, because then I decide by myself, which activity should be placed on Wednesday. I just didn't read the help text carefully enough, so I did not enter the number of time "slots" (!). Now, everything works fine.

Best regards,

Christian