The generation gets stuck, but I can't get out of the infinite loop

Started by infoo_, January 18, 2023, 07:00:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

infoo_

Hello

I need help with some mysterious activities.

I am attaching a FET file* and the problem seems to be found with the following (sub)activities:

46 -    2/3 - Teacher O - Geografía - 1C - 1C
    47 - 1/3 - Teacher O - Geografía - 1C - 1C
107 -    2/3 - Teacher O - Geografía - 2C - 2C
    108 - 1/3 - Teacher O - Geografía - 2C - 2C

TEACHER O'S AVAILABILITY TIME:

You cannot view this attachment.



58 - 1 - Teacher S - Microemprendimiento - 1C - 1C
119 - 1 - Teacher S - Microemprendimiento - 2C - 2C


TEACHER S'S AVAILABILITY TIME:

You cannot view this attachment.



315 -    2/3 - Teacher AQ/Teacher AY - Artes Visuales/Música - 1C - 1C
    316 - 1/3 - Teacher AQ/Teacher AY - Artes Visuales/Música - 1C - 1C

321 -    2/3 - Teacher AQ/Teacher AY - Artes Visuales/Música - 2C - 2C
    322 - 1/3 - Teacher AQ/Teacher AY - Artes Visuales/Música - 2C - 2C


TEACHER AQ'S AVAILABILITY TIME:

You cannot view this attachment.



As you can see, the available space is just enough (except for Teacher O who has some extra availability time).

Specifically, I am 99% sure that there is a conflict on Monday afternoon i.e. 1º 12:50-13:30 to 8º 17:50-18:30

This is a distribution that I found to be possible on Monday afternoon for sets 1C and 2C (it required a little of manual work but don't that much):

TABLE A:
1C2C
LUNES    1º 12:50-13:30    Teacher O - GeografíaSome subactivity here
LUNES2º 13:30-14:10Some subactivity hereTeacher O - Geografía
LUNES3º 14:20-15:00Some subactivity hereTeacher AQ/Teacher AY - Artes Visuales/Música
LUNES4º 15:00-15:40Some subactivity hereTeacher AQ/Teacher AY - Artes Visuales/Música
LUNES5º 15:40-16:20Teacher S - MicroemprendimientoTeacher AQ/Teacher AY - Artes Visuales/Música
LUNES6º 16:30-17:10Teacher AQ/Teacher AY - Artes Visuales/Música    Teacher S - Microemprendimiento
LUNES7º 17:10-17:50Teacher AQ/Teacher AY - Artes Visuales/MúsicaSome subactivity here
LUNES8º 17:50-18:30Teacher AQ/Teacher AY - Artes Visuales/MúsicaSome subactivity here

However, I am not able to get the FET out of an infinite loop because it gets stuck at max = 282 placed activities every time I generate.

I have checked all constraints (I have deactivated those constraints refer to tag = 1C, 2C, 3C) but same result.

But if we deactivate Teacher S's availability time, it exits the "loop" and continue after 282 (I didn't check if the timetable is generated after all, but that 282 frustrates me too much).

I have also added (but deactivated) "An activity has a preferred starting time" to distribute the subactivities like TABLE A but same behaviour. You can test with those if you want, they are deactivated.

Do you have any idea what could be happening? I manually translated the distribution into FET and it should be like that, why doesn't FET continue after 282?

Thanks in advance

* This FET file is a bit different from the last one, because I realized that Teacher O had wrong availability time, and I have also forget to edit Teacher S's availability time. So 2 major changes.

Volker Dirr

Be carefull, since this might be wrong:
Quote: "But if we deactivate Teacher S's availability time, it exits the "loop" and continue after 282"

Sadly sad might be WRONG! Because if you deactivate that constraints, then the activites might have got an other order! So it might still hang in the same loop with the same activity (new number!) a bit later.

So please check carefully in the first problem (with time constraint) which activity is number 283.
Then delete the constraints. And check the order of the activities is changed. The old activity 283 might no be at a totaly different place! Please let FET generate and check if it was able to place the "old 283" (might be now "400"). Only if it place the activity you might have found the problem. Check the new activity that isn't able to be placed. It might be a new problem or still the old one! If it is a new problem, then fix the new problem. If you can't see a problem, then it might be still the old problem! In that case the old acitity 283 and the "new" activity have the "same" problem. (So they might share the same room, the same teacher or the same room). If both activities have such a "share" thing, then normaly there is the bug that you need to solve.

Liviu Lalescu

Hello,

I just generated successfully on your file. I attach my file (just renamed your file and saved it with my future FET-6.8.3 from my hard disk - ignore the warning when opening) and two solutions.

Maybe you want more constraints to be added?

Edit: I think your file has deactivated the Teacher S's not available times constraint, that's why it is solvable.

infoo_

Hello

Quote from: Liviu Lalescu on January 18, 2023, 05:26:59 PMEdit: I think your file has deactivated the Teacher S's not available times constraint, that's why it is solvable.

That's right. Sorry for kept it deactivated.

I need Teacher S's available time activated. He only has 2 activities of duration = 1 each one, and he must have only 2 available slots (see Teacher S's available time).

That's why it stops at 282.

Liviu Lalescu

Yes, I saw this. I'll try to see the reason and let you know.

Liviu Lalescu

OK, problem found and solved, but I don't know if it is good for you. You need to allow one beginning at second hour for students set 2C. See attached file and solution.

Please let me know.

PS: In your future files, you don't need to add year 2023. You can add years 1, 2, 3, 4, and 5. In Romania the year means also the superior students set, when used in schools.

infoo_

Hello

Quote from: Liviu Lalescu on January 18, 2023, 06:38:46 PMOK, problem found and solved, but I don't know if it is good for you. You need to allow one beginning at second hour for students set 2C. See attached file and solution.

Why is it necessary?

Does that mean that 2C arriving time can start at period 2º on afternoon instead of 1º like the others?

Quote from: Liviu Lalescu on January 18, 2023, 06:38:46 PMPS: In your future files, you don't need to add year 2023. You can add years 1, 2, 3, 4, and 5. In Romania the year means also the superior students set, when used in schools.

Ok, thank you! The first days I use FET I didn't know that year refers to year 1, year 2 etc. but the calendar year. Will it be problematic if I make the Year changes in the FET file at this point, or it should be changed at the beginning of creating the file?

Liviu Lalescu

Quote from: darkwindow on January 18, 2023, 10:53:06 PMWhy is it necessary?

Does that mean that 2C arriving time can start at period 2º on afternoon instead of 1º like the others?

It is probably because there are too many activities necessary in other days for 2C.

Of course.

Quote from: darkwindow on January 18, 2023, 10:53:06 PMOk, thank you! The first days I use FET I didn't know that year refers to year 1, year 2 etc. but the calendar year. Will it be problematic if I make the Year changes in the FET file at this point, or it should be changed at the beginning of creating the file?

Can be changed, but by tricks and it is a bit unsafe. No problem if you leave it.

infoo_

I'm sorry, but the school requires all students to start at the first hour. So "one beginning at second hour for students set 2C" should be deactivated.

Is there any other solution? No problem if you can't help right now (it's late)

Liviu Lalescu

Probably if FET says "no", it is "no". Think of the reason this constraint (early 0 for 2C) cannot be respected, and try to solve it.

infoo_

Quote from: Liviu Lalescu on January 18, 2023, 11:03:56 PMProbably if FET says "no", it is "no". Think of the reason this constraint (early 0 for 2C) cannot be respected, and try to solve it.

Ok, I will do my best. Thanks for the huge help!

Liviu Lalescu

You can make other constraints easier, considering what I found. For instance, you might allow 5 hours on a day for 2C (so, ease the constraint min hours daily for 2C - add min 6 hours for all the other students and min 5 hours for 2C). Or ease other constraints (keeping 0 late beginnings for all the students).

infoo_

Quote from: Liviu Lalescu on January 18, 2023, 11:16:50 PMease the constraint min hours daily for 2C

Unfortunately, all students must have a min hourse daily = 6, because they can't leave before 7º hour.

Quote from: Liviu Lalescu on January 18, 2023, 11:16:50 PMOr ease other constraints (keeping 0 late beginnings for all the students).

This is a good idea

infoo_

Quote from: Liviu Lalescu on January 18, 2023, 11:03:56 PMProbably if FET says "no", it is "no". Think of the reason this constraint (early 0 for 2C) cannot be respected, and try to solve it.

Good news! It turns out that coincidentally, I teach 2C, and I did not want to have 2C (I teach them 1 hour per week) in the early afternoon, so in my available time I marked that row with an X. Last year I happened to have them at that period... and a while ago I tried changing my available time (marking an X only in one slot and unmarking it in another slot, nothing else). But then I thought: "What if the main problem is because I don't want to teach in hour 0 on 2C?", and you know what? Made that little change, hit on Generate new, wait, and... Problem solved! 2C can finally start at hour 0 on Fridays*, as it was agreed at the beginning and that gave us so many headaches.

I haven't sent the schedule to the school yet, but at least I'm calm that a bigger problem could be solved by that small change (although I'm not very happy haha, but that's another story).

* Originally the problem was on Mondays, but apparently FET left the first hour free on Friday.

Liviu Lalescu

Oh, you should have thought that this was the problem. Glad it is solved!