Forcing simultaneous subactivities

Started by jcb, May 25, 2022, 10:41:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jcb

Hi everyone

I've spent quite a bit of time trying to solve this problem, but so far haven't found a good solution.

My problem: I have two activities each made up of 6 subactivities (I'll call them A1 to A6 and B1 to B6). The school requires that some of the sub-activities occur simultaneous. i.e. A1+B1 must occur at the same time, as must A2+B2. Any remaining subactivities should not occur at the same time, but other constraints will prevent this from happening anyway.

I need a constraint that forces subactivities to be scheduled at the same time, or something that achieves the same result. I know that there is the 'A set of subactivities has a set of preferred starting times', but this requires me to choose the starting time myself. There are so many overlapping activities that I would then need to do the whole timetable by hand, which I'd obviously like to avoid.

I achieved a partial solution where I made each subactivity its own activity with only one lesson (so, for example, I created activities A1, A2, ... A6, all with duration 1). I constrained them using teachers to avoid these activities all occurring on the same day (I attached dummy teachers to these activities, and set their max teaching hours to 1). This worked, and I achieved 'valid' basic timetables, but unfortunately I can't spread the activities evenly over the week. I could generate multiple timetables, and then select the best looking one, but that could take a long time.

Do you have any suggestions on how to solve this issue, or at least improve my work-around?

Liviu Lalescu

Hello,

I think the solution to your problem is very simple and I don't know why you did not find it. Just add two constraints activities same starting time, one is (A1, B1) and the other one is (A2, B2). This is the simplest and most efficient. Just don't select "Add multiple constraints" in that dialog.

If you want to complicate things and slow a bit the generation, you could use a constraint activities occupy max time slots from selection. A1..A6+B1..B6 (12 (sub)activities), selected slots = all slots of the week, max occupied = 10. This solution is instructive in its own way.

jcb

Hi Liviu

Thanks so much for the fast response. Your solution obviously works, and my apologies for wasting your time with such a silly question -- I really should have picked up that that particular constraint worked that way!

Enjoy your day!

Liviu Lalescu

Hello, jcb,

Absolutely no problem!  :)

Thank you!