max hours daily for an activity

Started by Nikos Koutsoukos, September 19, 2009, 09:14:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nikos Koutsoukos

I think I need a constrain "max hours daily for an activity" or "max hours daily for an activity tag for a student set"
I have a teacher that has 4 diferent activties for the same student group

Activity-1 is 3 seperate hours in a week
Activity-2 is 3 seperate hours in a week
Activity-3 is 2 seperate hours in a week
Activity-4 is 2 seperate hours in a week
Total 10 hours in a week
I do not want this student group  to have more than 3 of these activities in the same day

What I do now is:
1) To set constrain "min n days between a set of activities" for the 3 hours of Activity-1
2) To set constrain "min n days between a set of activities" for the 3 hours of Activity-2
3) To set constrain "min n days between a set of activities" for the 2 hours of Activity-3
4) To set constrain "min n days between a set of activities" for the 2 hours of Activity-4

And finaly because I do not want all 4 activities in the same day I must:
5) To set constrain "min n days between a set of activities" for the 4 hours of Activity-3 and Activity-4

These are to many constrains more than I realy need because Activity-3 and Activity-4 Is Ok to be in the same day if they are alone or with one of Activity-1 or Activity-2 and now with the constrain I set they can not be.

It would be easer for the teacher and for the FET if I could set just one activity lets say
Activity-1234 with 10 hours in a week and with no constrain "min n days between a set of activities"
I need only to have a constrain "max hours daily for an activity"
so I can set: max hours daily for activity-1234 = 3
In this way have 2 big advantages
1) I put only one constrain and it is easier for FET
2) I let the teacher to organize his 10 hours and to deside what activity he will do at every hour. And this is better for the teacher.

I could do it also if I had a constrain "max hours daily for an activity tag for a student set" and set all 4 activities (with no "min n days between a set of activities" constrain) to have the same activity tag and then set:
max hours daily for this activity tag and this student set = 3
I think this solution (with activities tags) is better.

Thank you
Nikos Koutsoukos

Liviu Lalescu

#1
OK, this constraint was suggested by more users (like in http://lalescu.ro/liviu/fet/forum/index.php?topic=603.msg3627#msg3627 and I remember also in other places). I'll think about it. It seems difficult. But maybe it will be possible.

So, constraints: students (set) activity tag max hours daily and teacher(s) activity tag max hours daily?

Liviu Lalescu

I am trying to implement this constraint right now. Please prepare for me some test data (your file, which if needed I'll keep private). Tell me the constraints which I need to add (teacher(s) or students (set) activity tag max hours daily).

Chafik Graiguer

Thanks Liviu
I will prepare my file for you

Liviu Lalescu

It is done, please see global announcement for location of file (the usual http://lalescu.ro/liviu/fet/download/test/).

Nikos, please test and also send me some test files, so I can verify myself.

silvia

I have a question about this constraint. Would it be useful to tell FET:
don't allow more than 2 identical activities for the same group in a few specific hours.
for example: no more than 2 hours a week of the same subject/tag between 5th and 7th hour.

is this possible? if so, what would be the correct syntax?

Liviu Lalescu

#6
QuoteI have a question about this constraint. Would it be useful to tell FET:
don't allow more than 2 identical activities for the same group in a few specific hours.
for example: no more than 2 hours a week of the same subject/tag between 5th and 7th hour.

is this possible? if so, what would be the correct syntax?

Edited to add: I edited to remove my answer, which was wrong probably.

Volker Dirr

Quote
don't allow more than 2 identical activities for the same group in a few specific hours.
for example: no more than 2 hours a week of the same subject/tag between 5th and 7th hour.

Yes, you can do something like that with:
time constraint -> activities -> a set of subactivities has a set of preffer (starting) times

Liviu Lalescu

Quote
Quote
don't allow more than 2 identical activities for the same group in a few specific hours.
for example: no more than 2 hours a week of the same subject/tag between 5th and 7th hour.

Yes, you can do something like that with:
time constraint -> activities -> a set of subactivities has a set of preffer (starting) times

I am sorry, yes, Volker is right, there is this simple solution. Suppose your activity is split into 4 per week. Then add constraint subactivities preferred time slots, for split index 3, then 4, not allowed in 5-7 hours. Then, only components 1 and 2 may be in these slots.

If you have activities split into 2, 3, 4 or 5 components, you need to add 3 constraints, for components 3, 4 and 5.

Nice one, Volker!

silvia

thnaks Volkerr and Liviu.
ok, let's see if I understand. For Students1 Teacher1 English 3 hours a week min 1 day between activities I have to add these constraints:

subactivity_english1 preferred times: all hours except 5,6 and 7

therefore, the other two subactivities can be placed there, but not 3 of them.

did I get it right?

Volker Dirr

yes.

maybe also read the first example (yellow) here:
http://www.timetabling.de/manual/FET-manual.en.html#id_26

it start with "The main subjects...".

silvia


Liviu Lalescu

Quotethnaks Volkerr and Liviu.
ok, let's see if I understand. For Students1 Teacher1 English 3 hours a week min 1 day between activities I have to add these constraints:

subactivity_english1 preferred times: all hours except 5,6 and 7

therefore, the other two subactivities can be placed there, but not 3 of them.

did I get it right?

I usually recommend to constrain the last activities, and leave the first 2 unconstrained. This is because if you have activities split into different number of components, you can use the same constraints. For instance, if you have A1(1,1,1) and A2(1,1,1,1), same subject, you can add 2 constraints for components 3 and 4.

Nikos Koutsoukos

#13
I changed my fet file and I add the "max hours daily for an activity tag with a student set". I tested. It is ok. I thought it would be faster because it has less constrains but it is not. The old file took 15-20 minutes the new took 24 minutes. I guess if a problem is difficult the solution is also difficult. I send you both files. (If you remove the max gap per week and per day constrains it is solved in less than a minute)
I send you both files. They solve the same problem (417 activities)


Sorry for the slow response time
I had a lot of work this week

Thank you
Nikos

Liviu Lalescu

#14
Thanks for the file. Is it public? May I make it an official sample? No copyright/privacy problems?

Please read http://lalescu.ro/liviu/fet/forum/index.php?topic=106.msg466#msg466 and tell me what you think.