FET Forum

FET Development => Suggestions => Topic started by: catalin on March 29, 2009, 12:51:07 PM

Title: Tag+Space constraints
Post by: catalin on March 29, 2009, 12:51:07 PM
I would find useful the addition of the following constraint:
-space constraint + activity tag constraint

e.g.: for the Activities tagged as "laboratories" to be able to set a certain set of rooms. The same for the Activities tagged as "courses".

(there is a workaround but this requires to specify constraints for all subjects, which is much too much, considering that about half of our activities require a certain set of rooms)

Thank you,
Catalin
Title: Re: Tag+Space constraints
Post by: Volker Dirr on March 29, 2009, 02:10:56 PM
ok. that feature is currently missing.
it shouldn't be to difficult to add.
Let's wait for Livius answer.
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on April 03, 2009, 01:46:40 PM
Just to make sure, are you suggesting constraint activity tag preferred room(s)?

Later edit: Is that constraint enough for your necessities? Do you need other constraints?
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on April 06, 2009, 06:03:09 PM
I have implemented this constraint (it took less than 2 hours :-)

The link to the snapshot, as usual, on http://lalescu.ro/liviu/fet/download/test/ .

Please test thoroughly, open/save this constraint, check that it functions correctly, with weight 100% or below.

Please let me know.

Catalin, I hope you can help with testing. Translators, please translate the new fields.
Title: Re: Tag+Space constraints
Post by: catalin on April 08, 2009, 03:39:18 PM
Ok...

I have a sample input file filled with everything.

For the new constraints (Activity Tag Space Constraints):
-Course - amphitheaters , 100%
-Labs - laboratories, 100%
-Seminars - 2 constraints - special rooms for seminars and projects 100% AND laboratories + amphitheaters, 95%
-Projects - 2 constraints - special rooms for seminars and projects 100% AND laboratories + amphitheaters, 95%

Please tell me if this constraint set is possible.

[Later edit]: FET stops after about 2-5 minutes with "Simulation interrupted. FET could not find a perfect timetable...."

Catalin
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on April 08, 2009, 04:28:27 PM
I think I know your problem:

activity tag pref rooms: seminar. Please add ALL allowed rooms with 100% and the preferred rooms with 95%. I mean, as it is now, COPY rooms from 95% to 100%.

Please let me know if now is solvable and attach the new file.

For example, if preferred rooms are: R1, R2 and not preferred but allowed are R3 and R4, add 100% R1, R2, R3, R4 and 95% R1, R2.
Title: Re: Tag+Space constraints
Post by: catalin on April 08, 2009, 04:32:00 PM
Through the 2 constraints above I would like something like this:
1. fill in courses and laboratories (100%) in the allocated space
2. fill in seminars and project (100%) in the allocated space
3. for the seminars and projects, if there are not enough rooms fill in other available rooms, meaning rooms for courses and labs (95%)

In my tests:
- FET filled in rooms for seminars (100%)
- _did not_ filled any room for courses and labs

I attache a new input file, this time smaller, with fewer activities
Catalin
Title: Re: Tag+Space constraints
Post by: catalin on April 08, 2009, 05:14:58 PM
QuoteI think I know your problem:

activity tag pref rooms: seminar. Please add ALL allowed rooms with 100% and the preferred rooms with 95%. I mean, as it is now, COPY rooms from 95% to 100%.

Please let me know if now is solvable and attach the new file.

For example, if preferred rooms are: R1, R2 and not preferred but allowed are R3 and R4, add 100% R1, R2, R3, R4 and 95% R1, R2.
Ok, it works like that, but it fills up the amphitheaters with seminars/projects (and, of course, courses) and the rooms for the seminars stay empty.

The way I proposed the constraints, it should:
- fill up the amphitheaters (rooms for courses) with course activities (100%);
- fill up rooms for seminars and projects with this kind of activities (100%)
- fill up the rest of amphitheaters with seminars/projects activities (95%)

Please see the attached input file. rooms CP1-6 are the amphitheaters mentioned above, while the BP1-7 (seminar rooms) are almost empty.

Catalin
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on April 08, 2009, 05:58:26 PM
I think you are wrong. Add preferred rooms 100% for seminars: all rooms. Then 95% for act. tag seminar, rooms: seminars and projects rooms.

Modify 95% to 90% or 97% or 99%, if it is too much or low.

You cannot have exactly your requirement, you need to find a good value (this 95%), that gives you a good solution, in which all seminar rooms are filled. Maybe a higher value is better, but you need to have a solvable timetable.

Please let me know.

LATER EDIT: In FET, each constraint with 100% is satisfied all the time, with 95% is satifisfied in about 95% of cases (more or less).
Title: Re: Tag+Space constraints
Post by: Volker Dirr on April 08, 2009, 08:44:56 PM
hmm... i don't like the use of less then 100% weight.

i would do it this way:

for example about the labs:

first count the number of free periods of the labs:
freeRoomPeriods=numberDaysPerWeek*nuberHoursPerDay*NumberOfLabs - not avaliblePeriods of Labs

then count the number of periods that must be scheduled in the labs.

if that number is lower then the freeRoomPerios, then you hopefully can use only 100% constraint and FET hopefully find a perfect timetable.


but i guess you already thought about that and you have the problem that there are maybe 10 activitiy-periods more then free room-periods.

so your idea is:
add rooms with less then 100% space constraint.

i think that is not good. you can/should only work with 100% constraints.

so think about you activities that must be in labs. select at least as many activities as you have missing room-perios. (so in my example at least 10). that activites must be in other rooms.

maybe you will say now: why should i select it? FET should select the "best" one.
In my opinion that is incorrect. why? if FET do it, you maybe generate 10 timetables and now see different "problems" (conflicts, because of less then 100% weight.). so you choose unlucky activites AFTER generating.
that is wasting a lot of time, because there might be also other conflicts in your results.

so i think it is best to do this selection before!
so you maybe talk to the teacher. maybe in special classes/year he don't need every time the lab.
i teach physics in lab and computer science in an other lab, but i know that in some years/classes the lab is not always needed, in other i need 100%. so ask the teacher: "we have a room problem. i can't store all activities in the lab. can you tell me activities that must not be in the lab."
Maybe he need only 3 out of 4 periods per week in the lab.
of course, if all teachers say: i need 100% lab, than you have bad luck.

so you can at that /sub)-activities an other room (with 100%.)

so you see:
1. i use only 100% constraint.
2. i talk/decide about problems BEFORE generating the timetable. that will avoid a lot of trouble.
3. you will find faster and better tables by that.
4. you don't need to check the conflicts later manualy (because you will have no one) so you are much faster (espicialy if you also use less then 100% weight to other constraints.)


if you have bad luck and all teachers need the room, then you can/should do this:
a) increase the number of working days
b) increase the number of periods per day
c) ask your chef to get a new room
d) tell every teacher that he must do x hours in other rooms and he should tell you which activities that should be. (maybe keep that list for th next years, so you can be fair over the next years to all teachers.) of yourse work only with 100% constraint.
Title: Re: Tag+Space constraints
Post by: catalin on February 11, 2010, 12:53:56 PM
QuoteI think you are wrong. Add preferred rooms 100% for seminars: all rooms. Then 95% for act. tag seminar, rooms: seminars and projects rooms.

Modify 95% to 90% or 97% or 99%, if it is too much or low.

You cannot have exactly your requirement, you need to find a good value (this 95%), that gives you a good solution, in which all seminar rooms are filled. Maybe a higher value is better, but you need to have a solvable timetable.

Please let me know.

LATER EDIT: In FET, each constraint with 100% is satisfied all the time, with 95% is satifisfied in about 95% of cases (more or less).

Hi,
I've reviewed a little this old topic and I'm still not elucidated... How should I "Add preferred rooms 100% for seminars: all rooms"? Should I go through each activity and specify that if it has seminar the importance to be 100%? That should be a little to much because I have many activities with this tag...

The same is for Courses and Labs...
Please see my input file...

Thanks,
Catalin
Title: Re: Tag+Space constraints
Post by: catalin on February 11, 2010, 12:58:48 PM
Sorry... I've forgot to delete some constraints..

this is the correct file.
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on February 11, 2010, 01:46:29 PM
Quote

Hi,
I've reviewed a little this old topic and I'm still not elucidated... How should I "Add preferred rooms 100% for seminars: all rooms"? Should I go through each activity and specify that if it has seminar the importance to be 100%? That should be a little to much because I have many activities with this tag...

The same is for Courses and Labs...
Please see my input file...

Thanks,
Catalin

I mean add a new constraint, 100%, seminar, all rooms.

Please see attached file. There is one constraint added, this is how I think it should be done.

There are 4 space constraints activity tag preferred rooms (Curs 99%, Seminar 99%, Laborator 99%, Seminar 100%, in this order).

I tried to make constraint 1 in this list (first, Curs) with 100%, but it cannot solve the timetable. I also tried 100% for constraint number 3 (Laborator), but it cannot find a solution anymore.

You should play with the constraint number 2 (Seminar 99%), lower if impossible and higher it if unsatisfactory results.

I saw that solving this new file adds a lot of Seminar activities into the Laborator rooms. This is normal if Seminar rooms are not enough for Seminar activities and Laborator rooms are not occupied.

Please let me know what you think.
Title: Re: Tag+Space constraints
Post by: catalin on February 11, 2010, 02:29:24 PM
Thank you for the setting

I do not mind that seminaries go into course rooms... but I do mind that there are a lot of un-allocated activities to rooms (as soft-conflicts)... How do I get rid of them?

If I set the constraints to 100% FET cannot generate a timetable... if not (<99%) I get unallocated activities although there are free rooms.

Catalin
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on February 11, 2010, 02:49:26 PM
QuoteThank you for the setting

I do not mind that seminaries go into course rooms... but I do mind that there are a lot of un-allocated activities to rooms (as soft-conflicts)... How do I get rid of them?

If I set the constraints to 100% FET cannot generate a timetable... if not (<99%) I get unallocated activities although there are free rooms.

Catalin

You should set constraints for Curs and Laborator to 100%. Now, if FET cannot find a solution, it means simply that your timetable is too constrained. I tried on a timetable for the previous file attached here. Activity id 4 was placed at slot Luni 11:20. But on this slot, there is no Curs room free. What you want is too constrained (well, it could be a FET bug, but it is very improbable, because I got no bug reports about that).
Title: Re: Tag+Space constraints
Post by: catalin on February 12, 2010, 07:17:46 AM
Hi,
I've checked the data again and it seems that I needed more Course rooms.... When I added them FET could solve the timetable even with 100% all contraints

One more question: is it possible to have for students one free day? For teachers I use "max days per week for all/one teacher/s"
Thanks
Catalin
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on February 12, 2010, 07:23:07 AM
QuoteHi,
I've checked the data again and it seems that I needed more Course rooms.... When I added them FET could solve the timetable even with 100% all contraints

That is good to hear!

Quote
One more question: is it possible to have for students one free day? For teachers I use "max days per week for all/one teacher/s"
Thanks
Catalin

There is no direct constraint. There is possible this trick: use constraint students interval max days per week, interval = whole day, max days=n_days_per_week-1. Let me know if it works.
Title: Re: Tag+Space constraints
Post by: catalin on February 13, 2010, 07:56:55 PM
It does not... it allocates about 480/560 activities this way...
questions:
-why does this constraint (students work in an hourly interval max days per week) has to weight 100%?
-why max days per week for all/one teacher/s has to be 100%?

if the weight could be lowered it would be more flexible, isn't it?

Thanks,
Catalin
Title: Re: Tag+Space constraints
Post by: Liviu Lalescu on February 13, 2010, 08:10:06 PM
QuoteIt does not... it allocates about 480/560 activities this way...

Maybe you could try to see which students set has problems and remove this constraint from it (FET will tell you the impossible activity, and the students are of this activity).

Quote
questions:
-why does this constraint (students work in an hourly interval max days per week) has to weight 100%?
-why max days per week for all/one teacher/s has to be 100%?

if the weight could be lowered it would be more flexible, isn't it?

Thanks,
Catalin

Hmm...sensitive part.

I could not make it. I would like. But the fact is that FET will not respect this constraint unless it has a very high weight, say >99.99. And normal users don't know this. Also, weight under 100% for these constraints will complicate things a lot.

I hope people learning my current algorithm will come up with a better one.

Now let me tell you something: a person told me this: aSc timetables (commercial program), he generated timetables, and aSc, which automatically tries to minimize teachers' gaps, found a solution with 4 gaps per week. When this person put maximum gaps 2 per week, aSc was again able to find a solution. What can we learn? That constraint max gaps per week for teachers with less than 100% weight will not find the optimal solution (aSc probably adds a constraint max gaps per week for teachers with weight <100% if you don't specifically tell it the maximum gaps per week, in which case it adds a constraint with 100% weight).

So, if you put weight under 100%, you'll get worse timetables than it is possible.

Let me know if I was clear.