FET Forum

FET Support (English) => Get Help => Topic started by: jamlatino on May 18, 2012, 06:19:07 PM

Title: How to link Teachers to Subjects
Post by: jamlatino on May 18, 2012, 06:19:07 PM
Is there a way to handle the case where a teacher (or several teachers for that matter) is capable of teaching several different subjects so the software can assign teachers to subjects depending on availability?
Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 18, 2012, 07:56:51 PM
My usual suggestion is to use the trick: a real teacher = a FET room, and assign activities to FET rooms. But maybe other people have better tricks or suggestion.
Title: Re: How to link Teachers to Subjects
Post by: yush on May 19, 2012, 04:22:21 AM
Since 5.18, I have been thinking and experimenting on this. Here is the solution that I've come up with.

Say you have 5 year 7 math classes for 7A, 7B, 7C, 7D and 7E
3 teachers, T1 teachers 1 of them, T2 and T3 each will teach 2.
It doesn't matter who is teaching which one.

- Create 5 set of activities, subject = 7Math, assign the student (7A-E) to each class.
- Create 5 room-teacher alias (using room as teacher), RT1, RT2, RT3, RT4, RT5
- Assign RT1-5 as preferred rooms for the 5 set of activities above
- Add max different room constraint to 1 for each activity (Thanks God for 5.18!)
- Create (total number of available slots - 5) dummy activities, they are the "not-RTs", assigning RT(n) as the preferred room
- Do that 5 times, 1 set for each of the RTs
- Create 5 other sets of dummy activities assigning T1 to one of them, T2 to two of them, T3 to the other two.
- Add not-overlapping constraint to not-RT1 and the dummy assigned with T1
- Add not-overlapping constraint to not-RT2 and the dummy assigned with T2
- Add not-overlapping constraint to not-RT3 and the dummy assigned with T2
- Add not-overlapping constraint to not-RT4 and the dummy assigned with T3
- Add not-overlapping constraint to not-RT5 and the dummy assigned with T3
- assign preferred room(s) to the dummy with teacher as you normally would.

Generate....

By doing that, you can actually ensure that the teacher chosen still have his homeroom(s), and other constraint on the teachers, such as max hour per day can still be respected. Otherwise, you may ended up assigning a class to a teacher and break the max hour constraint that you have intended since FET doesn't know that you are using a room as a teacher.

I tried this trick and it actually work, in theory. I didn't try it on a real timetable. So, I don't know how practical it is. May be Liviu can look at my logic here and tells us what kind of impact in would have on the performance based on his algorithm.

Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 19, 2012, 05:41:39 AM
Seems very good and as simple as possible (I mean it is complicated just as necessary).

I hope it will work practically, but we need to test. Theoretically, this trick respects FET (does not waste computing resources).

So, yush, it seems that we can simulate our fourth dimension with this trick :-)
Title: Re: How to link Teachers to Subjects
Post by: yush on May 22, 2012, 04:25:46 AM
OK. I tested the concept. It's not very practical. It worked, but not really helpful for difficult timetable. Given the set up, since the not-dummies are standalone activities with few constraints, they get placed very late in the order. Since the locking of teacher-to-room is achieved by setting the required activities not over-lapping with the not-dummies, it got too easily placed when the not-dummies were not placed at all. By the time the order gets to the not-dummies, things become too difficult.

So, for a difficult timetable, it will take much longer to solve.
Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 22, 2012, 06:38:22 AM
I'll think of this some more.

Here is a first idea: add dummy activities for each of students sets 7A..7E, so that they will have a full timetable. This way, the real activities for them will be considered more difficult by FET and placed earlier.

Please let me know.
Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 22, 2012, 09:08:18 AM
I might need to think of treating this situation "for real", meaning a real course planning. Allocating teachers to activities.

My ideas are: an activity may have no teachers. Then, the user can specify a pool of teachers for this activity, and FET will choose only one teacher for this activity. We need to add the constraint type "teacher works max hours per week".

But only if it is really useful and if I get very difficult sample files to check that they are solved.

I suppose this would be enough; you don't need the same for students sets, do you?
Title: Re: How to link Teachers to Subjects
Post by: yush on May 22, 2012, 09:18:52 AM
We will probably need a "max hours for teacher per subject tag" constraint.

Consider this scenario:
7A, 7B, 7C, 7D, 7E to be taught by teacher T1, T2, T2, T3, T3
8A, 8B, 8C, 8D, 8E to be taught by teacher T1, T2, T2, T3, T3

It is possible that we may end up with
7A-T1, 7B-T2, 7C-T2, 7D-T2, 7E-T3
8A-T1, 8B-T2, 8C-T3, 8D-T3, 8E-T3

or other possible permutation.

Not the even split that I intended. So, adding a per subject+tag constraint will give me more control.

... and don't worry about difficult timetables... I have plenty of those :)
Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 22, 2012, 09:41:01 AM
Quote from: yush on May 22, 2012, 09:18:52 AM
We will probably need a "max hours for teacher per subject tag" constraint.

Maybe better: a set of activities occupy max hours for teacher.

But please think if it could be solved by the constraint activities occupy max time slots from selection (so you can take all activities of teacher T1 and those which might end up allocated for teacher T1 and say that they can occupy maximum N time slots per week).
Title: Re: How to link Teachers to Subjects
Post by: yush on May 22, 2012, 09:53:53 AM
Quote from: Liviu Lalescu on May 22, 2012, 09:41:01 AM
But please think if it could be solved by the constraint activities occupy max time slots from selection (so you can take all activities of teacher T1 and those which might end up allocated for teacher T1 and say that they can occupy maximum N time slots per week).

Still won't work. You can have the same number of max hours, say 3+1. As opposed to the 2+2 even split that I need.

But yes, it's a nice constraint that I've never tried.
Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 22, 2012, 09:58:54 AM
Quote from: yush on May 22, 2012, 09:53:53 AM
Quote from: Liviu Lalescu on May 22, 2012, 09:41:01 AM
But please think if it could be solved by the constraint activities occupy max time slots from selection (so you can take all activities of teacher T1 and those which might end up allocated for teacher T1 and say that they can occupy maximum N time slots per week).

Still won't work. You can have the same number of max hours, say 3+1. As opposed to the 2+2 even split that I need.


No, I meant more detailed: one constraint for teacher T1 and year 7, another one for T1 and 8, then T2 -> 7 & 8, T3 -> 7 & 8, so 6 constraints (following your example). It respects what you say does not work, in your quote above. But there is another problem, I think: T1 allows less activities than T2 and T3, so T2 and T3 are impossible.
Title: Re: How to link Teachers to Subjects
Post by: Liviu Lalescu on May 25, 2012, 04:49:07 AM
Volker told me that there are many other things which need to be taken care of in real course planning and the direction which I pointed might not be a good one. I don't know what's best; of course I am reluctant to make changes, especially difficult ones as adding optional teachers, but I should not refuse necessary improvements.
Title: Re: How to link Teachers to Subjects
Post by: Volker Dirr on May 25, 2012, 11:16:58 PM
I was talking about points like this:
http://lalescu.ro/liviu/fet/forum/index.php?topic=1053.msg6106#msg6106

In my opinion you request is a small part of an activity planning.
For a good activity planning all the other things are needed (compare previous link).
That's why i think your request should be part of an activity planning software and not of the scheduling software.
Title: Re: How to link Teachers to Subjects
Post by: yush on May 26, 2012, 02:30:52 PM
I agree that activities planning is a bigger thing than a scheduling software should handle. There are too much human factor in it.  However, a simple (idea is simple, but how to make it work is probably very complicated) preferred teachers for a set of activities is still a nice feature.

Anyway, a dedicated activities planning software would be nice!