Main Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - darkwindow


We had a pretty decent timetable. Recently a teacher changed its available times, so we need to reestructurate some preferred starting times. The teacher only teachs in "Afternoon hours" (the last 8 periods of 16 total periods), so only "afternoon" activities should be moved.

Below there is a list of problems and each problem have its corresponding problematic FET file, and I have attached a rar with a working FET file (the generation takes around 1 min).

Each Problem is commented in the files with a comment "OP: Problem X" e.g. OP: Problem C-1

Problem A: Acts of Teacher A should have a set of preferred time slots on Martes, Miércoles and Jueves. It seems it placed on Viernes but we want to place on Jueves.

Problem B: Teacher B and Teacher M are the same, and both teachers didn't teach on Lunes afternoon. But now it seems one of them (B) should teach on Lunes afternoon. We want to place its activities everywhere except Lunes afternoon.

Problem C-1: Before it seems that min days between activities was broken:

id=118 (    1/5 - AM - MATEMÁTICA - 2C - 2C)
id=117 (    2/5 - AM - MATEMÁTICA - 2C - 2C)

Now I would like to know if we can solve this issue.

Problem C-2: Also, related to teacher AM, before he had gaps = 4 on Miércoles only. But now, every generation shows that he has gaps = 4 on Martes and gaps = 6 on Miércoles. The latter is very frustrating. Could we reduce to max gaps per day = 4 or 3?

Problem D: Teacher BA usually have max gaps per day = 3, every week usually he has 8 gaps (I'm not counting the gap of the morning, since we should keep morning locked). Could we reduce to max gaps per day = 2 or something like max gaps per week = 7 or 6?

Problem E (should be solved after Problem A or Problem B): We would like to have Teacher AN teaching Matemática in 2C and Teacher AM teaching Matemática in 3C. But it seems impossible when I generate.

Each FET file is a separated problem file. We wish to achieve at least one satisfactory file, and then try to solve multiple problems in one FET file by combining several problems into one and try to generate a FET file. For example, Problem A was solved; then try to add Problem B into Problem A FET file and generate.

Important: Some constraints related to preferred starting time are activated. They are the "morning" activities. All my attempts were with this constraints activated since the teacher's available times change was only of "afternoon" activities, so there is no need to move activities of the morning. But, if you find that some problem is solved by deactivating some acts preferred starting times of the "morning", please let me know. I should ask for permission if we move some activity of the morning.

Can someone try to solve at least one problem with more threads, please? I tried ~5 minutes each generation but I couldn't solve any of the above issues.

All you have to do is open each Problem file, generate and see if it is completed. Then try to 1) Combine two problems into one and try to finish it, 2) if 1) is impossible, you can disable activities preferred starting times of the "morning" hours (not recommended, but possible if strictly necessary).

Thank you!!

Please see attached FET file with data and timetable. That is the last achieved timetable.

However, the school told me that soonly there will be a swap between Teachers AM and AN on courses 2C and 3C.

So in order to make this working, they told me that on Martes on hours 1º and 2º (of afternoon) it can't be teached Matemática because of teachers AM and AN not available times.

So I created the following constraint (it is last on the unordered time constraints list):

Time constraint
Activities with:
Activity tag=2C

If you deactivate it, you will get a complete timetable.

So I tried to deactivate all acts preferring starting times, but it seems impossible.

What would you propose to solve this issue? Please let me know what changes you made to the file.

Thank you!

ADDED: The person in charge of doing the timetable told me that he could not solve this. If he can't by hand, I guess we can't by computer :)

Recently Teacher BF restricted its available times, so I need to work with this change but the generation takes too long. I waited for ~28 minutes and it stucks around 309/325 319/323 activities.

The FET file is attached.

Can someone try with more threads, please? Or instead, flexibilize some constraints but give me warnings about what constraints were modified.

In the meantime I am trying without success.

Teacher Q must have max gaps per day = 0 or 1 (in the file is set 1).

Thank you!

EDIT: Teacher BF restricted even more than I thought. I upload the updated FET file while I am generating. I also deactivated

X - Teacher min hours daily, WP:100%, T:Teacher BF, mH:2, AED:yes
X - Teacher max gaps per day, WP:100%, T:Teacher BF, MG:2

so we can play a little more. But it would be great if those restrictions are activated again. Also we can temporally remove min days between activities of this teacher, but it should be necessary to keep them activated.

Everytime I want to upload a FET file into the forum, I want to delete unnecessary "activity preferred starting times" constraints that were from past files for size purposes.

I can do Remove + Enter every time, but it is not as fast as I would expect (my file has ~300 unused activities plus files with past generations it can have ~600 unused activities).

I need to know how to delete them when the constraints are and are not deactivated more quickly.

I tried searching inside the XML FET file and deleting some <tags>, but I don't quite understand what tags I should remove.

I seemed to see that they were in different positions in the code, so I'm sure that I can delete something wrong.

Thank you!
Get Help / Need help with these constraints for a school
February 21, 2023, 08:03:30 AM

I took most of your suggestions and put a lot of effort in generating the attached FET file.

The school almost approved it, but I need to fix some issues (some are fixed, so I don't include them here):

1º) Teacher max gaps per day, WP:100%, T:Teacher Q, MG:2 must have MG = 0 or MG = 1 (ideally MG = 0)

2º) Matemática Teacher A on 4C must respect min days between activities = 1 100% (max hours = 2 instead of 3)

3º) (Optional) Teacher max gaps per day, WP:100%, T:Teacher AQ, MG:2 should be MG < 2

The most important is to solve 1º), the others are important but not as the first one.

I attach the file with data and timetable because if I deactivate placed activities, the generation is never finished. I don't know why. I only changed teacher's name for privacity. You can deactivate all of them, no problem. If you want to try without activate placed activities, here are the seeds that were from the successful generation (I remember it took ~3 min):

Generation started on: 2/21/23 2:31 AM

The random seed at the start of generation is:
   s10=1520584588, s11=1930088439, s12=555555873,
   s20=3874092411, s21=2482283404, s22=3106961385.

This file was automatically generated by FET 6.8.4.


Generation ended on: 2/21/23 2:34 AM

The random seed at the end of generation is:
   s10=1831861930, s11=4000834580, s12=3414413369,
   s20=765949400, s21=4205607824, s22=1172350969.

This file was automatically generated by FET 6.8.4.

General Stuff / Max gaps between 2 teachers = 0
February 20, 2023, 08:16:47 PM

I have 2 teachers. Teacher A and suppose he is substitute of another teacher, say "Teacher B (Substitute is Teacher A)". That's why I have 2 different teachers, altough it is temporally the same teacher but with different names.

I set Maximum gaps per day=0 for Teacher A and Maximum gaps per day=0 for Teacher B (Substitute is Teacher A), it works fine.

But I realized that in the timetable, on Mondays both teachers have a gap of like 4 or 5 hours.

So I think I need to also specify that both teachers must also have max gaps = 0 between its activities, in some way. So both teachers don't have any gaps between them.

I thought about consecutive activities but I don't want to specify an activity of Teacher A to be consecutive to another activity of Teacher B (Substitute Teacher A), but FET should find the combination that fits better.

Maybe something like "Max gaps between two teachers = 0".

Is there a trick to achieve this?


I work on Windows. While FET is generating a timetable I am on other apps, thus FET windows is not on top.

If the generation takes too long, sometimes I left the computer and do other things, and FET windows is not on top.

It also happens that I put music and I don't hear the pop up song that FET plays when the generation ends.

So it would be great if FET, after a generation is successful, could be brought to the top of any open window in Windows, or at least put the alert in orange on the taskbar (see image)

This would save me having to wait unnecessary time, and thus be able to continue working with FET more quickly.

You cannot view this attachment.

Maybe test what happens if there is more than 1 running instance of FET on the computer (if those instances are generating / not generating).

Get Help / How can we place all activities?
February 10, 2023, 05:40:43 PM

Finally I think I reach the final constraints. Now I would like to generate a full timetable.

Please see the attached FET file.

This time I deactivated some room constraints like Liviu suggested on a previous thread. But I need to keep rooms of Artes Visuales / Música activated because it is mandatory that those teachers must teach at the same time.

I didn't change "max hours daily" because I did not understand how to do it from here:

I also "split" some activities of 4C -- you can rollback if it is better. Perhaps we can do more splits to generate a full timetable.

@Liviu Lalescu could you change some of activities of other courses (not all) to see if a complete timetable is generated (using the attached file), please? I would not like to abuse these more flexible constraints (even if it is legal to do it) since teachers complain because they have many hours with the same course, so I would like to avoid that as much as possible.

Thank you!

Reuploaded FET file! Literally 10 minutes ago someone wrote me to change "Teacher T (Suplente Teacher E)"'s available times, it should be available last 3 slots of Jueves and Viernes. I reuploaded the file

I have set teachers activity tag max hours daily for each activity tag (suppose 100%). In my case, each activity tag is just every activity of each course from 1A,1B,1C,...,5A,5B,5C.

This restrict the hours that a teacher have with a course every day to max = 2.

However, the school told me that a teacher can teach to a course more than 2 hours daily, if and only if the number of subjects he teachs is > 1 i.e. the overrun of max hours daily cannot happen if total subjects = 1.

For example:

Teacher A teachs 4 hours of Literature on Mondays on course 1A <- It can't happen with "teacher activity tag max hours daily"

Teacher A teachs 2 hours of Literature on Mondays and Fridays on course 1A <- Can happen with "teacher activity tag max hours daily"

Teacher A teachs 2 hours of Literature and 2 hours of Arts on Mondays on course 1A <- It can't happen with "teacher activity tag max hours daily" Here we can have this possibility i.e. a teacher can teach 2 subjects the same day with total duration > 2 on course 1A

This is better than I have on my schedule, because we are allowing a greater max. The only restriction is that for one subject, it must have max = 2 hours daily.

Would this improve the time generation?

Did I explain myself well enough? Is there something similar in FET?

Please see the following FET file:


Please see attached FET file.

Recently I have changed some activities (I have not deleted and created them again, I simply used the "Modify activities" option): I have swapped the teachers that were on those activities - nothing about courses, nothing about teacher's available time.

Teacher P has enough available time: 10 slots, where 6 slots are on afternoon.

I don't know why it got stuck at:

Id: 234 (2 - Teacher P - Formación Ética y Ciudadana - 4C - 4C)

since it has enough slots.

I deactivated all constraints related (except available time) to Teacher P and it still gets stuck at 234. When I activate them again and deactivate Teacher P's available time, the generation is not stuck. Don't know why. I didn't wait if the generation get stucks at a future activity.

Can you help me, please? I am getting crazy.

Thank you!

P.S. If we add an extra slot of available time on 6º 16:30 - 17:10, the generation does not get stuck (I didn't wait if the generation get stucks at a future activity). It seems very strange to me!


I have "Subject A" that has to be teached on courses 3C, 4C and 5C simultaneosly (for example at hour 3 of Mondays). We have available one teacher for each activity.

However, it doesn't matter where these teacher can teach: Teacher 1 can teach Subject A on 3C, 4C or 5C. The same for Teachers 2 and 3.

I can say that for example:

Teacher 1 teachs Subject A on 3C at hour 3 on mondays
Teacher 2 teachs Subject A on 4C at hour 3 on mondays
Teacher 3 teachs Subject A on 5C at hour 3 on mondays

But it is also possible that:

Teacher 3 teachs Subject A on 3C at hour 3 on mondays
Teacher 1 teachs Subject A on 4C at hour 3 on mondays
Teacher 2 teachs Subject A on 5C at hour 3 on mondays


Is there any way to achieve this?


Suppose we have an activity of duration 2-2-1.

I want that any of the subactivities (first 2, second 2 or 1, it doesn't matter) has a preferred starting time only on a certain day.

For example, Math of course 1C which has 3 subactivities:

- Duration 2
- Duration 2
- Duration 1

I want that any of the above has to start on 7º hour of Fridays (the schedule has 8 periods per day, so FET can pick one of duration 2 or duration 1).

I tried "An activity has a preferred starting time" but I'm forced to choose an activity.

I tried "A set of activities has a set of preferred starting times" but I'm forced to choose Friday and other days, since I want Friday starting time of duration 2, and the other 3 duration to be anywhere else.

In short:

Instead of:

Time constraint
Activity with id=56 (    2/5 - Teacher - 1C - 1C)
has a preferred starting time:
Hour=7º 17:10-17:50
Weight (percentage)=100%
This activity is permanently locked, which means you cannot unlock it from the 'Timetable' menu (you can unlock this activity by removing the constraint from the constraints dialog or by setting the 'permanently locked' attribute false when editing this constraint)

Something like:

Time constraint
[Randomly choose one activity of: Activity with [id=56 (    2/5 - Teacher - 1C - 1C )] OR [id=55 ( 2/5    - Teacher - 1C - 1C )] OR [id=57 (    1/5 - Teacher - 1C - 1C )]
has a preferred starting time:
Hour=7º 17:10-17:50
Weight (percentage)=100%
This activity is permanently locked, which means you cannot unlock it from the 'Timetable' menu (you can unlock this activity by removing the constraint from the constraints dialog or by setting the 'permanently locked' attribute false when editing this constraint)

Is that possible?

Thank you!!

Just a basic question:

Can we swap between two activities (maybe from different students sets and/or different subjects) of the same teacher without modifying other activities, if they are not related and/or not related with other activities constraints (such as activity preferred starting time, set of activities not overlapping etc.)? To achieve this, we add 2 constraints "an activity has a preferred starting time".

For example:


Teacher A teachs Math in 1A on Mondays on 1º and 2º hours. Also, Teacher A teachs Literature in 1B on Fridays on 5º and 6º hours.


Teacher A teachs Math in 1A on Fridays on 5º and 6º hours. Also, Teacher A teachs Literature in 1B on Mondays on 1º and 2º hours.

Thanks in advance

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


You cannot view this attachment.

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


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


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):

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.

Suppose we have generated a timetable on January.

On March, a teacher's left and the activities related to him are assigned to another teacher. Every teacher has its own "A teacher's not available time", thus if we try to generate another timetable, it is probably that a lot of activities will be allocated in another periods.

So my question is: If a schedule needs to be changed, how to automatically prevent unwanted allocation changes?

That is, modify the minimum amount of activities possible, and that the activities that really need to move do so.

A useful insight came from an answer of @Liviu Lalescu :

Quote from: Liviu Lalescu on January 15, 2023, 08:36:01 PMIf your file is "name.fet", open "name_data_and_timetable.fet", from the results, with FET, and generate it. It has all the activities locked.

However, I don't understand how "locked activities" work (where can we find them?) and how can I use this to prevent a lot of allocation changes.

I would like an automatic behaviour, but if it's not possible, what activities should I lock? If I lock some activities that should be unlocked, then an impossible timetable could arise?

Thanks in advance

So many thanks to Liviu for helping me designing the timetable!

After checking some details with the school (and thus adding some extra constraints :-\), now I think I have everything ready to generate the timetable.

I have looked at everything very carefully to check that there are no impossible situations, as well as enabling incorrect constraints, and I think that everything is fine.

I hit the Generate multiple timetables button, and... this happened:

Timetable no: 1 => (Thread 1) Simulation stopped. Maximum placed activities: 294 (at 42 m 46 s).
Timetable no: 4 => (Thread 4) Simulation stopped. Maximum placed activities: 294 (at 30 m 15 s).

Simulation interrupted!

On the disk there were saved all the highest-stage timetables (the highest number of activities reached is 294,
reached in 2 timetables).

The results were saved in the directory C:\Users\......-multi.

Total searching time was: 1h 15m 24s.

This file was automatically generated by FET 6.8.0 on 1/16/23 10:44 PM.

After 1h 15m 24s it can't generate any single table on 4 threads! That's so frustrating. :'(

That's why I need your help to understand why I can't generate the timetable with the requirements I need.

Some clarifications:

1) There is an exception for certain teachers to teach max 2 hours per day for an activity tag. Those are the teachers who teach Artes Visuales/Música. Artes Visuales/Música subject that has duration = 3 for every course can be teached on the same day, so that's why I added an extra constraint with max = 16 hours (also because it was annoying that it always appeared as a broken constraint). But this is NOT the case of Artes Visuales only, because it has duration = 4, so it must respect split 2-2.

2) There are some _Unassigned teachers. The teacher "Unassigned" is a teacher who resigned those hours, and the hours became vacant. That's why it doesn't have "a teacher's not available time" constraint. BUT, some teachers requested licenses for those hours. In other words, at some point they can return to teach those activities, so 2 things must happen: 1) That the substitutes who took those hours, have the restriction "a teacher's not available time", and 2) that said substitutes do not overlap with other subjects they teach, that is, we prevent a teacher from being in 2 activities at the same time. That's why some teachers are called "_Unassigned [Teacher's name]".

Important notes (extra constraints needed):

3) Teachers min hours daily must be = 2 with 100% or something like 99.999%, except for those who teach 1 hour per week to a course like Teacher E/Teacher N with subject "Talleres de Educación Socio Afectiva/Lectura y Comprensión de Textos". I couldn't find a way to achieve it. Some teachers would be angry if they go to school for only 1 period. I need this.

4) Teachers cannot have free periods > 2 per day (ideally max = 2 free periods daily). Or maybe "max free periods per week = 3 or 4". By "free period" I mean a period where a teacher is NOT teaching. I think it's called "gap".

5) Both "Subactivities with component number = 1" and = 2 constraints should be activated, to prevent subactivities to be between break times.

6) Try to generate a table in a reasonably fast time. I know there's a lot, but I prefer not to wait more than 1 hour if possible.

I hope you can really help me get a schedule that I set out to do and I'm not achieving. Even if it is to help me generate in a reasonable time (such as lowering %'s) and how it can be solved 3), I would be very satisfied.

If there is something that is not understood, you can ask me

@Liviu Lalescu I sent you the FET file by mail because it was too heavy to upload to the forum. Have you received it?

Thanks in advance

EDITED: Solved the upload issue by attaching it as rar.

Sorry for posting questions in a short period of time.

The school where I work told me that A teacher must not teach in same course for more than 2 hours per day. They told me that so that both students and teachers do not become saturated with so many hours in front of class.

So thanks to the constraint "Min days between activities" for subjects that have duration > 2 and index > 1 I achieved a very good timetable.

However, this is not sufficient, because now I have some teachers that teach in 2 subjects in the same course, teaching more than 2 hours in the same day, as you can see here:

You cannot view this attachment.

You cannot view this attachment.

Is there an automatic way to prevent this?

I can add more "Min days between activities". Take the case of course 5B. If tomorrow the Teacher AU with the subjects "Lengua y Literatura" and "Taller de Lectura y Comprensión de Textos" leaves office, and those subjects are taken by 2 different teachers, then the artificially created constraint must be deleted. In other words, it depends on the teacher, when I would like it not to be like that. That's because I probably forgot to remove the constraint and add new ones.

I am also attaching the FET file so you can test. Taken from a previous message that I posted here:

Thanks in advance
Hello all

I was thinking about a little improvement. When FET is opened, a blank timetable is set by default (named Untitled on the top left corner).

I go to File > Open... > and select what FET file I want to continue working.

After I opened the file, the Print option is not available. It says "Please generate, firstly".

However, yesterday I have generated a timetable and in the timetable's folder it has all .html files. Everything is correct.

So I suggest that the Print option is enabled so that the print view can be accessed more quickly, instead of having to search for the containing folder on the computer.

I think this can prevent certain people who are sparse, not knowing that a folder is created on the computer, from regenerating the timetable and losing the distribution they had achieved after closing FET.

What do you think? Is it possible?


I realized that, when updating FET version, the older version file is kept on the same directory as the new one. I am on Windows:

You cannot view this attachment.

To remove an older version, do I need to move fet-6.2.5 folder to trash? Is that simple? Or should I remove other components from my computer?

Thanks in advance

Now I am filling the Teacher's not available times, I am getting a little nervous every time I go to Data > Time constraints > Teachers > A teacher > A teacher's not available times.

Is there an option to put this route to the right of "Help" in menu bar or anywhere close to it, so I can access faster?:

You cannot view this attachment.

Thanks in advance