Main Menu

Minimum hours error

Started by maxi_mus, April 24, 2024, 06:26:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maxi_mus

Cannot optimize, because you have constraint teacher min hours per morning for teacher XX but not also min hours daily for him. Please add a constraint teacher(s) min hours daily affecting this teacher

I don't understand the problem here. The problem persists, even if I add a constraint 'minimum hours per real day'.

If I add a constraint 'minimum hours per day', then this obviously also forces FET to make a minimum number of hours for each afternoon. I don't want this, this is the exact reason why I chose the 'minimum hours per morning' in the first place.

Surely this must be a bug?

Liviu Lalescu

This was easier for me, to implement min hours per morning/afternoon only if also there is present min hours daily (min hours daily, but not per real day).

Note that min hours daily allows empty days. So if you can have 0 or 2 or more hours per afternoon, you can add without worrying min hours daily 2 with allow empty days.

If you can allow 1 hour daily on an afternoon, there is no other possibility than a customization.

In Morocco and Algeria (the initial purpose of Mornings-Afternoons mode) they cannot allow 1 hour daily on a morning/afternoon.

maxi_mus

Then I don't understand the point of having min. hours mornings or afternoons in the first place. Because these numbers can never be lower than minimum hours daily.

Liviu Lalescu

I think it has a point, because you need to add 2 min hours daily and can add 3 min hours per morning or per afternoon. So the teacher can have minimum 2 hours in the morning (or 0) and minimum 3 hours (or 0) in the afternoon.

For the Mornings-Afternoons mode nobody until now complained about this potential problem. In the targeted institutions there are minimum 2 hours per day (half-day), and there might be needed minimum 3 or 4 hours per morning or per afternoon (only one of these two).

maxi_mus

Yes, I understand this use case. This is when the minimum per morning or afternoon is larger than the minimum per half day.

But say I want to allow teachers to have a minimum of 1 lesson per half day, but if they work in the morning, it should be two at least. So the following is possible:
M A
0 0
2 0
2 1
2 2
etc.

This is not possible with this restriction. Why do you need this restriction, what harm would it do to remove it?

Liviu Lalescu

Hmm... bad ('2 1' is denied).

If I had now my knowledge, I would have done it properly. Now it would be difficult and unsafe for the old existing files.

I firstly implemented min hours daily. Then, some user requested min hours per morning, which should be more than per day. I implemented it based on min hours daily, with a bit of coding hack. Then, some user requested min hours per afternoon, and I again made a sort of a hack.

The reason to keep this restriction has something to do with the interactions between the constraints. The algorithm is more efficient if you consider this. So I based the code on this restriction.

The best solution would maybe be to allow min hours daily 1 even with allow empty days in the Mornings-Afternoons mode. It might not be difficult to change this code, but as always I am very afraid to change this critical code for the FET official version. I will think about this in the next interval.

maxi_mus