Allow a lunchbreak in any 2 periods

Started by sasbland, August 27, 2021, 11:12:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sasbland

Hi,

It turns out we can't fix a lunch break so now our periods are

P1 8:30 – 9:30
P2 9:45 – 10:45
P3 11:00 – 12:00
P4 12:15 – 13:15
P5 13:30 – 14:30
P6 14:45 – 15:45
P7 16:00 -17:00
P8 17:15 – 18:15

and lunch break can be one out of p4 or p5 and it doesn't have to be the same everyday.

Question 1: How do I set this one up?

I'm thinking of creating activity called lunch, 5 sessions with min 1 day at 100% weight, then choose preferred time slots for those 2 periods. Is this the right approach? Do I have create this activity for each subgroup? What about the teacher? How do I ensure they also have a lunch break?

Question 2: I would like a teacher who starts early to finish their day early, say p1-p6. And teachers who needs to do p8 starts at p2 for example. Again it can be any days. How do I do this one?

Many thanks.

Liviu Lalescu

Hello,

Question 1: This could be implemented very easily in the code, but as a hack. Many other users asked this, but unfortunately it cannot be implemented perfectly, as the (majority of) other constraints. The reason is counting the gaps, and it cannot be treated reasonable, universally. So:

a) You could use a customization (I did something similar here: https://lalescu.ro/liviu/fet/download/custom/poetasandaluces/, but for p3 and p4);

b) Your approach: yes, add such activities for each subgroup and each teacher;

c) Use the constraint activities occupy max time slots from selection: add n_subgroups x n_days_per_week such constraints, all the activities of that subgroup, select the two slots p4 and p5, max occupied = 1. The same for the teachers.

Question 2: You could use teachers max span per day. But p1-p7 and p2-p8 (max 7) or p1-p6 and p3-p8 (max 6). Otherwise (p1-p6 and p2-p8) you might need a customization.

sasbland

Thanks very much. What is the difference between activity preferred time slots and activity occupied max time slots?

sasbland

I also have another question.

According to the 8 periods above, how can I set that each group of student only starts in p1 one day a week or 2 days a week? Or similarly, they only have p8 one day a week? I want to avoid students starting early or finishing late on too many days. And similarly for a teacher. Thanks.

Liviu Lalescu

Quote from: sasbland on August 28, 2021, 12:19:32 AM
Thanks very much. What is the difference between activity preferred time slots and activity occupied max time slots?

Preferred time slots: A set of/an activity can only be in these slots.

Occupy max: Please read the Help there.

Quote from: sasbland on August 28, 2021, 01:15:34 AM
I also have another question.

According to the 8 periods above, how can I set that each group of student only starts in p1 one day a week or 2 days a week? Or similarly, they only have p8 one day a week? I want to avoid students starting early or finishing late on too many days. And similarly for a teacher. Thanks.

Teachers/students interval max days per week.

sasbland


sasbland

I have come across a new problem.  Now that I add activity lunch, I will need some lessons (either 2 hr or 3 hr lessons)  to be able to split over lunch break, to give more flexibility. Otherwise the timetable is impossible. Is there a way I can do that? Thanks.

Liviu Lalescu

#7
Maybe by luck the timetable is not impossible?

There is no way to allow an activity with duration 2 or 3 split over a break. The activity is indivisible.

There is the constraint two (three) activities grouped, which allows two (three) activities to be grouped splitting over a break. But you have no usual break (constraint break).

I can think only that you could use a customization (I apologize for the frequent customization proposals, but some features cannot be universal).

sasbland

Unfortunately our main constraint is that we don't have enough rooms. So we need the ​timetable to spread out as much as we can even though there is no clash in lessons or teachers.

Where do I start with customisation? Will it work for any 'new' file or only this time?

Many thanks.

sasbland

#9
Sorry but I have another question. We have a support class for some students only. Is it possible to set this to be either at the beginning or the end of the day, so students who don't need the support do not have a gap during the day.

In my original timetable (p1-p6) I used preferred time slots and picked p1,p2,p5,p6. Students who don't take support class will just come in late or go home early.

In this timetable, although I have 8 periods, it's very likely that students' day will only occupy 6 periods (either p1-p7 or p2-p8). So I can't do preferred time slots anymore as I don't know when they will start and end.  I can see the constraint activity ends student's day but not start the day.

Many thanks.

Liviu Lalescu

Quote from: sasbland on August 29, 2021, 10:12:22 PM
Unfortunately our main constraint is that we don't have enough rooms. So we need the ​timetable to spread out as much as we can even though there is no clash in lessons or teachers.

Where do I start with customisation? Will it work for any 'new' file or only this time?

Many thanks.

You could use constraints for preferred rooms and see if the timetable is still possible.

I was thinking of a customization of the constraint two activities grouped, which means a custom version of the code of FET-6.1.5 (currently). This will be possible to be ported on future versions of FET.

Liviu Lalescu

#11
Quote from: sasbland on August 29, 2021, 11:12:59 PM
Sorry but I have another question. We have a support class for some students only. Is it possible to set this to be either at the beginning or the end of the day, so students who don't need the support do not have a gap during the day.

In my original timetable (p1-p6) I used preferred time slots and picked p1,p2,p5,p6. Students who don't take support class will just come in late or go home early.

In this timetable, although I have 8 periods, it's very likely that students' day will only occupy 6 periods (either p1-p7 or p2-p8). So I can't do preferred time slots anymore as I don't know when they will start and end.  I can see the constraint activity ends student's day but not start the day.

Many thanks.

It is impossible to add a perfect constraint activities begin or end students day. It might be possible as a (difficult) customization as a hack, but it is ugly.

The easy and good way is to use the students' divisions. Say if Support is optional, you can divide the year by one category which is: Support: HAVE_SUPPORT and DON_T_HAVE_SUPPORT, along with the other possible categories. This way, if you add max 0 gaps to all students, this will include the option of 0 gaps for those who don't have Support. Let me know if you need more help or a small example file. There is some help in the FAQ for this one (and old entry, now it is easier to divide by categories), see:

---
Q: More information about students' structure

A: The students' structure is very flexible and permits any institution structure.
...
---

Liviu Lalescu

Quote from: sasbland on August 29, 2021, 11:12:59 PM
Sorry but I have another question. We have a support class for some students only. Is it possible to set this to be either at the beginning or the end of the day, so students who don't need the support do not have a gap during the day.

In my original timetable (p1-p6) I used preferred time slots and picked p1,p2,p5,p6. Students who don't take support class will just come in late or go home early.

In this timetable, although I have 8 periods, it's very likely that students' day will only occupy 6 periods (either p1-p7 or p2-p8). So I can't do preferred time slots anymore as I don't know when they will start and end.  I can see the constraint activity ends student's day but not start the day.

Many thanks.

I attach a small example file for dealing with optional subjects which need to begin or end the day.

sasbland

Thanks so much. I'll look into splitting students again.


I was thinking of a customization of the constraint two activities grouped, which means a custom version of the code of FET-6.1.5 (currently). This will be possible to be ported on future versions of FET.

I'm very interested in this if it's not too much of a trouble for you. We definitely lack rooms and that's the main reason we stretch the day from 6 periods to 8.

Many thanks.

Liviu Lalescu

Quote from: sasbland on August 30, 2021, 06:31:02 PM
I'm very interested in this if it's not too much of a trouble for you. We definitely lack rooms and that's the main reason we stretch the day from 6 periods to 8.

OK. We can try. I am thinking of modifying only the core part of the constraint two activities grouped, so that if the activities are interrupted by p3 or p4, it is allowed.

Let me know.