Help with break times

Started by infoo_, January 12, 2023, 08:22:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

infoo_

Hello

I am having problems creating a timetable.

Recently I realized some subjects are in between break times e.g. 2 hours of Math in 1A are divided in: 1 hour, break time, 1 hour.

So to avoid this, I have added extra periods named "Break 1", "Break 2", "Break 3" and "Break 4" (2 periods on Morning, 2 on Afternoon).

I have set the constraint "Break times" and selected this 4 rows and marked with X.

However, the generating process stopped at a specific number like 190/308 where 190 activities were placed correctly.

Then I realized in some courses it is mandatory to divide some subjects in between those 2 break times per day due the subject's distribution.

So I unmarked with X the rows that generated conflicts and the schedule is correctly generated. But now I have subjects that are teached in Break times.

I tried deactivating "Break times" constraint and using the constraint "A set student's not available times" and marked with X the 2 break time rows with 100% (because we do not want subjects to be in Break times), and same result as before (it stops at 190/308 activities).

So my question is: Is there a way to tell FET to generate as few divisions as possible by Break times instead of setting it to 100%? Something like 50% or 75%?

Thanks in advance!

P.S. I think a workaround would be to modify the split of the activities that have problems (for example, 4 hours of Math instead of 2-2 can be 1-1-2). But this can take a long time to modify. Is there any other alternative?

Liviu Lalescu

Hello,

I am not sure I understand your exact situation, I hope others can help also. Maybe you can attach your file.

Maybe you can use constraints subactivities preferred starting times, split index = 1 or 2 (not both).

infoo_

#2
Hello

Quote from: Liviu Lalescu on January 12, 2023, 09:01:21 PMI am not sure I understand your exact situation, I hope others can help also. Maybe you can attach your file.

I can write an example:

Suppose we have 7 hours per day + 2 break times, total: 9 rows per day. Suppose 1A has these subjects:

Subject A: 2 hours per week (duration: 2)
Subject B: 1 hours per week (duration: 1)
Subject C: 2 hours per week (duration: 2)
Subject D: 1 hour per week (duration: 1)
Subject E: 2 hours per week (duration: 2)
Subject F: 2 hours per week (duration: 2)
Subject G: 1 hour per week (duration: 1)   <-- Focus on this
Subject H: 2 hours per week (duration: 2)
Subject M: 1 hour per week (duration: 1)

and consider we have only 2 days Monday and Tuesday. We are using Break times constraint (100%).

A possible timetable could be:

Timetable A:

MonTue
1A    Subject A    Subject E
1ASubject ASubject E
1ABreak 1    XX
1ASubject BSubject F
1ASubject M---
1ABreak 2XX
1ASubject CSubject G
1ASubject CSubject H
1ASubject DSubject H

However, the "real" subjects are:

Subject A: 2 hours per week (duration: 2)
Subject B: 1 hours per week (duration: 1)
Subject C: 2 hours per week (duration: 2)
Subject D: 1 hour per week (duration: 1)
Subject E: 2 hours per week (duration: 2)
Subject F: 2 hours per week (duration: 2)
Subject G: 2 hours per week (duration: 2)
Subject H: 2 hours per week (duration: 2)
Subject M: 1 hour per week (duration: 1)

Now it is impossible to generate the Timetable B:

Timetable B:

MonTue
1A    Subject A    Subject E
1ASubject ASubject E
1ABreak 1    XX
1ASubject BSubject F
1ASubject MSubject G
1ABreak 2XX
1ASubject CSubject G
1ASubject CSubject H
1ASubject DSubject H

However, I want to produce Timetable B keeping the Break time constraint. I can use duration 1+1 but this is a tedious change for every activity.

Is it clear now or is a FET file still required?

infoo_

#3
Quote from: Liviu Lalescu on January 12, 2023, 09:01:21 PMMaybe you can use constraints subactivities preferred starting times, split index = 1 or 2 (not both).

But I don't want to tell FET what preferred starting period should be picked (also I will have a teacher not available time constraint soon), but FET should know where to put the activities.

I want to tell FET that, when needed (the less cases, better), some subjects can be splitted between Break times when duration > 1.

Is that possible?

Thanks!

Liviu Lalescu

Quote from: darkwindow on January 12, 2023, 09:45:03 PMI want to tell FET that, when needed (the less cases, better), some subjects can be splitted between Break times when duration > 1.

Is that possible?

Thanks!

I think the answer is no, but please allow me more time to think and answer.

infoo_

Hello

Quote from: Liviu Lalescu on January 12, 2023, 09:59:54 PMI think the answer is no, but please allow me more time to think and answer.

No problem. Have you seen the example I gave in the previous message? Perhaps it is useful to understand the situation.

Liviu Lalescu

I am sorry, but I am quite busy with a new feature and preparing for a new version; also, it is very late (00:03). I'll try to check and answer later.

If your file is not private, you can share it. It is always useful.

infoo_

#7
Hello

I am attaching the FET file. Changed the Teacher's name. Can you see it?

If you deactivate Break times constraint it works (moreover: If you keep Break times activated but just only removes the last row of X named "Recreo 14:10-16:30" it generates. It is an afternoon's subject duration issue). But I need to keep the break times with 4 rows activated and, if possible, don't want to change the activities duration.

Liviu Lalescu

#8
I downloaded the file, but unfortunately I cannot see it very soon, as I told you. I'll write a reply when possible.

infoo_

Quote from: Liviu Lalescu on January 12, 2023, 10:53:09 PMI downloaded the file, but unfortunately I cannot see it very soon, as I told you. I'll write a reply when possible.

Ok. Thank you!

Someone else can take a loop at the FET file, too. :)

Liviu Lalescu

I am thinking of this: get rid of breaks (constraint break and students set not available). Then add some constraints subactivities preferred starting times. You can force by this some subactivities to not start at a time such that they are split by a break. And/or you can use weights <100.0% for these constraints.

Otherwise, maybe you should better change the activities duration. Unfortunately, this will be a lot of manual work (modifying a bit the FET sources and writing a small piece of code to convert the activities is possible, but unfortunately I am very busy these days).

infoo_

Hello

Quote from: Liviu Lalescu on January 13, 2023, 09:46:44 AMI am thinking of this: get rid of breaks (constraint break and students set not available). Then add some constraints subactivities preferred starting times. You can force by this some subactivities to not start at a time such that they are split by a break. And/or you can use weights <100.0% for these constraints.

So you say I should mark X to not start in every hour before and after every break time? Something like this?:

You cannot view this attachment.

If this is the case, in the morning we have blocked the possibility to set activities in between those 2 break times. That is, there will be no activities from 3º hour to 4º hour (2 periods).

I misunderstood?

infoo_

#12
I thought this, maybe it can't work (don't want to change activities duration! :'( ):

We keep those 4 rows of break times. We create dummy activities, mark with X on each row, and we add the constraint "activities not overlapping" that takes one real subactivity (with duration > 1) and every dummy activity (5 selected activities in total each time, 1 real + 4 dummies). We replicate this for every single activity with duration > 1.

So these (sub)activities will never overlap, hence activities with duration > 1 will not be on break times.

Is that a good idea or did I lose my mind?

Liviu Lalescu

Quote from: darkwindow on January 13, 2023, 10:37:53 AMSo you say I should mark X to not start in every hour before and after every break time?

Yes, and add this only for one split index of an activity split into 2. See constraint subactivities preferred starting times. And maybe add with weight <100.0%.

Liviu Lalescu

Quote from: darkwindow on January 13, 2023, 10:47:39 AMI thought this, maybe it can't work (don't want to change activities duration! :'( ):

We keep those 4 rows of break times. We create dummy activities, mark with X on each row, and we add the constraint "activities not overlapping" that takes one real subactivity (with duration > 1) and every dummy activity (5 selected activities in total each time, 1 real + 4 dummies). We replicate this for every single activity with duration > 1.

So these (sub)activities will never overlap, hence activities with duration > 1 will not be on break times.

Is that a good idea or did I lose my mind?

I am not sure I understand. But why complicate things so much?