How to add Constraint "Students set has max Subject per day"

Started by thanhnambkhn, December 01, 2016, 02:19:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thanhnambkhn

Hi Liviu,

How to add Constraint "Students set has max Subject per day".
I think this constraint equivalent to Constraint: "Students set has max Activities per day".

If currently Fet could not solve this Constraint, should you tell me how to custimize? Thank you so much.

Liviu Lalescu

I think you can use constraint students (set) activity tag max hours daily, by adding an activity tag to these activities. To add a constraint is not easy at all, but I can give you a bit of advice.

Volker Dirr

i think in many cases this is unneeded, since activities with the same subject are normaly added as ONE splitted activity. So they get the min day constraint. Now you have got the "consecutive" bool and also the weight int to care (indirectly) about the max subject per day of an student.

thanhnambkhn

@Liviu: I can not use activity 's tags, because I have used it for other constraints (to indicate which Activities are at the morning, which ones are at the afternoon)

@Volker: I have not got your idea yet. Could you explain more detail or give an example.

Thank both of you!

Liviu Lalescu


Volker Dirr

Maybe you didn't got it, because you talk about "max different subjectS per day" while i was talking about "max hours of an subject per day"?

Since i guess now that you talk about "max different subjectS per day":
- use Livius suggestion

and/or maybe use the following:
i will explain with activities with duration 1 and 2. If you have got other duration, then you need to replace it of course.

if you have got max as many activities  for a students set with duration 2 as you have got days per week:
just add a min day constraint with 100% to those activities.

if you have got max as many activities  for a students set with duration 1 as you have got days per week:
just add a min day constraint with 100% to those activities.

If you can't use the previous tricks:
maybe rethink: Your request and the default min day constraints are in fact conflicting (indirectly)! So what is more important? Do you want to split them on different days all with duration 1? In that case you will get max value for subjects per day. Or can you merge them into activities with duration 2 (or higher)? In that case you will get a lower number of subjects per day.
If you say that a your requested constraint is more important, then it will mean that you should think about all activities with duration 1+1+... and convert them into 2+...
You can do that also "mixed". So in fact you (maybe) don't need to convert all 1+1+1+1 into 2+2, maybe just 2+1+1 is enough.

As soon as you rethought about all activities check if the 2 hints are possible again. In that case you might get a "perfect" solution.