FET Forum

FET Support (English) => Get Help => Topic started by: Nagendra on June 14, 2019, 06:25:36 PM

Title: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 14, 2019, 06:25:36 PM
In the attached sample exam timetable, more events are scheduled in Day-1 as compared to that of Day-2.

1) How do I constrain the activities to be distributed evenly (with some weight) among all the FET days
2) Similarly, how do I constrain the activities to be distributed evenly (with some weight) among all FET hours of any FET day?


even if the above two are not possible, its OK. But the below one is much needed.

3) How do I constrain the number of activities of all FET hours of all days in such a way that the total number of students (unique subgroups) will be equal (with some weight)?
i.e: for example, the number of students giving exam on Day-1 in Slot-1 should be approximately equal to the number of students giving exam on Day-5 in Slot-2.....

PS: Currently I don't have any rooms assigned, I prefer not to assign rooms because four different student groups will be sitting in every room while giving exams.
Title: Re: Equally distribute activities among all dates and times
Post by: Liviu Lalescu on June 14, 2019, 07:21:23 PM
I think for (3) you can use a constraint activities max simultaneous in selected time slots, or even add 4 or 5 rooms and constrain activities to these rooms.
Title: Re: Equally distribute activities among all dates and times
Post by: Nagendra on June 14, 2019, 07:44:43 PM
I think I haven't explained clearly.

For example there are 10 activities. Say 3 FET days, 2 FET hours each day.
A-1 (Activity-1) is attended by 8 students (8 unique subgroups
A-2 by 15
A-3 by 10
A-4 by 5
A-5 by 6
A-6 by 10
A-7 by 9
A-8 by 4
A-9 by 12
A-10 by 11

So, I want to schedule it on such a way that, total no of students on any day any hour (say Day 1 hour 2) remains almost same

So the possibile combination is
Day-1 Hour-1: A1 & A5     : Total students 14
Day-1 Hour-2: A2              : 15
Day-2 Hour-1: A3 & A4     : 15
Day-2 Hour-2: A6 & A8     : 14
Day-3 Hour-1: A7 & A10   : 20
Day-3 Hour-2: A9               : 12

I want FET to choose the best possible combination respecting other constraints  :). If at all possible with any existing constraint.
Title: Re: Equally distribute activities among all dates and times
Post by: Liviu Lalescu on June 14, 2019, 07:54:43 PM
For the number of students is impossible with current FET. You can do for the number of activities (max 2 activities at each slot), with the constraint I wrote above.
Title: Re: Equally distribute activities among all dates and times
Post by: ChicagoPianoTuner on June 14, 2019, 07:57:35 PM
My only idea is using buildings or rooms with a max capacity. If you have 80 subgroups and 6 meeting times, maybe set a maximum building occupancy to ~22 (tune this number). I'm not sure if it's the best way, as it wouldn't guarantee any sort of balance (e.g. using max occupancy wouldn't avoid 22/22/22/14/0/0), but it would probably avoid serious imbalance. You would of course have to add constraints like activities occupy a set of rooms, maybe a room's not available times depending on how you structure things.
Title: Re: Equally distribute activities among all dates and times
Post by: Liviu Lalescu on June 14, 2019, 08:00:26 PM
Quote from: ChicagoPianoTuner on June 14, 2019, 07:57:35 PM
My only idea is using buildings or rooms with a max capacity. If you have 80 subgroups and 6 meeting times, maybe set a maximum building occupancy to ~22 (tune this number). I'm not sure if it's the best way, as it wouldn't guarantee any sort of balance (e.g. using max occupancy wouldn't avoid 22/22/22/14/0/0), but it would probably avoid serious imbalance. You would of course have to add constraints like activities occupy a set of rooms, maybe a room's not available times depending on how you structure things.

Unfortunately a single room can host a single activity at a certain slot, and you have no max capacity constraints on buildings.
Title: Re: Equally distribute activities among all dates and times
Post by: Nagendra on June 15, 2019, 02:54:17 AM
Some subjects might have 200 students, some might have only 5. Suppose, If 5 activities with 200 students each are placed in any time slot, then I may not be able to accommodate them in proper rooms. On the other hand, if 5 activities with 10 students each are placed in any time slot, it is wastage of resources. This is the reason why I wanted to place activities on the basis of total no of unique students (subgroups) giving exam in any time slot.

My idea is once FET gives the timetable (of course with no rooms) then I will run my Matlab code to generate seating plan and allot them in rooms. A sample seating plan of a room is attached (generated from MATLAB). Room capacity is 80. Students from 5 different groups are giving the exam in the same room. (Subject code is mentioned against every roll number)
Title: Re: Equally distribute activities among all dates and times
Post by: Liviu Lalescu on June 15, 2019, 06:49:28 AM
You could then add an activity only for a student. And use max simultaneous in selected time slots.

Too many activities, then? (you can increase from max 30,000 activities by recompiling).
Title: Re: Equally distribute activities among all dates and times
Post by: Nagendra on June 15, 2019, 11:12:23 AM
Quote from: Liviu Lalescu on June 15, 2019, 06:49:28 AM
You could then add an activity only for a student. And use max simultaneous in selected time slots.

Sounds interesting  :D.

Then I need to add the following constraints:-
1) Maximum hours per day for all student sets
2) Minimum gaps between activities for every student (I already coded this) (No of constraints = no of individual students)
3) Maximum simultaneous activities in the selected time slots (ie. = Total activities / total slots) (No of constraints = no of time slots)
4) A set of activities has the same starting time and day (to ensure that all the students will give an exam at the same time) (No of constraints = no of subjects)

Looks like it will work.  ;D

And it is doable too.... ;D

Quote
Too many activities, then? (you can increase from max 30,000 activities by recompiling).
Will see...in the actual case, it might go beyond 30000...5000+ students with 6 regular subjects each: so 30000 activities and then some students who are giving some exam again as they didn't get a passing grade. So, it might go upto 50000

let me code it and test it for a small set.

By the way how difficult it is for you to add a constraint to limit the maximum number of subgroups in any given time slot?
Title: Re: Equally distribute activities among all dates and times
Post by: Liviu Lalescu on June 15, 2019, 11:40:59 AM
Quote from: Nagendra on June 15, 2019, 11:12:23 AM
By the way how difficult it is for you to add a constraint to limit the maximum number of subgroups in any given time slot?

Maybe not very difficult.
Title: Re: Equally distribute activities among all dates and times
Post by: Nagendra on June 15, 2019, 11:44:03 AM
Quote from: Liviu Lalescu on June 15, 2019, 11:40:59 AM
Quote from: Nagendra on June 15, 2019, 11:12:23 AM
By the way how difficult it is for you to add a constraint to limit the maximum number of subgroups in any given time slot?

Not very difficult.

May I request you to add it (In case, other users also feel is useful). So, The no of constraints and activities will be less and my timetables look good ;).
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 11:52:25 AM
I added it in the TODO for now. I am not sure it will be useful for other users.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 12:02:18 PM
Thanks!  :D
Title: Re: Equally distribute activities among all dates and times
Post by: Nagendra on June 15, 2019, 01:47:32 PM
Quote from: Liviu Lalescu on June 15, 2019, 06:49:28 AM
You could then add an activity only for a student. And use max simultaneous in selected time slots.

Too many activities, then? (you can increase from max 30,000 activities by recompiling).

Done!

Working perfectly.

Having the following issues/queries

Query:-
1) How do I check how many activities are placed on any given slot?

Issues:-
I don't see an option to modify "all the constraints at once" for the following constraints (Like it is there for minimum days between a set of activities)
  a) A set of activities has same starting time (however, I don't need to change this. it is always 100%)
  b) Maximum simultaneous activities from a set in selected timeslots (This can be handled manually): But it is preferable to have such option here also.


Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 02:48:22 PM
(1): By manually viewing the HTML results "All activities" timetable, or a customization (I think cannot add this in the official FET, because I think nobody else would use).

(a) and (b): unfortunately, min days between activities is the only one allowing multiple change from FET. The other constraints are not so critical to change multiple, I consider.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Volker Dirr on June 15, 2019, 02:54:44 PM
hmmm... maye it is faster/esier if you import the timetable.csv into libreOffice Calc or Excel. Use the autofilter and just "view"
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 03:17:47 PM
Quote from: Liviu Lalescu on June 15, 2019, 02:48:22 PM
(1): By manually viewing the HTML results "All activities" timetable, or a customization (I think cannot add this in the official FET, because I think nobody else would use).

No, Issue. I can write a simple Matlab code to extract that information from the timetable.csv (using export option). Don't want you guys to work on customization just for this.

Quote
(a) and (b): unfortunately, min days between activities is the only one allowing multiple change from FET. The other constraints are not so critical to change multiple, I consider.

It's Ok. Not that critical. I can change it through MATLAB.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 03:20:04 PM
OK, sorry for not being able to do more. Keep me informed if the final results are good.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 03:33:43 PM
Quote from: Liviu Lalescu on June 15, 2019, 03:20:04 PM
OK, sorry for not being able to do more. Keep me informed if the final results are good.

Your ideas are valued much. The timetable (with test data of 89 unique students) is simply "superb". Attached here.

The main intention of me working on this is one student had two exams on the same day same slot. I happened to be the invigilator and more surprisingly, both his seats were in the same room. It made me feel very bad for that student. Till now, all timetables and exam schedules are prepared manually for more than 5000 students. A lot of clashes every semester. So, I personally took interest and started searching for opensource timetable generators. I came across a Quora post where all other writers were advertising their product, but, one fellow wrote about "FET"- a powerful timetable generating software.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 03:36:08 PM
Quote from: Volker Dirr on June 15, 2019, 02:54:44 PM
hmmm... maye it is faster/esier if you import the timetable.csv into libreOffice Calc or Excel. Use the autofilter and just "view"

Oh! Yeah! I missed your reply.

I enabled "notifications" too....but not receiving any.  :(
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 03:40:20 PM
Quote from: Nagendra on June 15, 2019, 03:36:08 PM
Oh! Yeah! I missed your reply.

I enabled "notifications" too....but not receiving any.  :(

This is nasty! You need to receive emails from lalescu.ro. I think you are receiving, since you were able to register, by receiving a confirmation email in which you needed to click the link.

You also need to click "Notify" for each topic.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 03:44:48 PM
Quote from: Liviu Lalescu on June 15, 2019, 03:40:20 PM

This is nasty! You need to receive emails from lalescu.ro. I think you are receiving, since you were able to register, by receiving a confirmation email in which you needed to click the link.

You also need to click "Notify" for each topic.

Oops! all notifications were directed to spam. I just checked. I was thinking that notify option is not working
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 03:49:40 PM
1) You could add only one activities max simultaneous in selected slots, select all slots (but with more constraints you can fine tune).

2) You are "abusing :) " min days between activities constraints, with min 2 days for 10 days per week for an activity split into 8.

3) If you add real data, maybe the file will be very large.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 03:54:10 PM
1) Oh...really....I thought, If I select all the slots the algorithm would place a total of 30 students (activities) will be placed in all slots combinedly. Thanks for the info  :)
2) Yes...I wanted to have a break of one day between two exams to the extent possible.  ;)
3) May be
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 03:58:32 PM
(2): Yes, but the timetable will become too difficult to compute. You might need to use min 1 day instead of min 2 days, or use min 2 days between 5 subactivities and min 1 day between all subactivities (add two constraints for activities split into more than 5).
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 15, 2019, 04:20:15 PM
There is no split activity.

Will check them later.... A bit tired now...
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Liviu Lalescu on June 15, 2019, 06:15:48 PM
Just had a look on your file. Seems that each activity has a single constraint min days between activities? If this is the case, for more than 5 activities (say n) in the constraint add min 1 days 100% for all and min 2 day 100% for n-5, any activities.

Think of it, I might be wrong.
Title: Re: Equally distribute students among all dates and times for exam timetable
Post by: Nagendra on June 16, 2019, 02:08:36 AM
Hmm....The max hours daily for all students (which is currently 1 with weight 65%) will take care of minimum days 1. So, didn't add it again.

I tried the below:
1) If the number of activities (say n) in any constraint is <=5, min days 2 with 100% weight (even reduced it upto 30%).
But the timetable is not getting generated. Not clear why?. Looking into it.