Min day constraint

Started by fourat, August 11, 2018, 02:48:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fourat

Hi !

is there any trick to place two activities so that they are spaced at least two days apart, if not they will be consecutive on the same days
(one day interval is forbidden)

Vangelis Karafillidis

Hello!

Create a dummy activity (no teachers, no students).
Split = 2, duration for 1st subactivity = 2, duration for 2nd subactivity = 1
min days = 2, weight = 100%
(these subactivities can be placed for example on Monday and Wednesday. Is this what you mean with 2 days apart? If you need at least a "distance" such as Monday - Thursday, you should select min days = 3).

Go to Time/Activities/A set of activities occupies max slot from selection
Select the above dummy activity along with the real activities (the ones you need to be placed either consecutively on the same day, or spaced at least two days apart), max occupied (slots) = 3, weight = 100%, selection = all time slots.

The real activities should be placed either 2 days apart, or consecutively on the same day).
Please let me know the results...



fourat

Thank you . Yes it works.
is there on other alternative without using "Occupy max slot" constraint ?

Liviu Lalescu

#3
I am not sure I understand how they will be consecutive by Vangelis's method. But I think that the straight method works: Min days between activities, 2 days (and NOT additional 1 days), 100%, consecutive if same day :)

Vangelis Karafillidis

Amazing! I thought that the option "consecutive if same day" worked only if the weight was <100%... I should read the fine manual more carefully!
:D

fourat

#5
only tow situations are allowed :
1 the tow activities are consecutive
2 they are placed at least with 2 days  between them 
Min day 2 with weight 100% doesn't work because the tow activities will never be placed consecutively at the same day witch reduces the margin of solutions   

Liviu Lalescu

Quote from: fourat on August 11, 2018, 06:58:07 PM
only tow situations are allowed :
1 the tow activities are consecutive
2 they are placed at least with 2 days  between them 
Min day 2 with weight 100% doesn't work because the tow activities will never be placed consecutively at the same day witch reduces the margin of solutions

Indeed, sorry! I was wrong. Either use Vangelis' trick, or I could make you a customization, because I consider it is not necessary to add it to the official version.

fourat

#7
Thank you.
I will use the trick proposed by Vangelis Karafillidis
waiting for a costumed  version
I prefer to avoid  using of the constraint "aoocupy max solt" as possible

Liviu Lalescu

Quote from: fourat on August 11, 2018, 11:11:53 PM
Thank you.
I will use the trick proposed by Vangelis Karafillidis
waiting for a costumed  version
I prefer to avoid  using of the constraint "aoocupy max solt" as possible

Do not avoid it. It is highly optimized.

If you have many situations like this and it is maybe tiring to add that many tricks, it is then useful to create a custom version.

For a custom version, I am thinking that if a constraint min days between activities has min days = 2 and weight 0%, then it is forbidden to place them 1 days apart.

Please let me know if you consider you necessary need a customization.

fourat

this situation is highly frequented for me so i think a custom min day constraint will be very useful.
big thanks .

Liviu Lalescu

I made it. I hope it is correct. https://lalescu.ro/liviu/fet/download/custom/fourat/

Please test it on smaller files, making some possible files and some impossible files. I only tested a bit.

fourat

thank you very much
Very slow generation comparing with the official version
you can verify with these four attached files

fourat


fourat

#13
To avoid blocking the algorithm when the constraint is broken ( with weight <100%):
if we want to place N activity with the constraint min day> 1 we have to make sure that the two activities that will be placed first are at least n-1 days apart if n is odd and n-2 days if n is even ;  n-1-(n+1 mod 2) days

Liviu Lalescu

You need to add only 3 activities, with durations increased. You cannot have 5 activities with min days 2.