Hi again! This is my first post of the year.
My timetable has 6 lessons per day. One teacher has 5 subactivities (A, B, C, D, and E) in one week that have duration = 2. The teacher also has many other activities with duration = 1. I want to ensure that on one day of the week (which day does not matter), the teacher's timetable consists of three subactivities each with duration = 2, and that two of those subactivities are A and B. The third one can be C, D, or E, I do not care which. The order of the subactivities within the day does not matter.
I know that I can use three activities grouped if I chose which three subactivities I want, say A, B, and C, but that limits the number of possible solutions because I also want to permit A, B, and D, as well as A, B, and E. Is there a way to do what I want to do? Maybe with tricks?
Thanks!
To quickly add: I had considered using activities occupy max time slots from selection, but I think that would restrict the day on which the three activities with duration 2 occur to a specific day of the week, where I want to allow them to be on any day of the week.
I hope I have some great news. Vangelis Karafillidis (http://lalescu.ro/liviu/fet/forum/index.php?action=profile;u=1746) showed me some nice tricks for your problem:
Add a dummy teacher (DUMMY_TEACHER), having an activity with duration 6, subject DUMMY_SUBJECT.
Add a constraint activities occupy max time slots from selection, DUMMY_SUBJECT and A and B, max occupied = 6, all slots of the week. This will make A and B be in the same day and leave only 2 hours for teacher T (your real teacher).
Then add a second constraint activities occupy max time slots from selection, DUMMY_SUBJECT, and C, D, and E, max occupied = 10, all slots of the week. This will make two from C, D, and E be on other days and one of them be on the same day as DUMMY_SUBJECT, so on the same day as A and B (because this day has 4 hours occupied with A and B for teacher T.
I attach an example .fet file.
Ah yes, I think this will work! I had to make one change, please let me know if you think it will still be OK: my day has breaks in it, so instead of DUMMY_TEACHER having one activity of duration = 6, I had three subactivities, each duration = 2 and forced them to be on the same day using a set of activities has the same starting day. That will still work, right?
I think it is equivalent.
Quote from: ChicagoPianoTuner on April 28, 2016, 12:14:25 PM
Ah yes, I think this will work! I had to make one change, please let me know if you think it will still be OK: my day has breaks in it, so instead of DUMMY_TEACHER having one activity of duration = 6, I had three subactivities, each duration = 2 and forced them to be on the same day using a set of activities has the same starting day. That will still work, right?
Maybe, you could to something little simpler:
Create the DUMMY_TEACHER, create a DUMMY_ACTIVITY for him with duration 2 (split = 1). Then go to "a set of activities has same starting day (any hours)" and select TEACHER's activities A and B, along with DUMMY_TEACHER's DUMMY_ACTIVITY.
Then go to "a set of activities occupies max time slots from selection", select TEACHER's activities C, D and E, along with DUMMY_TEACHER's DUMMY_ACTIVITY. Then select all time slots and set Max Occupied (slots) = 6. For all the above the weight should be 100%. I think this works... But, test it!
I think that would be equivalent. Do you think it would be easier for FET one way vs another? My timetable is already very complicated and takes several hours to complete.
I mean easier for you (maybe). I don't know what is easier for FET. Maybe Liviu or Volker can respond...
I am not sure :)
Okay, well, thanks for the help both of you. I have already used that trick in two other places in my timetable - it's nice to learn new things! The second use works like this:
Two of our secondary maths teachers provide support for the primary school. The secondary maths teachers have 4 lessons each to provide support. The primary teachers have group planning sessions for 3 lessons per week, and I want at least one of the secondary teachers to be present for each of the primary planning sessions. I used a dummy teacher to set as the primary meetings (since the primary timetable is not part of my FET file), set those to occur on specific times (activity has a preferred starting time), and then max occupied slots for dummy teacher's activities, math teacher 1's activities, and math teacher 2's activities = 8 with all slots selected as available. This should work, right?
Thanks again!
Quote from: ChicagoPianoTuner on April 28, 2016, 07:31:26 PM
Okay, well, thanks for the help both of you. I have already used that trick in two other places in my timetable - it's nice to learn new things! The second use works like this:
Two of our secondary maths teachers provide support for the primary school. The secondary maths teachers have 4 lessons each to provide support. The primary teachers have group planning sessions for 3 lessons per week, and I want at least one of the secondary teachers to be present for each of the primary planning sessions. I used a dummy teacher to set as the primary meetings (since the primary timetable is not part of my FET file), set those to occur on specific times (activity has a preferred starting time), and then max occupied slots for dummy teacher's activities, math teacher 1's activities, and math teacher 2's activities = 8 with all slots selected as available. This should work, right?
Thanks again!
Could you analyze your problem with let's say FET-like terminology? I.e. Students sets, Teachers, Activities... I'm not sure if I understood your problem. So please write down in detail how the activities are organized (Teacher-Student Set-Subject). For example:
SECONDARY MATH TEACHER 1 - GROUP 1 - MATHS (split = 3, duration = 1, min days = 1, weight = 100%)
SECONDARY MATH TEACHER 2 - bla - bla
PRIMARY MATH TEACHER 1 - bla - bla...
Sorry for asking all this staff, but it's necessary for me to understand the problem.
I don't actually need help, as I believe the problem is solved, but I'll describe it in case anyone is searing for a solution to their own problem.
Teacher A has 3 activities per week that occur at a specific time. Teachers B and C have 4 activities each. Of the 8 total activities of teachers B and C, I want at least 3 of them (though as many as 6) to occur at the same time as teacher A's 3 activities.
I think your solution is not right in case the activities of B and C can be overlapping. Because you can end up with A's activities lonely and B and C overlapping.
Please let us know if B and C's activities can be overlapping, so we need to think of something else.
Hmm, maybe you're right. It happened to work out correctly in the last version of the timetable, but when I regenerated it, there were problems. To clarify: each of A's activities MUST be overlapped by either B's activities OR C's activities OR both. B's and C's activities can overlap with each other, but they don't have to. The only requirement is that teacher A is always supported by teacher B or teacher C (or both B and C).
--Two of our secondary maths teachers provide support for the primary school.
What is this secondary teacher? Is the primary school is completely independent from yours? Is it a part of your timetable?
----The secondary maths teachers have 4 lessons each to provide support.
Where do these 4 supportive lessons take place? At your school, or at the other one?
----The primary teachers have group planning sessions for 3 lessons per week, and I want at least one of the secondary teachers to be present for each of the primary planning sessions.
So, for example if you achieve to have something like this, is it OK? ->
Primary teacher 1 - 1st lesson - GROUP 1 + Secondary teacher 1, 2nd lesson - GROUP 1 + Secondary teacher 2, 3rd lesson - GROUP 1 + Secondary teacher 1
Primary teacher 2 - 1st lesson - GROUP 2 + Secondary teacher 2, 2nd lesson - GROUP 2 + Secondary teacher 2, 3rd lesson GROUP 2 + Secondary teacher 1
Quote from: ChicagoPianoTuner on April 29, 2016, 04:10:48 PM
Hmm, maybe you're right. It happened to work out correctly in the last version of the timetable, but when I regenerated it, there were problems. To clarify: each of A's activities MUST be overlapped by either B's activities OR C's activities OR both. B's and C's activities can overlap with each other, but they don't have to. The only requirement is that teacher A is always supported by teacher B or teacher C (or both B and C).
I have thought about your problem.
Unfortunately, I see no solution to the exact problem using official version tricks.
There is a simple solution using tricks if you agree to make compromises. You might agree that teacher B is to assist A one time per week, while teacher C is to assist A two times per week. This is possible easily using two constraints activities occupy max time slots from selection.
There might be possible a perfect solution for your problem as a custom version, but it might be (very) difficult.
Thanks for putting so much thought into it, guys. I'll make the compromise you mentioned, Liviu, which is how I had it before I went down this rabbit hole to begin with!