Is it possible to move free hours to the end of the schedule?

Started by infoo_, January 11, 2023, 01:13:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

infoo_

Hello

So I am working on the schedule and I need a restriction: If there's a free hour, FET must put it at the end of the schedule* and not allow there to be a free hour first and then a class hour, but it is mandatory to have a max of 2 free hours per day. Some examples are given below (Note: "----" denotes "free hour"):

BAD #1:
           
Monday    Tuesday
1º (Start of Morning)Subject ASubject C
----Subject C
----Subject B
Subject DSubject B
Subject DSubject E
Subject FSubject E
Subject F----
8º (End of Morning)Subject G----
9º (Start of Afternoon)Subject JSubject R
10ºSubject JSubject K
11ºSubject ASubject K
12ºSubject BSubject L
13ºSubject BSubject H
14ºSubject ESubject U
15ºSubject ESubject U
16º (End of Afternoon)    ----Subject U

Explanation: There are free hours that are not at the end (on 2º and 3º).

BAD #2:

Monday    Tuesday
1º (Start of Morning)Subject ASubject C
Subject ASubject C
Subject LSubject B
Subject DSubject B
Subject DSubject E
Subject FSubject E
Subject FSubject A
8º (End of Morning)Subject GSubject A
9º (Start of Afternoon)Subject JSubject R
10ºSubject JSubject K
11ºSubject ASubject K
12ºSubject BSubject L
13ºSubject BSubject H
14ºSubject E----
15ºSubject E----
16º (End of Afternoon)    Subject C----

Explanation: Although the free hours are at the end, max = 3 where it must be max = 2 per day.

BAD #3:

Monday     Tuesday
1º (Start of Morning)Subject ASubject C
Subject ASubject C
Subject LSubject B
Subject DSubject B
Subject DSubject E
Subject FSubject E
Subject FSubject A
8º (End of Morning)Subject BSubject A
9º (Start of Afternoon)Subject JSubject R
10ºSubject JSubject K
11ºSubject ASubject K
12ºSubject BSubject L
13ºSubject BSubject H
14ºSubject ESubject H
15º--------
16º (End of Afternoon)    Subject F----

Explanation: Although all the free hours are in the last 2 hours (in this example of Afternoon), there is a free hour and then a class; it must be class then free hour. So FET should fix Monday by moving the 15º free hour to be 16º free hour.

GOOD:

Monday    Tuesday
1º (Start of Morning)Subject ASubject C
Subject ASubject C
Subject LSubject B
Subject DSubject B
Subject DSubject E
Subject FSubject E
Subject F----
8º (End of Morning)--------
9º (Start of Afternoon)Subject JSubject R
10ºSubject JSubject K
11ºSubject ASubject K
12ºSubject BSubject L
13ºSubject BSubject H
14ºSubject ESubject H
15º----Subject F
16º (End of Afternoon)    ----Subject E

* As stated here: https://lalescu.ro/liviu/fet/forum/index.php?topic=5452.0, I have set the periods to be from 1 to 8 (Morning) and 9 to 16 (Afternoon). In total, 16 consecutive periods from Mon to Fri. These restriction must act separately i.e. free hours must move to 7º and 8º (last 2 hours of Morning) and move to 15º and 16º (last 2 hours of Afternoon).

Is there a constraint that satisfies all the given examples? What would you recommend?

Thanks in advance

Liviu Lalescu

I think you need the Mornings-Afternoons mode, because you allow gaps between mornings and afternoons.

I think students max gaps per week = 0, students begin early max beginnings at second hour = 0, students min hours daily = 5.

This will allow 2 gaps at the end of the morning and 2 gaps at the end of the afternoon. If you only allow only 2 gaps in total for each day, I think you could add dummy activities allowed to be placed only at these last hours (not sure if it will work). Let me know if this is the case and we'll discuss more - but I hope you allow 2 gaps morning and 2 gaps afternoon - so no big problem.

infoo_

Hello

Quote from: Liviu Lalescu on January 11, 2023, 09:15:30 AMI think students max gaps per week = 0, students begin early max beginnings at second hour = 0, students min hours daily = 5.

I have created this constraints (I guess for all students, right?) and it seems OK. If I have problems after I add teacher's not available times (which I hope to do soon), I can rollback to an earlier version (without those constraints) since I am saving each change on a new FET file.

Why students min hours daily = 5 instead of 6? 8 (hours per turn) - 2 (max free hours per day) = 6, why 5? However with 6 I think it is working.

Thanks!

Liviu Lalescu