Teachers wants to share same time slot with a condition

Started by pervezshaikh, December 20, 2016, 11:47:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pervezshaikh

Mr. A and Mr. B come to university from their home town 50 km away. They share same car. They avoid first period. But it creates a problem. There are many teachers who do not want to take first period due to various unreasonable reasons. If we allow Mr. A and Mr. B to unattend first period, creates an unrest in the university. Hence university administration compelled Mr. A and Mr. B to reach before first period.
Mr. A and Mr. B say "we would come before first period on the day when we have to take first class." They also demand that whenever Mr. A gets first period in group G1, the same day, Mr. B should also get a first period in another group G2.
How to achieve it if FET?

Volker Dirr

#1
Very difficult to answer, since it highly depend on your dataset. There might be very easy solutions and there might be more difficult ones. You need to tell us much more (number of hours per day, per week, per week of teacher A, per week of teacher B).
In fact it look like that teachers didn't saw the whole problem yet.

Example 1:
teacher A: first hour in G1, second hour in X. then free (no more activities)
teacher B: first hour in G2, second to sixth hour in other group.
As you can see: Your request won't help that teachers very much, because they share the car, so teacher A need to wait 4 hours, just because teacher B is still teaching.

Then also think on example like this:
Example 2:
teacher A: hour 1-6.
teacher B: hour 1-3 and 5-6. (so a gap at hour 4)

Example 3:
teacher A: hour 1-6.
teacher B: hout 1-5. (so free at hour 6)

Example 4:
teacher A: hour 1-6.
teacher B: hout 2-6. (so free at hour 1)

in a psychological way teacher B might be "angry" if he get a timetable like Example 3 or 4. Even in fact Example 2 isn't (much) better. he work the same number of hours that day and he need to wait the same number of free hours.

in many situation it is "good" if those teachers have got free the same time. So using workaround like pseudo activities just with that 2 teachers (no students) that start at the day or end that day will help them. since that mean they can drive together in a car at that time. the exact number is depending on your dataset. You need to tell us much more (see first sentences in this post).
There are also other variants possible, depending on your dataset.

Liviu Lalescu

Quote from: pervezshaikh on December 20, 2016, 11:47:32 PM
Mr. A and Mr. B come to university from their home town 50 km away. They share same car. They avoid first period. But it creates a problem. There are many teachers who do not want to take first period due to various unreasonable reasons. If we allow Mr. A and Mr. B to unattend first period, creates an unrest in the university. Hence university administration compelled Mr. A and Mr. B to reach before first period.
Mr. A and Mr. B say "we would come before first period on the day when we have to take first class." They also demand that whenever Mr. A gets first period in group G1, the same day, Mr. B should also get a first period in another group G2.
How to achieve it if FET?

This is not exactly the answer to your question, but might help. To ensure that two teachers have similar timetables, use a constraints activities occupy max time slots from selection. Add all the activities of both teachers, selected slots = all slots of the week, max occupied = max(n_activities_first_teacher, n_activities_second_teacher).

Maybe you can modify the above paragraph for you.

pervezshaikh

The problem is "when to come to university". Their return journey is not a problem. One teacher can wait for the other teacher as long as required. Moreover, they do not require same time slots except for first period. The problem is for first period only. If I do not assign first period to either teacher, the problem is eliminated altogether and that would be the easiest way. But that creates unrest to other teachers as I stated in my earlier post.
I may assign them one (or few) period(s) per week as first periods. Let I take example of first period thrice as follows:
First period for Mr. A: Monday, Wednesday and Friday.
First period for Mr. B: Monday, Wednesday and Friday.
I repeat once again. It may be for three days, two days or one day only.
As English is my second language, I do not know whether I have explained it or otherwise.

Liviu Lalescu

I think I have an idea for making two teachers beginning same day per week early:

Constrain each of the two teachers to have at least one slot with an activity in the beginning of a day, with two constraints activities occupy max time slots from selection. For one teacher: select all his activities, select all slots of the week without the first hour of each day, max occupied = sum of durations of the activities for this teacher - 1.

Then, another constraint of this type: selected activities = all activities of both teachers, selected slots = first of all the week, max occupied = 1.

I think this can be generalized for 2 or 3. But you need to decide on 1, 2, or 3 early beginnings.

pervezshaikh

Dear  Liviu Lalescu
I am trying hard to follow your instructions, but I am not a FET junkie.

Dear Volker Dirr
Mr A: 6x1hour per week
Mr B: 3x1hour per week

Volker Dirr

There are a lot of variants:

Mr B has got only 3 hours per week? In that case it mean he will work always the 1st hour at all 3 days.
You can place his activities manual than, just use activity preferred time constraint.
Since you also asked for a special Group for teacher B in the first period, you can also place his 3 activities in the first period.

Be careful: You placed them always into the first hour. I bet the other teachers might/will be angry. At my school most teachers want to start already in the first hour and now you give this privilege only to that 2 teachers. (it look like you will have much more teachers than students, so there will be very many other teachers not teaching in the first hour). But i can't give that privilege to everyone, since at my school i have got 24 classes but ~50 teachers. so more then half of them must start later, even nearly all want to start in the first hour :-( 

So an other variant is, reading your first topic again, disallow the first hour for that teachers! I bet you don't need to worry about the other teachers. most other teachers will like that, since it mean they can start in the first hour. Also don't worry about a "rule". Just say "as soon as you live more then ?40? km aways you will get this privilege".
I do a very similar thing at my school. All teachers with small children (in kindergarten or school year 1-2) are not able to bring their children into kindergarten/school and come in time to school. So all that teachers have always free the first hour. All teachers are happy about that rule.

I still think it is a bit stupid to force starting at the same time, but not end at the same time. waiting time is the same. So there is no advantage anymore for that teachers. They won't come home earlier by that rule, since they still need to wait. So if you want to annoy teacher B, then set other hours of teacher A pretty late. I guess teacher B will see very fast that his request is a bit stupid. The most needed stuff is that those hours are close to each other. You should care about that a different way. Not by forcing the first period. But of course you can do that if you want that. The advantage is, that with such an low number of activities it is very easy to place them manually the first hour. But as you see: You will get a also disadvantages by that.

You can also do the same tricks at an later period.

pervezshaikh

Dear Volker Dirr!
The culture varies from region to region. My people could not understand why your teachers are eager to take first period. Moreover, Mr. B is engaged to some other department also. Let us come to our work. Mr. Liviu Lalescu's suggestion helped me a lot. I could not understand him, due to my unfamiliarity to FET, but I used following algorithm.
I decided to force one day to take both teachers for first class.
Hence, I split Mr. A into 5+1 and Mr. B as 2+1. I forced 5 lectures by Mr. A and 2 lectures by Mr. B to be within 2-6 periods on any 5 working days by using "A set of activities occupies max time slots from selection". This way, each teacher will get 1 period during first hour automatically. But that did not guarantee the only period on the same day. I made each teacher unavailable everyday during first period except on Wednesday (say) and I was not happy for my manual selection as it is a weakness of my algorithm. Mr. B got first class on Wednesday, but Mr. I did not get. Why? I was surprised. I counted Mr. A's classes in 2-6 hours. They were 6 instead of 5. It is contrary to the condition imposed by "A set of activities occupies max time slots from selection". I rechecked three times. There is no mistake, while I apply the condition. Is it a bug in version 5.30.5? It must not be a known bug, otherwise Mr. Liviu Lalescu would not have suggested it (rather he would have removed it). I am attaching input file for your verification and Mr. A and Mr. B are there.

Volker Dirr

#8
The reason is easy: if you start the first hour, then you have to free earlier that day and can still use the whole rest of the day to do other things that take some more time (like visiting the zoo, ...). If you don't start the first hour, it doesn't make sence to to do that before school and there is not much time left after school for this (and/or it is more crowed at that time).

Like i said for teacher B:
Use activity preferred time constraint and set it manually. that is much faster (for calculating), FET (and you) will see bugs faster.

PS: I don't think cultures varies too much, since i saw in your datafile that you disallow later hours of 7 other teachers already. (On the other hand at your school the situation is also bit different, since your teachers are working only a (very) small number of hours. The teachers at most other schools must work a much higher number of hours per week.)
Don't forget that "free days constraints" might be better (if that teachers doesn't need work to work at the other times; then you must disallow the time of course)

Volker Dirr

#9
You set the constraints incorrect. There is no bug in FET.
If you want to do it with such a max occupy constraint, then you need to select ALL activities of that teacher.

After that you also should to tag the "other" activities and allow them only from 2nd to last hour.

pervezshaikh

Dear Volker Dirr!
I removed Mr. B from "A set of activities occupies max time slots from selection" constraint. Selected ALL activities of Mr. A for the same constraint. There are 9 activities spanning to 14 hours. I placed 1 in "Max occupied" during 2-6 hours in a week, which is obviously a wrong decision. I was expecting the timetable generation would issue warning, show error or would go to infinite loop. My expectation went down when the time table was created showing ALL activities instead of 1 in the selected time slots.
There must be a mistake either in my procedure or in the software.

Volker Dirr

Ah.. ok.

Liviu: Please also read!

Please swap selected and unselected time slots. Looks like we mixed that or the users misunderstand it.

Volker Dirr

#12
By the way:
Reading your request from the start:
Liviu didn't know that you have got such a low number of activities while he answered your message. So maybe there are maybe better variants.

How about using same starting time to the "They also demand that whenever Mr. A gets first period in group G1, the same day, Mr. B should also get a first period in another group G2"-activities?
Then you should tag that activities and allow it only in the first hour.
Tag all other activities from Mr. A and Mr. B and allow only 2-6 hour.

Merry Christmas


Liviu Lalescu

Quote from: Volker Dirr on December 24, 2016, 11:04:23 AM
Ah.. ok.

Liviu: Please also read!

Please swap selected and unselected time slots. Looks like we mixed that or the users misunderstand it.

Selected slots are marked with X. It says so on the bottom of the dialog. Isn't that correct?

Volker Dirr

#14
Yes, that is correct.
But even you can read it in that dialog, the user mixed it (and i must admit that i didn't saw his/this 2nd bug while i was reading his dataset the first time.)

I guess bugs like that happen because of a psychological effect.

There are 2 way to "see" the colours:

The current way:
I want to disallow/restrict a few slots by a constraint. Of course i disallow/restict them by red color. (so the other are green?!)

The other way:
I want to disallow/restrict a few slots by a constraint. So i talk about some slots. If i talk about special slots, then those slots are green. If i don't talk about a slot, then it is red.

As you can see users mix this kind of view.

hmmm...
what do you think: We should maybe only color the slots we talk about, but we don't color the other ones. Maybe that help?