FET Forum

FET Support (English) => Get Help => Topic started by: fourat on August 11, 2018, 02:48:17 PM

Title: Min day constraint
Post by: fourat on August 11, 2018, 02:48:17 PM
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)
Title: Re: Min day constraint
Post by: Vangelis Karafillidis on August 11, 2018, 03:30:01 PM
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...


Title: Re: Min day constraint
Post by: fourat on August 11, 2018, 03:46:55 PM
Thank you . Yes it works.
is there on other alternative without using "Occupy max slot" constraint ?
Title: Re: Min day constraint
Post by: Liviu Lalescu on August 11, 2018, 04:14:30 PM
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 :)
Title: Re: Min day constraint
Post by: Vangelis Karafillidis on August 11, 2018, 04:36:43 PM
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
Title: Re: Min day constraint
Post by: 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   
Title: Re: Min day constraint
Post by: Liviu Lalescu on August 11, 2018, 07:25:50 PM
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.
Title: Re: Min day constraint
Post by: 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
Title: Re: Min day constraint
Post by: Liviu Lalescu on August 12, 2018, 08:22:41 AM
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.
Title: Re: Min day constraint
Post by: fourat on August 12, 2018, 09:54:36 AM
this situation is highly frequented for me so i think a custom min day constraint will be very useful.
big thanks .
Title: Re: Min day constraint
Post by: Liviu Lalescu on August 12, 2018, 10:34:25 PM
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.
Title: Re: Min day constraint
Post by: fourat on August 13, 2018, 12:01:20 AM
thank you very much
Very slow generation comparing with the official version
you can verify with these four attached files
Title: Re: Min day constraint
Post by: fourat on August 13, 2018, 12:10:41 AM
Sorry i replicated a file
Title: Re: Min day constraint
Post by: fourat on August 13, 2018, 01:58:28 AM
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
Title: Re: Min day constraint
Post by: Liviu Lalescu on August 13, 2018, 07:00:33 AM
You need to add only 3 activities, with durations increased. You cannot have 5 activities with min days 2.
Title: Re: Min day constraint
Post by: fourat on August 13, 2018, 10:15:44 AM
The above files contain an extreme situation. It works fluently when adding min day 4 between  activity 1 and Activity 2 with weight 100%
with the constraint  Min day 3 between Activities 1,2,3,4 and 5 with weight <100%

Thank you very much for this version it will be very useful for me and will help me a lot
Title: Re: Min day constraint
Post by: Liviu Lalescu on August 13, 2018, 10:27:13 AM
Quote from: fourat on August 13, 2018, 10:15:44 AM
The above files contain an extreme situation. It works fluently when adding min day 4 between  activity 1 and Activity 2 with weight 100%
with the constraint  Min day 3 between Activities 1,2,3,4 and 5 with weight <100%

I am not sure I understand. But if it works it is OK.

Quote
Thank you very much for this version it will be very useful for me and will help me a lot

You are welcome! :)
Title: Re: Min day constraint
Post by: fourat on January 23, 2019, 11:28:36 AM
Can I get an improved customized fet-fourat 64bits version ?
thanks   
Title: Re: Min day constraint
Post by: Liviu Lalescu on January 23, 2019, 11:42:46 AM
Of course! I will do this soon, probably in maximum 1 hour, and let you know.
Title: Re: Min day constraint
Post by: Liviu Lalescu on January 23, 2019, 01:11:54 PM
It is done. You can get it from the same link, https://lalescu.ro/liviu/fet/download/custom/fourat/
Title: Re: Min day constraint
Post by: fourat on January 23, 2019, 03:12:09 PM
Thank you very much  :) :)