FET Forum

FET Development => Report a Bug => Topic started by: Zsolt Udvari on August 16, 2017, 05:23:24 PM

Title: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 16, 2017, 05:23:24 PM
Maybe a user error (PEBKAC) but I think I share it.

So I've a little complicated FET-file and it seems the "An activity has a preferred starting time" doesn't work.

I attached the file and try to generate and check:

Is it a bug or did I anything wrong?
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 16, 2017, 05:30:11 PM
Hm. It is a bug with 5.31.5 but works as expected with 5.32.2.
Was any bug fix between these releases?
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 16, 2017, 05:51:51 PM
There was no such fix between FET-5.31.5 and FET-5.32.2.

It is a feature, not a bug :)

FET does not care about same starting time constraints to forbid some activities to occupy the slots which are not permitted by influence from other same starting time activities.

Do you think I should add this in the TODO?
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 16, 2017, 06:55:56 PM
Quote from: Liviu Lalescu on August 16, 2017, 05:51:51 PMDo you think I should add this in the TODO?
I don't know. It seems my logic is different as FET logic. I think my case is univocal there aren't any choices.
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 16, 2017, 07:04:33 PM
I added this in the TODO. I'll think about it.
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 16, 2017, 07:09:13 PM
You are right, I should implement this. The problem is that it is very risky to change now working code. I should run through all my test files, again.
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 16, 2017, 07:19:02 PM
Do you think it's worth to try a tag?

I've many activities which should have same starting time (day and hour too) and I would like (it's better because of complications) to determine their starting time.
In the file I created virtual activities (895 and 896) and in this case it's easy to maintain the starting times: have to search the virtual activities and haven't to think which activity has determined starting time.
My idea with tags: I'll create tags (instead of virtual activities), add the tag to activities and use "Set of subactivities has a set of preferred starting times".

What do you think? The tags is better?

I don't want add this constraint to every activities because if should modify it's many work - many work causes many errors and bugs :)
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 16, 2017, 07:52:17 PM
Quote from: Liviu Lalescu on August 16, 2017, 07:09:13 PM
You are right, I should implement this. The problem is that it is very risky to change now working code. I should run through all my test files, again.
I don't know FET's code but I think you should add (merge) time constraints (virtually, doesn't write into foo.fet) to every activities.
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 16, 2017, 10:05:59 PM
Quote from: Zsolt Udvari on August 16, 2017, 07:19:02 PM
Do you think it's worth to try a tag?

I've many activities which should have same starting time (day and hour too) and I would like (it's better because of complications) to determine their starting time.
In the file I created virtual activities (895 and 896) and in this case it's easy to maintain the starting times: have to search the virtual activities and haven't to think which activity has determined starting time.
My idea with tags: I'll create tags (instead of virtual activities), add the tag to activities and use "Set of subactivities has a set of preferred starting times".

What do you think? The tags is better?

I don't want add this constraint to every activities because if should modify it's many work - many work causes many errors and bugs :)

Yes, it might be a good idea.

Quote from: Zsolt Udvari on August 16, 2017, 07:52:17 PM
Quote from: Liviu Lalescu on August 16, 2017, 07:09:13 PM
You are right, I should implement this. The problem is that it is very risky to change now working code. I should run through all my test files, again.
I don't know FET's code but I think you should add (merge) time constraints (virtually, doesn't write into foo.fet) to every activities.

Yes, it would be an idea. My hope is that the improvement would be very low. Because of the way the FET algorithm works. The same starting time activities are kept together all the time.

There are also other things why I cannot implement this feature: a person might come up with min days between activities which forbids some slots for some activities with same starting time. Or max hours daily for students will forbid some activities to be at the last slots of the days. There are too many variants to take care of. And I wrote in the FET documentation that you can help the program towards the solution by adding redundant constraints.

It would be good if you could make a test. Your original file and a file in which you help FET towards the solution, with tags constraints or preferred activity constraints. Generate more timetables and let us know the results. Then I will see  what I can do. But I presume the improvement would not be important.
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 17, 2017, 09:31:00 AM
QuoteThere are too many variants to take care of.
Yes, I know.

If I can help you I'll try :)
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 17, 2017, 09:41:26 AM
Quote from: Zsolt Udvari on August 17, 2017, 09:31:00 AM
If I can help you I'll try :)

Thank you! Like I wrote in the paragraph above, a comparison:

Quote from: Liviu Lalescu on August 16, 2017, 10:05:59 PM
It would be good if you could make a test. Your original file and a file in which you help FET towards the solution, with tags constraints or preferred activity constraints. Generate more timetables and let us know the results. Then I will see  what I can do. But I presume the improvement would not be important.

You need to obtain a solvable file first.
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 17, 2017, 12:24:13 PM
Quote from: Liviu Lalescu on August 16, 2017, 10:05:59 PM
Quote from: Zsolt Udvari on August 16, 2017, 07:19:02 PM
What do you think? The tags is better?

Yes, it might be a good idea.
I did it (the tags). It seems it's better solution - faster and it seems doesn't try change an univocal constraint.

There isn't a solvable file (it's my fault, not FET ;) ) but I hope it will be ready soon.
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 17, 2017, 02:19:04 PM
Quote from: Zsolt Udvari on August 17, 2017, 12:24:13 PM
I did it (the tags). It seems it's better solution - faster and it seems doesn't try change an univocal constraint.

There isn't a solvable file (it's my fault, not FET ;) ) but I hope it will be ready soon.

Could you please send me the slower and faster files?
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 17, 2017, 02:33:49 PM
The slower is in the first comment, the faster is here.

It isn't solvable yet.
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 17, 2017, 02:49:32 PM
Thank you for the files. Fortunately (for me) I can say that this is not a proof that the second file is faster. It is just the initial order of placing the activities is changed, because of different constraints, and FET can go farther than on the first file.

We need a solvable file to check if it faster, and preferably run more times (maybe even 100 timetables, but 10 might be enough).

Another crucial thing is that we need ensure that the files are identical, only that you help FET towards a solution with some redundant constraints. I am not sure you respected this - I compared your files side-by-side with KDiff3 and it seems you modified some activities and some other constraints?
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 17, 2017, 03:02:22 PM
Yes, it changed but I think the changes are not relevant.
Here is the file before the tag-idea.

Slower vs. faster: the tag-way fet places the activities (with 100% time constraints) sooner than the "activities same starting (day+hour)"-method (added_act==279 vs. added_act==529 in some seconds).
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 17, 2017, 03:20:17 PM
Quote from: Zsolt Udvari on August 17, 2017, 03:02:22 PM
Yes, it changed but I think the changes are not relevant.
Here is the file before the tag-idea.

The changes might be relevant.

Quote
Slower vs. faster: the tag-way fet places the activities (with 100% time constraints) sooner than the "activities same starting (day+hour)"-method (added_act==279 vs. added_act==529 in some seconds).

No, FET goes further on "faster" than on "slower" is because by adding some constraints you modified the initial order of the activities. The impossible activity is moved further by chance. You need to obtain a solvable file, as I already said, and compare more generated timetables' speed.

I cannot explain better, I am sorry.
Title: Re: "An activity has a preferred starting time" bug
Post by: Zsolt Udvari on August 17, 2017, 03:22:36 PM
If you disable the time constraints (preferred starting times) of id: 163 the faster version reaches "680 out of 851" but doesn't increase.
What can be the problem? I don't see  :'(
Title: Re: "An activity has a preferred starting time" bug
Post by: Liviu Lalescu on August 17, 2017, 03:54:36 PM
I recommend a progressive approach. Start with an empty-constraint file and add/strengthen the constraints while the files is still solvable. You can choose also to start with a very constrained timetable and lower the constraints.