FET Forum

FET Support (English) => Get Help => Topic started by: OppyLock on September 15, 2008, 06:22:09 AM

Title: How to respect these constraints?
Post by: OppyLock on September 15, 2008, 06:22:09 AM
I've got a data file with a few hundred activities in it that is getting close ... but not perfect.

What I'm after is a balanced timetable and I can't find a constraint to give FET the right hint about what to do.  FET is very capable of making everything fit according to the constraints, but the timetables still aren't good ones, because it can't be taught the unwritten constraints ... yet.

In each year there are several similar subjects.  Science subjects like Chemistry, Physics and General Science for example.  I'm looking to provide a balanced day so that in any day there is not too much emphasis on a particular theme.

Each year group isn't split into any subgroups ... they all do the same subjects at the same time.
The science subjects are all taught by different teachers and in different rooms.

I was going to do this by giving the subjects an activity tag of science and then limiting the amount of science with a 'max hours daily for student set+activity tag' ... but that doesn't exist.  Is there any way with the current rules to create such a constraint?
Another option would be 'Min gaps between activity tag' to force something else in between the science activities.
Or even 'Two subjects/activity tags must not be consecutive' could probably work.
I can't see any way of getting FET to work with that sort of constraint at all as it is.  Any ideas?

Another request that is being a bit tricky to put in is: 'An activity is not the last activity in a day'.  Currently I've put that activity with a specific teacher that isn't available late in the day.  This works OK, but is there a better way?  The fear is that if we provide an unsupervised activity late in the day then some students may just go home early.  Unfortunately not all years and days are the same length so the 'teacher not available' method is either ineffective or is too restrictive.

An observation:  FET is great with constraints that specify what must not occur, but is not so good with constraints that must occur.
For example: Religion is an activity that happens twice a week.  It can happen on any day and time, but one of those days must be Friday.
The only way I've been able to honour that request is by having two subjects for religion.  One is in a room that is only available on Friday and the other is available any day except Friday.  Again, is there a better way?

Thanks,
Oppylock
Title: Re: How to respect these constraints?
Post by: Liviu Lalescu on September 15, 2008, 07:52:24 AM
Quote

I've got a data file with a few hundred activities in it that is getting close ... but not perfect.

What I'm after is a balanced timetable and I can't find a constraint to give FET the right hint about what to do.  FET is very capable of making everything fit according to the constraints, but the timetables still aren't good ones, because it can't be taught the unwritten constraints ... yet.

In each year there are several similar subjects.  Science subjects like Chemistry, Physics and General Science for example.  I'm looking to provide a balanced day so that in any day there is not too much emphasis on a particular theme.

Each year group isn't split into any subgroups ... they all do the same subjects at the same time.
The science subjects are all taught by different teachers and in different rooms.

I was going to do this by giving the subjects an activity tag of science and then limiting the amount of science with a 'max hours daily for student set+activity tag' ... but that doesn't exist.  Is there any way with the current rules to create such a constraint?
Another option would be 'Min gaps between activity tag' to force something else in between the science activities.
Or even 'Two subjects/activity tags must not be consecutive' could probably work.
I can't see any way of getting FET to work with that sort of constraint at all as it is.  Any ideas?


Let us try to use some tricks:

Add a constraint min days between activities, for all activities of Chem, Phys and Gen. Sci. for a low level students set (just add each component activity - so if you have Phys(A1, A2) and Chem (A3, A4) - add A1, A2, A3 and A4). The min days should be 1, consecutive if same day of course false and weight from 10% to 95% (try with lower values firstly).

Also, you can add a constraint min gaps between activities, 1 gap, same activities as above.

Then, add these constraints for all students sets you need.

Quote

Another request that is being a bit tricky to put in is: 'An activity is not the last activity in a day'.  Currently I've put that activity with a specific teacher that isn't available late in the day.  This works OK, but is there a better way?  The fear is that if we provide an unsupervised activity late in the day then some students may just go home early.  Unfortunately not all years and days are the same length so the 'teacher not available' method is either ineffective or is too restrictive.


Maybe you could use constraints activity(ies) preferred starting times. It is better, you have more alternatives.

Yes, this is not a good solution, but to make exactly what you need seems too difficult.

Quote

An observation:  FET is great with constraints that specify what must not occur, but is not so good with constraints that must occur.
For example: Religion is an activity that happens twice a week.  It can happen on any day and time, but one of those days must be Friday.
The only way I've been able to honour that request is by having two subjects for religion.  One is in a room that is only available on Friday and the other is available any day except Friday.  Again, is there a better way?

Thanks,
Oppylock


This one is very simple. Either use constraint activity preferred starting times (or time slots) for the id of one component activity (if you have A1 and A2 of religion, add only for A1, Friday allowed). Or use constraint subactivities preferred starting times (or time slots), split=1 (or 2, but not both), subject = Religion, allowed Friday.
Title: Re: How to respect these constraints?
Post by: OppyLock on September 18, 2008, 04:05:33 AM
Quote
Quote
In each year there are several similar subjects.  Science subjects like Chemistry, Physics and General Science for example.  I'm looking to provide a balanced day so that in any day there is not too much emphasis on a particular theme.

Let us try to use some tricks:

Add a constraint min days between activities, for all activities of Chem, Phys and Gen. Sci. for a low level students set (just add each component activity - so if you have Phys(A1, A2) and Chem (A3, A4) - add A1, A2, A3 and A4). The min days should be 1, consecutive if same day of course false and weight from 10% to 95% (try with lower values firstly).

Also, you can add a constraint min gaps between activities, 1 gap, same activities as above.

Then, add these constraints for all students sets you need.

This is exactly what I need.  I'd never thuoght about using the min days between activities or min gaps between activities constraints with other than the same group of activities.  I learn something everytime I play with this program!

The other solutions will do whats required too.

Next problem ...

The timetable I'm creating is quite tight and it should be solvable.  FET fairly quickly solves subsets of the problem in about 15-20 minutes.  However when I give it the whole set to chew on it's a bit difficult to know whether it is actually solvable at all.  

With almost all the constraints in place in FET I let it do a run of 10 generations.  I limit these to 2 hours and it *might* solve 5-6 of them.  However I added some extra constraints 'min 2 gaps between activities' for a few bad cases that cropped up.  Now it won't solve any of 10 within 2 hours.

So ... how long is long enough to wait?
How can I tell if I've gone too far with constranits?
Does FET pop up an error once it's exausted all possibilities?
If FET can't detect an impossiblity, then how best to troubleshoot which constraint to change?  Unfortunately most of the ones I've put in are 'must' not 'want' constraints so somebody will not be happy.
When FET is successful it has often been sitting at ~210 of 280 activities placed for hours and then just jumps to the solution at the end.  Is this normal?
Admittedly all my constraints are at 100% as a perfect timetable would be perfect ;)  Is my best option to back off some constraints to 99% and live with the 1 or 2 bad schedulings?
Title: Re: How to respect these constraints?
Post by: Liviu Lalescu on September 18, 2008, 08:06:48 AM
Quote

Next problem ...

The timetable I'm creating is quite tight and it should be solvable.  FET fairly quickly solves subsets of the problem in about 15-20 minutes.  However when I give it the whole set to chew on it's a bit difficult to know whether it is actually solvable at all.  

With almost all the constraints in place in FET I let it do a run of 10 generations.  I limit these to 2 hours and it *might* solve 5-6 of them.  However I added some extra constraints 'min 2 gaps between activities' for a few bad cases that cropped up.  Now it won't solve any of 10 within 2 hours.

So ... how long is long enough to wait?
How can I tell if I've gone too far with constranits?
Does FET pop up an error once it's exausted all possibilities?
If FET can't detect an impossiblity, then how best to troubleshoot which constraint to change?  Unfortunately most of the ones I've put in are 'must' not 'want' constraints so somebody will not be happy.
When FET is successful it has often been sitting at ~210 of 280 activities placed for hours and then just jumps to the solution at the end.  Is this normal?
Admittedly all my constraints are at 100% as a perfect timetable would be perfect ;)  Is my best option to back off some constraints to 99% and live with the 1 or 2 bad schedulings?


I have a Hungarian user who told that he obtained a timetable in 7 hours. His data was very difficult and he had ~ 900 activities.

FET cannot tell you when he examined all possibilities.

Yes, it may happen that FET stays at 210 and then goes to finish at 280 activities in a moment. This is because that the last 70 activities might be very easy to schedule.

Please observe the patterns and try to see when a timetable is impossible. Probably if it goes to say 200 and then backtracks at 150 activities without reaching again 200 in 30 minutes, there might be a problem with activity 201 and its constraints. But this method is not sure.

It is a good idea to go with lower constraints and if you find a timetable, raise them progressively.