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.

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 11, 2019, 11:23:49 PM
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).
I'm afraid I do not understand. Let me try to explain the true real-life situation and you can translate to FET :)

I use the tag "Required" to specify that a course must 100% happen in real hours. Students MUST take these courses.

First, middle school students. They have 5 "Required" courses, each with duration = 6. Then they have 3 courses with duration = 4, one of which is PE. The other two can be art, music, drama, computing, DT, and public speaking. For these two courses, a student makes 3 choices with the following FET tags: "Middle_First" for his top choice, "Middle_Second" for his second choice, and "Middle_Reserve" for his backup choice if one of the other two cannot be scheduled. So a middle school student must have exactly one activity of duration = 4 found in FAKE hours, and it should hopefully be the one with the tag "Middle_Reserve."

The senior school students are more complicated. Some students have 4 required courses, some have 2, depending on many factors. But every student chooses a "Reserve" course that must be scheduled if one of his other choices (not "Required" choices) cannot be scheduled.

Perhaps you would like me to have a tag called "Not_Required", and then you can say exactly 1 "Not_Required" course must be found in fake hours. For middle school students (years 7, 8, and 9), all "Not_Required" courses will have duration = 4, but for senior school, they may be duration = 6 or duration = 8. But since there are no courses of duration = 2, I think you can essentially have max occupied in real slots = total duration - 6.

Liviu Lalescu

Quote from: ChicagoPianoTuner on August 11, 2019, 11:30:01 PM
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?

Please carefully save such files and send them. It is a FET bug which I need to correct.

Liviu Lalescu

Yes, please add "Not_Required" or similar. This will be probably just to help FET, because the other activities are required.

ChicagoPianoTuner

I have sent you the new FET file where every activity is tagged either "Required" or "Not_required".

Liviu Lalescu

#154
Quote from: Liviu Lalescu on August 11, 2019, 11:40:04 PM
Quote from: ChicagoPianoTuner on August 11, 2019, 11:30:01 PM
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?

Please carefully save such files and send them. It is a FET bug which I need to correct.

It is not a FET bug, it is your bug:

In short, the activities with duration 4 (I saw id 389) is allowed to start at G4. It should only start at max G2. Please correct. If you make activities not allowed to start at obvious slots, it is faster for FET and avoids bugs like this.

Explanation: in the long generation, FET placed firstly activity of 8_53 (in G4), then of 8_51 (in Fake). OK, because I assumed 8_53 is total in real. Then, at generating the fixed timetable, it puts first 8_51 in Fake and 8_53 is not OK, overlaps with 8_51 and is not (entirely) in Fake.

Please let me know when you fix this. Maybe send me the updated files.

There are two constraints preferred times: preferred starting times and preferred time slots (all the slots of the activity are in the allowed slots). You might want to use also preferred time slots instead of starting times, for these (but not for everything, like (sub)activities with duration 6).

Liviu Lalescu

I just added a new version, occupy max real slots "Not_required" <= dur - 6. I think this is not for generating correct solutions, but to help FET. Isn't it?

Same location: https://lalescu.ro/liviu/fet/download/custom/cpt/

ChicagoPianoTuner

#156
Quote from: Liviu Lalescu on August 12, 2019, 10:47:44 AM
I just added a new version, occupy max real slots "Not_required" <= dur - 6. I think this is not for generating correct solutions, but to help FET. Isn't it?

Same location: https://lalescu.ro/liviu/fet/download/custom/cpt/
I think it's for both.

To clarify, I mean that the old solution was correct by FET rules, but really this is implementing a new rule that makes the solution more like one that I want.

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 12, 2019, 07:53:20 AM
In short, the activities with duration 4 (I saw id 389) is allowed to start at G4. It should only start at max G2. Please correct. If you make activities not allowed to start at obvious slots, it is faster for FET and avoids bugs like this.

OK, I will change it. I allowed G4 prematurely. It should eventually be allowed because an activity of duration 4 may occupy G4, G5, A1, and A1', but I do not know if FET will be able to do that, even with a new constraint. Perhaps it should be 2 activities of duration 2.

Liviu Lalescu

Quote from: ChicagoPianoTuner on August 12, 2019, 12:17:27 PM
Quote from: Liviu Lalescu on August 12, 2019, 07:53:20 AM
In short, the activities with duration 4 (I saw id 389) is allowed to start at G4. It should only start at max G2. Please correct. If you make activities not allowed to start at obvious slots, it is faster for FET and avoids bugs like this.

OK, I will change it. I allowed G4 prematurely. It should eventually be allowed because an activity of duration 4 may occupy G4, G5, A1, and A1', but I do not know if FET will be able to do that, even with a new constraint. Perhaps it should be 2 activities of duration 2.

I think we need to input an activity split into two: 2+2. And I'll modify the constraint two activities grouped to allow G4,G5 and A1,and A1' for them. Only for activities split into two, duration 2 each, total duration 4. So you need to add also constraints two activities grouped for these. I just checked the code - they will be placed together in the initial order automatically.

Let me know when I should start working on this customization.

We have remaining that with three activities grouped allowing wraparound. And maybe other thing, but I want to see it is solving now. I would like to see it solving after doing two activities grouped (and you modifying those activities and adding constraints two activities grouped) and before doing three activities grouped.

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 12, 2019, 10:47:44 AM
I just added a new version, occupy max real slots "Not_required" <= dur - 6. I think this is not for generating correct solutions, but to help FET. Isn't it?

Same location: https://lalescu.ro/liviu/fet/download/custom/cpt/

I have been testing and there is a problem with how this constraint has been implemented. For senior students, it works fine, but for middle school students, it fails because of their duration 4 activities. Perhaps I could add "Not_required_senior" and the constraint works as you have above, and also "Not_required_middle", occupy max real slots <= dur - 4. Is that OK?

ChicagoPianoTuner

Quote from: ChicagoPianoTuner on August 12, 2019, 04:42:39 PM
Quote from: Liviu Lalescu on August 12, 2019, 10:47:44 AM
I just added a new version, occupy max real slots "Not_required" <= dur - 6. I think this is not for generating correct solutions, but to help FET. Isn't it?

Same location: https://lalescu.ro/liviu/fet/download/custom/cpt/

I have been testing and there is a problem with how this constraint has been implemented. For senior students, it works fine, but for middle school students, it fails because of their duration 4 activities. Perhaps I could add "Not_required_senior" and the constraint works as you have above, and also "Not_required_middle", occupy max real slots <= dur - 4. Is that OK?

Actually, forget it. The middle school is much easier. For each student, we can just use max slots from selection, all activities with duration = 4, slots = FAKE hours, number occupied = 4. No special tag required.

Though if we change from 4 to (2 + 2), we might need to modify. Or is it the case, as with senior duration 8 activities, that if one subactivity from the group falls in FAKE then all must fall in fake? If so, we will not need to modify other than to select all activities with duration = 2.

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 12, 2019, 04:07:30 PM
I think we need to input an activity split into two: 2+2. And I'll modify the constraint two activities grouped to allow G4,G5 and A1,and A1' for them. Only for activities split into two, duration 2 each, total duration 4. So you need to add also constraints two activities grouped for these. I just checked the code - they will be placed together in the initial order automatically.

Let me know when I should start working on this customization.
I can get you the file in 15 minutes if you want it.
Quote
We have remaining that with three activities grouped allowing wraparound. And maybe other thing, but I want to see it is solving now. I would like to see it solving after doing two activities grouped (and you modifying those activities and adding constraints two activities grouped) and before doing three activities grouped.
The three activities grouped wraparound is low priority - for my school, I can schedule those activities manually and I do not think it will affect FET. Though it may be useful for others to have this flexibility (perhaps me too).

Liviu Lalescu

Quote from: ChicagoPianoTuner on August 12, 2019, 04:46:02 PM
Quote from: ChicagoPianoTuner on August 12, 2019, 04:42:39 PM
Quote from: Liviu Lalescu on August 12, 2019, 10:47:44 AM
I just added a new version, occupy max real slots "Not_required" <= dur - 6. I think this is not for generating correct solutions, but to help FET. Isn't it?

Same location: https://lalescu.ro/liviu/fet/download/custom/cpt/

I have been testing and there is a problem with how this constraint has been implemented. For senior students, it works fine, but for middle school students, it fails because of their duration 4 activities. Perhaps I could add "Not_required_senior" and the constraint works as you have above, and also "Not_required_middle", occupy max real slots <= dur - 4. Is that OK?

Actually, forget it. The middle school is much easier. For each student, we can just use max slots from selection, all activities with duration = 4, slots = FAKE hours, number occupied = 4. No special tag required.

Though if we change from 4 to (2 + 2), we might need to modify. Or is it the case, as with senior duration 8 activities, that if one subactivity from the group falls in FAKE then all must fall in fake? If so, we will not need to modify other than to select all activities with duration = 2.

So, I'll:

1) 2+2 must be in Fake or not Fake both. Customization.

2) Improve activities occupy max time slots for all Fake hours selected, so that it is internally faster. Customization.

3) Two activities grouped - allow G4,G5,A1,A1'. Customization.

Yes, I could use a file with 2+2 and these two grouped.

ChicagoPianoTuner

Quote from: Liviu Lalescu on August 12, 2019, 05:03:44 PM
So, I'll:

1) 2+2 must be in Fake or not Fake both. Customization.

2) Improve activities occupy max time slots for all Fake hours selected, so that it is internally faster. Customization.

3) Two activities grouped - allow G4,G5,A1,A1'. Customization.

Yes, I could use a file with 2+2 and these two grouped.
I think that all sounds good. Emailing you the file now.

Liviu Lalescu

#164
In your file you forgot to add the activities occupy max with all Fake slots, and I saw 3 constraints occupy max with only 1 activity.

I intend to optimize the activities occupy max if the selected slots are all the Fake slots. The other two changes are done.

Or you don't need occupy max with all Fake selected anymore? Should I put the snapshot as it is now?