Author Topic: "An activity has a preferred starting time" bug  (Read 180 times)

0 Members and 1 Guest are viewing this topic.

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
"An activity has a preferred starting time" bug
« on: August 16, 2017, 10:23:24 AM »
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:
  • Nr. 895 and 896 activities (without any teacher and student)
  • They have preferred starting time: "Szerda 1." (Wednesday) and "Hétfő 3." (Monday) with 100%
  • They have same starting time (day+hour) with 7 other activites (for example 647 and 648)
  • Generate (without success)
  • Check the student's timetable, go to "11A" and the 647 is on "Péntek" (Friday)!

Is it a bug or did I anything wrong?

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #1 on: August 16, 2017, 10:30:11 AM »
Hm. It is a bug with 5.31.5 but works as expected with 5.32.2.
Was any bug fix between these releases?

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #2 on: August 16, 2017, 10:51:51 AM »
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?

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #3 on: August 16, 2017, 11:55:56 AM »
Do 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.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #4 on: August 16, 2017, 12:04:33 PM »
I added this in the TODO. I'll think about it.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #5 on: August 16, 2017, 12: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.

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #6 on: August 16, 2017, 12: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 :)

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #7 on: August 16, 2017, 12:52:17 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.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #8 on: August 16, 2017, 03:05:59 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.

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.
« Last Edit: August 16, 2017, 03:09:54 PM by Liviu Lalescu »

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #9 on: August 17, 2017, 02:31:00 AM »
Quote
There are too many variants to take care of.
Yes, I know.

If I can help you I'll try :)

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #10 on: August 17, 2017, 02:41:26 AM »
If I can help you I'll try :)

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

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.

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #11 on: August 17, 2017, 05:24:13 AM »
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.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #12 on: August 17, 2017, 07:19:04 AM »
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?

Zsolt Udvari

  • Level 3
  • ***
  • Posts: 157
  • I Love Free Software!
    • View Profile
    • My Website
Re: "An activity has a preferred starting time" bug
« Reply #13 on: August 17, 2017, 07:33:49 AM »
The slower is in the first comment, the faster is here.

It isn't solvable yet.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 5180
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: "An activity has a preferred starting time" bug
« Reply #14 on: August 17, 2017, 07:49:32 AM »
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?