Minimum hours after lunch break

Started by david.almeida, August 23, 2019, 11:35:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

david.almeida

Hi

Thanks for this wonderful piece of software.

My school have 8 time slots in each day.
The students (and teachers) have lunch break at 4th or 5th slot. Because we don't want that all students go lunch at same time, we have these 2 slots. I create an activity "lunch" without teacher for each class and another activity "lunch" without class for each teacher.
And these almost work for me.

What does not work for me is that I want the lunch activity (for students) could not have "ONE" activity after.
Meaning:
Or the lunch activity is the LAST activity of the day (all students start the day on first slot)
Or they have TWO or MORE activities after lunch.

We don't want that students have to lunch on school to have just one slot.


I already saw the "Moroccan" example dividing the day on 2 parts. But they have lunch all together at same time and we have "half" of the school lunch at 4th slot and the other half on 5th slot. So, I can't divide the day like on that example.

Is it possible to constraint an acitvity so it does not have "(just) ONE" activity after it?

Thanks

Liviu Lalescu

#1
Hello,

Thank you for the appreciation!

1) It is possible to do a custom version just for you. If I don't insist on making it perfect (taking care of many other constraints, for perfect speed, which is not critical), it might not be that difficult.

2) I am not sure - if you know exactly the students who have break at 4th hour and those who have break at 5th hour, you could use constraint students set not available.

3) I am not sure if you can use FET Algeria (not Morocco, since Morocco has another constraint on teachers - they only work on morning xor afternoon - exclusive or, with written exceptions), but it might be possible. The problem is your students early constraint. Otherwise you could consider break 4th morning or 1st afternoon (like in normal timetabling).

4) Could you send us or me your file? I'll keep it private if necessary. This is important to make myself an overall idea.

david.almeida

Hi Liviu

Thanks for the help.

The file that I am attaching is just a test timetable.
I returned from vacations earlier than my colleagues and my director. So, as I am on timetables commission, I already am preparing this job.
But I still have not all the data for all timetables.
The name of teachers is almost complete. The classes numbers are complete (we have sub classes on almost classes).
But who is the teacher on each activity on each class, I still don't know.

So this is just a test and incomplete timetable.

There are just 2 classes (529 from 528/529 and 35156 from 35156/35157) with enough sample activities, but you can see my problem.

Both 529 and 35156 have the constraint to start all days on first slot.
Both 529 and 35156 have the constraint to have activity "Almoço" (Lunch) at 4th or 5th slot on each day.
Both 529 and 35156 have the constraint to don't have gaps.

35156 have a nice time table.

  • On monday have all slots occupied
    On tuesday have lunch at 5th slot and have 2 more slots after lunch.
    On wednesday and thursday don't have activities after lunch.
    On friday have lunch at 4th slot and have 2 more slots after lunch.

529 is almost ok except tuesday. On these day, they have just on slot occupied after lunch. This activity should have be placed on wednesday at 8th slot or on friday at 7th slot, so one of these day have 3 slots after lunch and tuesday doesn't have JUST one slot after lunch.


Thanks

Liviu Lalescu

OK, I can try a customization, if you want. I can hard-code the constraint that after "Almoço" there must be 0 or >=2 hours of activities. Let me know if you are interested.

david.almeida

Yes, if you could I'm interest on that constraint.

Thanks  :D

Liviu Lalescu

#5
Can I assume that in the final file all the students have begin early max 0 beginnings at second hour and max gaps per week = 0 and each day occupied at least up to the lunch?

david.almeida

Yes

I only put on that classes because the others don't have enough activities yet.

Aisse

Hi friend ..

Try this solution
Put a Tag for Lunch
Put a Tag  for all other activities
put the constraint  "min gaps  between an ordered pair of activity tags for all students "
Select the two tags
put 1 slot ..


I'm not sure if  it puts gaps or hours if it puts hours that will solve the problem..

لكل شيءٍ إذا ما تم نقصانُ  *** فلا يُغرُّ بطيب العيش إنسانُ
هي الأيامُ كما شاهدتها دُولٌ *** مَن سَرَّهُ زَمنٌ ساءَتهُ أزمانُ
وهذه الدار لا تُبقي على أحد *** ولا يدوم على حالٍ لها شان

david.almeida

Hi friend

I think that it will not work

I have no way to know the activities after lunch and the order of each one, so if I put the same tag for all activities (except lunch), that constraint would be good because it will put one activity 1 slot after lunch, but will not put one activity just after.
After lunch, I have to have a minimum of 2 activities (with no gaps with lunch) or no activities at all.

But thanks for your idea  :)

Aisse

You're not obliged to know the activities after lunch and the order of each one..


that (simple and powerful) constraint does the following:

If lunch is  the last activity  constraint not do anything..

If there is an activity  after lunch constraint forced it to become two ..

but Unfortunately .. Add an empty hour -I was not sure .. but now I'm-

then you need this constraint :
"min activity between an ordered pair of activity tags for all students "

-- but not exist --   8)



لكل شيءٍ إذا ما تم نقصانُ  *** فلا يُغرُّ بطيب العيش إنسانُ
هي الأيامُ كما شاهدتها دُولٌ *** مَن سَرَّهُ زَمنٌ ساءَتهُ أزمانُ
وهذه الدار لا تُبقي على أحد *** ولا يدوم على حالٍ لها شان

Liviu Lalescu

#10
I made it, please get it from https://lalescu.ro/liviu/fet/download/custom/david-almeida/

Please let me know.

Note that if a students set has no early=0 and max gaps=0, it will not be constrained to have 0 or >=2 activities after "Almoço"

I advise you to be careful with this new version I made. Before you generate, make a backup of your file, so it will not crash (at least after you verified practically my code for a while).

Liviu Lalescu

Quote from: Aisse on August 23, 2019, 05:41:17 PM
You're not obliged to know the activities after lunch and the order of each one..


that (simple and powerful) constraint does the following:

If lunch is  the last activity  constraint not do anything..

If there is an activity  after lunch constraint forced it to become two ..

but Unfortunately .. Add an empty hour -I was not sure .. but now I'm-

then you need this constraint :
"min activity between an ordered pair of activity tags for all students "

-- but not exist --   8)

Mr. Aisse, I understand what you want. Add activity tag "Almoço" to the Lunch activities, and activity tag "Any other" to the other activities, and min 1 gaps between ordered pair of "Almoço" to "Any other". It will add an hour, not a gap, because students max gaps per week = 0. But that activity between cannot be added, because it will have "Any other" tag and not min 1 gap to "Almoço".

I think it will not work, Mr. Aisse.

david.almeida

Quote from: Liviu Lalescu on August 23, 2019, 05:41:56 PM
I made it, please get it from https://lalescu.ro/liviu/fet/download/custom/david-almeida/

Please let me know.

Note that if a students set has no early=0 and max gaps=0, it will not be constrained to have 0 or >=2 activities after "Almoço"

I advise you to be careful with this new version I made. Before you generate, make a backup of your file, so it will not crash (at least after you verified practically my code for a while).

Hi Liviu

I just arrived home and tried on my laptop.... I don't have all the data, but with the sample data that I have, I tried and it works.... ;) :D :D :D

Brilliant  ;D

Many, many thanks

Monday, when the director return from his vacations with the real data for next school year I will try and give feedback.... but it seems that will work

Again, many thanks

Cheers

Liviu Lalescu

I am glad it works!  :)   You are welcome!

Aisse

لكل شيءٍ إذا ما تم نقصانُ  *** فلا يُغرُّ بطيب العيش إنسانُ
هي الأيامُ كما شاهدتها دُولٌ *** مَن سَرَّهُ زَمنٌ ساءَتهُ أزمانُ
وهذه الدار لا تُبقي على أحد *** ولا يدوم على حالٍ لها شان