fet può scegliere l'insegnante di alternativa alla religione?

Started by Matteo, September 06, 2022, 10:57:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matteo

Buongiorno a tutti.

Sto aiutando ad usare fet per generare l'orario di una scuola media e vorrei sapere se è possibile fare il modo che fet assegni un insegnante di alternativa alla religione ad ogni classe, scegliendolo da un insieme di docenti.
Più in generale, consideriamo una una materia S, che viene impartita da due docenti T1 e T2 a due sottogruppi della stessa classe.
Se fisso a priori i nomi dei docenti T1 e T2, basta inserire l'attività Classe-S-(T1&T2) con due docenti in compresenza.
Tuttavia nel caso dell'insegnamento di religione alle medie T1 è noto, mentre T2 spesso può essere liberamente scelto in un insieme di insegnanti. Se fet potesse fare autonomamente questa scelta, potrebbe esserci più spazio per l'ottimizzazione (a prezzo di un aumento del tempo di calcolo?). Qualcuno ha già provato? Non riesco a trovare una combinazione di attività/stanze(virtuali?)/vincoli che possa realizzare questo. Ovviamente dobbiamo anche tenere conto che ciascun docente avrà un numero di ore di alternativa fissato.

Matteo

-- english version --

Let's consider a subject S, which is taught (at the same day+time) by 2 teachers T1 and T2 to two subgroups of the same class. (The application I have in mind is for students that opt out from "religion" in Italian secondary school and that must be looked after by another teacher; it could also apply to a subject that uses a lab that needs a technician chosen among a set, etc)

If T1 and T2 are chosen a-priori, then one just inserts an activity with 2 teachers.

Now suppose that T1 is given (it must be the "religion" teacher in my example), but that T2 can be freely chosen among a set of teachers. If fet could do this for me, maybe there would be more room for optimization of the timetable. Do you see any combination of activities/rooms/constraints that could implement this? Of course there would be a set of teachers that can acts be assigned the role of T2 and each of them should be given such a role for a predetermined number of hours (e.g. "teacher A" can be T2 for 2 classes, "teacher B" for 1 class, etc)

Liviu Lalescu

Buongiorno,

English:

Maybe there is a solution, which we might investigate: add two "dummy" activities for Teacher A without students, add one activity for Teacher B without students, then add some special constraints: min/max simultaneous activities from a set in selected time slots. Add in this constraint all the "real" activities with the teacher, add all the "dummy" activities, select all the time slots of the week, min (allow empty slots) and max = 2.

I might know better if you showed me your file (here or by email if it is private) and give me the details.

Please let me know.

Matteo

Hi Liviu,
  thanks for looking into this so quickly!

  In fact your approach goes along the lines of what I was trying to do (except that I had tried to use virtual rooms as well, got finally confused and ended up with impossible constraints).

I have created now a MWE, which I attach: it has just
* 3 classes, each split into rel/alt subgroups
* 4 teachers
* activities:
      A,B,C -> 7h italian;
      D -> 3h religion, one per class;
      A -> 1h alternative with no students
      C -> 2h alternative (1+1) with no students
* as you suggested, 3 constraints MinConcurrent=2 among groups composed by the 3 religion activities + 1 one of the "alternative", allowing free slots

However, generating a timetable gives me for example that class 1A has religion with teacher D on Tue13, but neither teacher A nor C has an hour of alternative at that time. It looks as if the time constraints is not working as I expect from its description.

I attach both the input file You cannot view this attachment. and one generated timetable You cannot view this attachment.
 
On a side note, as I said at the beginning, I had tried to use virtual rooms for teachers A and C, activities with no teachers for each class (space constrained to a set of virtual rooms); I suspected that the MinConcurrect constraint was giving funny results, but I couldn't isolate it among all the mess; your approach is way simpler.
 
Matteo

Liviu Lalescu

Hello, Matteo,

You are welcome!  :)

I attach the correct way I was thinking of. The constraints of type min/max simultaneous need the slots specified with X (red). Also, I think you need to condense them all into a single constraint (actually a pair of constraints). Also, adding also max constraint will speed things up, maybe, I think.

I attach your example corrected by me, please let me know.

Matteo

It works like a charm!
Thankyou!
Out of curiosity, can you explain why using 3 constraints (each including all 3 REL activities and one of the "alt" hours) does not work? (Generation halts while placing the REL activities)

Matteo

Liviu Lalescu

You're welcome!

Because it would mean a slot has alt and REL and another slot has two REL's, which have the same teacher.