Main Menu

Max Hours for a room(s)

Started by Benahmed Abdelkrim, May 09, 2020, 11:25:12 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Benahmed Abdelkrim

#60
Quote from: Liviu Lalescu on May 16, 2020, 07:44:44 PM
Please let me know if the program cannot solve or if it produces a wrong solution.

Because I did not make it perfect. It might work only if the real rooms are used for activities without teachers or more than 1 teacher.
Ok!. It's certain. no problem!

Quote from: Liviu Lalescu on May 16, 2020, 09:56:16 PM
Dear Benahmed,

I tried to implement room max available slots, hard coded in the program, to 5. I attach the result. It solves much faster now, instant. The only thing is that you cannot add the constraints for gaps like you added.

Please tell me if this result is good. I can try to help you, if all the activities have duration 1 and if all real rooms in this are in a virtual room, by making an option, max occupied slots, selectable from the program. The advantage is that the program is much faster and I like it better.

the results are good. unless we can limit the number of activities per day for each real teacher to 3. with the constraints of gaps was possible. the day 1(Sun) consists of 4 hours, and it is considered tiring to let a teacher work full day (T27,T28)... apart from that the result is excellent. congratulations dear Liviu!
B.A/krim

Liviu Lalescu

#61
So, recapitulation:

1) each FET room has different FET teachers,

2) each FET room has maximum 5 occupied slots in total,

3) each FET room has maximum 3 occupied slots per day.

Are these possible to be hard-coded (meaning not changeable)? It is much easier for me, but you might need differently. If not, I can make a dialog, with a check box for (1) and a spin box for (2) and (3).

Benahmed Abdelkrim

1/ for the first point; Yes of course

2/ for the 2nd point it is not always the case, for other example it can be less or more

3/ for the 3rd point; it can be 3 or 2 or even more according to the examples

I think that dialog boxes are the best solutions.
B.A/krim

Liviu Lalescu

(2) and (3): the same value for all FET rooms in a data file?

Benahmed Abdelkrim

Quote from: Liviu Lalescu on May 16, 2020, 11:15:15 PM
(2) and (3): the same value for all FET rooms in a data file?
unfortunately this is not always the case. it depends on the examples; it can vary from one FET room to another FET  room, but generally between two natural numbers ...
B.A/krim

Benahmed Abdelkrim

#65
Quote from: Benahmed Abdelkrim on May 16, 2020, 11:22:17 PM
Quote from: Liviu Lalescu on May 16, 2020, 11:15:15 PM
(2) and (3): the same value for all FET rooms in a data file?
unfortunately this is not always the case. it depends on the examples; it can vary from one FET room to another FET  room, but generally between two natural numbers ...

this means, that a set of teachers saying for example have 5 activities each, and a second set of teachers have 4 activities..means that the group of teachers is divided into two subgroups; one subgroup with 5 activities each, and the other subgroup with 4 activities each.

this case we meet it when we divide the total number of activities on the total number of teachers we find a decimal number like 4.5 for example
B.A/krim

Benahmed Abdelkrim

#66
let's take another more explanatory example:
add 4 teachers (FET rooms) to the 36 that we have in our first example this gives us 40 teachers (40 FET rooms). the number of real rooms (FET teachers) does not change no and stay 10. that gives us 180 real activities (2 teachers per room X 10 rooms X 9 time slots per week = 180 activities )

180 teachers / 40 teachers = 4.5 (decimal number)
all this leads us to solve the following two equations:

4x+5y=180  ....... (1)
x+y=40    .............(2)


The solution to this set of equations becomes child's play
x=20    ; y=20


therefore a set of 20 teachers will have 5 activities each, and a second set of 20 teachers will have 4 activities each.

of course will do this with the gaps (for the moment of course): the first set will have 4 gaps for each element, and the second set will have 5 gaps for each element.

the attached .fet file produced with FET - nsrt, shows these ideas well;

note: there  are other examples the week consists of 5 days and not just 3 days
other examples where the virtual room is made up of 3 sets. that is to say each real room contains 3 real teachers.
B.A/krim

Benahmed Abdelkrim

another example with 3 real teachers in each real room, found with the same method above.
we have 50 teachers;
we have 3 teachers per room * the number of rooms(10 rooms) * number of time slots(9 ts) = number of activities= 270 activities;

so 270 activities / 50 teachers = 5.4 (decimal number);

we have 2 sets of teachers, the first with 5 activities each (30 real teachers) which gives 4 gaps per teacher.
the second with 6 activities each (20 real teachers) which gives 3 gaps per teacher.
B.A/krim

Liviu Lalescu

#68
Dear Benahmed,

To add two types of constraints (room max slots per week/day) is tedious and I am not sure it will work as you need. Until we check it will work, I propose you a trick/hack:

For each FET room, add a comment. If that comment contains "MSPW=x" and/or "MSPD=y", x is max slots per week and y is max slots per day.

I think I can implement this fast and you can check. Eventually, after some time, if it works really well, maybe I'll add it the proper way.

Please let me know if you are interested in this, and I'll begin doing it.

Benahmed Abdelkrim

hmm .. I think it's a good trick, and it is an alternative to adding gaps and their related activity tags and their constraints...
ok! we can implement it as a temporary solution ... i hope it will not complicate things for other users  :'(. thank you.
B.A/krim

Liviu Lalescu

I did it: https://lalescu.ro/liviu/fet/download/custom/nsrt/

I hope you and other users will benefit from it.

It would be theoretically very easy to add the exact constraints (because the code runs now), but very tedious.

Benahmed Abdelkrim

thank you very much for your effort.
but there is a little inconvinient (max span) as described on the screenshot attached below
can we limit the span?
with the gaps it was easier
B.A/krim

Benahmed Abdelkrim

#72
I think I found an idea; we can overcome this situation by merging pm1 and pm2 of the Sun day(day 1 of the week).
this will allow only one repetition during exams( without the program really knowing that it is a repetition) a widely acceptable solution...

I attach the file .fet below..

note: but sadly this solution is not good in all situations especially if the afternoons consists of 2 sessions  :'(
B.A/krim

Liviu Lalescu

I really don't understand your previous post, sorry.

But after a today's hard work I managed what you wanted. https://lalescu.ro/liviu/fet/download/custom/nsrt/  . Note: I changed the strings in the comments, see the file which solves in the examples or read the readme.txt.

And note that what you want is impossible practically with your file. For 4 teachers we need to allow span 6 (I chose the first 4). Please see that file.

Benahmed Abdelkrim

thank you very much dear Liviu for adding this new MSPD( max span per day) constraint. it's really great. and I really apologize for making you work hard today.
B.A/krim