Custom FET BP - block planning (Need help choosing a custom version)

Started by ChicagoPianoTuner, July 24, 2019, 01:36:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

Quote from: ChicagoPianoTuner on August 11, 2019, 02:21:21 AM
I do not know how difficult this would be, but could you temporarily put a version where, for subgroups days horizontal, empty columns (FET days) are hidden in the html timetables? The file is very, very large and difficult to load. It is very difficult to look through and try to figure out errors.

I did this, please get it from the usual location: https://lalescu.ro/liviu/fet/download/custom/cpt/

ChicagoPianoTuner

Thank you so much, that makes it much easier to see what's going on!!

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 11, 2019, 08:11:32 AM
But each activity in the constraint will not overlap with all the other activities in the constraint (or begins at the same time). So you might need more constraints, and in a constraint add for instance the activities of year 7 drama, in another constraint the activities of year 8 drama, etc.
Yes, that's what I did. Good.

Liviu Lalescu

I am glad it works! Unfortunately, it is generating very slow, in about 7 hours (!) as you wrote me privately.

ChicagoPianoTuner

OK - an update. With a slightly modified file, I managed to get a very near solution in ~1 hour. But then no progress for ~2+ more hours when FET was trying to schedule physical education.

So I stopped the simulation, locked all activities except physical education and tried to generate - and it got stuck. I realized what happened: for some students, they were successfully assigned all their choices, and ALSO their reserve choice was assigned to real hours. Since physical education is constrained to be in real hours (because it's a mandatory course), FET was unable to place it.

So I stopped the simulation again and also unlocked everything with tag = "reserve", and resumed generation, and it generated instantly.

I think we need to implement a constraint that, for every student, exactly one of his choices (possibly duration 6, possibly duration 8) falls in the "fake" block. In addition to making the generation successful from a FET point of view, this is a very important constraint to ensure students get the courses they want.

I can do it using max slots from selection twice for each student: one constraint where selection is all fake slots, activities are all of the student's choices, and max occupied = 8; and a second constraint where selection is all real slots, activities are all of the student's choices, and max occupied = (total number of activities - 8). Is there a cleaner way?

Liviu Lalescu

Quote from: ChicagoPianoTuner on August 11, 2019, 08:18:53 PM
I can do it using max slots from selection twice for each student: one constraint where selection is all fake slots, activities are all of the student's choices, and max occupied = 8; and a second constraint where selection is all real slots, activities are all of the student's choices, and max occupied = (total number of activities - 8). Is there a cleaner way?

I think the second constraint should be max occupied = (total duration of activities - 6).

The file size might become quite large.

Please allow me to think some more, I hope I'll be able to answer tonight, maybe soon. I need to see the code of the constraint activities occupy max time slots from selection.

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 11, 2019, 10:17:53 PM
I think the second constraint should be max occupied = (total duration of activities - 6).
You are right - duration.
Quote
The file size might become quite large.
Right again - it will become VERY large. I could reduce the number of selected slots by only choosing those that correspond to potential teachers that go with the student's choices.
Quote
Please allow me to think some more, I hope I'll be able to answer tonight, maybe soon. I need to see the code of the constraint activities occupy max time slots from selection.
OK :)

Liviu Lalescu

Quote from: ChicagoPianoTuner on August 11, 2019, 10:21:02 PM
Quote from: Liviu Lalescu on August 11, 2019, 10:17:53 PM
I think the second constraint should be max occupied = (total duration of activities - 6).
You are right - duration.

How about my 6 instead of your 8?

ChicagoPianoTuner

Right again :)

Some very good news - I changed the input file slightly by changing the requirements of a few unusual students and it solved in less than 10 minutes. There are still some problems, specifically with middle school courses of duration 4, but I have a workaround until you say whether or not we can implement a G->A wraparound constraint.

I will start to add back some of the complexity I removed earlier.

I was thinking once more about FAKE hours. I think it might be best to delete all fake hours and have a fake DAY, only allow activities to happen in the first 8 hours of the fake day (block A) and then work there. Would this change make FET faster?

Liviu Lalescu

Great news  :)

I hope I will be able to implement G->A wraparound. Now, since we have a working file.

Hmm, Fake day - you have preferred times for activities for a teacher, which may fall on the Fake hours and their day. This is a new idea, I must let it mellow a bit until I process it (is mellow the right word?).

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 11, 2019, 10:39:17 PM
Great news  :)

I hope I will be able to implement G->A wraparound. Now, since we have a working file.

Hmm, Fake day - you have preferred times for activities for a teacher, which may fall on the Fake hours and their day.
Yes, so for physics (taught by Mr. X and Mrs. Y), it could occur on Mr. X's day (all hours), Mrs. Y's day (all hours), and Fake day hours 1-8. But by getting rid of fake hours 1-8 you remove 8x(number of teachers) =~ 200 hours from the timetable and just add 40 (for the extra day).
Quote
This is a new idea, I must let it mellow a bit until I process it (is mellow the right word?).
Maybe simmer or marinate is better than mellow. Mellow means relax :)

Liviu Lalescu

I will think about Fake day instead of Fake hours. I think it won't speed up things too much.

I just discovered now a bug of mine, and maybe this was a problem: for each student, I make him not able to study on same hour with different teachers, but including the Fake hours!! I need to correct this. Please tell me if there are students with at least two activities in the Fake hours. This is a situation which was denied by FET. I will correct right now and put a new snapshot, unless you consider otherwise.

So please let me know as soon as possible if this correction must be made.

ChicagoPianoTuner

#147
Quote from: Liviu Lalescu on August 11, 2019, 10:54:23 PM
I just discovered now a bug of mine, and maybe this was a problem: for each student, I make him not able to study on same hour with different teachers, but including the Fake hours!! I need to correct this. Please tell me if there are students with at least two activities in the Fake hours. This is a situation which was denied by FET. I will correct right now and put a new snapshot, unless you consider otherwise.

So please let me know as soon as possible if this correction must be made.
No - this is a good thing! I want for each student to have EXACTLY ONE activity (for middle school duration = 4, for high school duration = 6 or 8) in the fake hours. Your mistake did not solve the problem, as currently it is possible for fet to place zero activities in the fake hours, but it is useful.

Liviu Lalescu

Good. Less work to do :)

So, you only need the activities occupy max real (total_duration_of_all_activities-6) slots from all real slots? (the first constraint you suggested is done by my "bug"?). I will try to make something faster and automatic.

I need you to tell me, all the activities of a student must be like that, or only some? If only some, please decide on a fixed activity tag for them and I'll try to do this automatically (compute the durations and make the code faster than the occupy max, which behaves bad if there are many slots selected).

I also saw that each student has only about 10 activities. I thought of a speed improvement when checking that each student has a single activity at a real life time slots. I'll try it (probably tomorrow).

ChicagoPianoTuner

Before I answer your last post, I have a problem. This is the second time this has happened. FET generates successfully, I lock all activities and Save As..., then open that file and try to generate and FET cannot (it gets stuck). Any ideas why?