Main Menu

Weeks

Started by Zsolt Udvari, July 27, 2012, 04:16:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zsolt Udvari

I should do a timetable with week A and week B.
The difference between A and B: some activities have different splits and maybe duration.
The difference is little: on some year (maybe 50%) has some (1-3 per year) activities, on weekA: 1+1, on weekB: 1 (so without +1), or 1+1+1 and 1+1 (so the difference is only 1 hour).
How can I make similar timetables on week A and week B?
I've tried with same seeds but the two timetables very-very different!

If I need write some plus script (bash, awk, sed, etc.) or make something manually doesn't matter.

Any idea?

Bobby Wise

Hello Zsolt,


If nobody can help you immediately, please be patient Liviu and Volker should be back next week. I am sure they can assist you.

Zsolt Udvari


Liviu Lalescu

#3
Thank you, Bobby, for caring!

Zsolt, I think a nice constraint to help you is the new (since 5.15.0) constraint activities occupy max time slots from selection. Say you have 4 activities, each duration 1, in first week, then 3 in second week. Add constraint, all time slots, max occupied = 4, these 4+3 activities. Later thinking: this in case you need to double your students, teachers and rooms. And constraint activities occupy max different rooms.

Or: http://lalescu.ro/liviu/fet/forum/index.php?topic=351.0

Please let me know.

PS: Yes, this random seed behavior is normal.

Zsolt Udvari

I think you misunderstood me.
I want that the two timetable similar.
Say that class A has the following activities on Monday (week A) in the following order:
literature, mathemathic, music, history, physics.

If music has 0.5 hours per week (weekA 1, weekB 0, so the average is 0.5) and arts has 0.5 hours per week (weekA 0, weekB 1) too. So we can say that on weekA is a music, and on weekB is an arts (instead of music).
And I want Monday on weekB:
literature, mathemathic, arts, history, physics.

It isn't should be exactly same the two weeks. It's enough that the differences of two timetables is little.
E.g. monday on WeekB can be:
mathomatic, literature, arts, gymnastics, history.

And can't be:
chemie, gymnastics, grammar, english, biology
because it's very-very different to monday of weekA.

So I think the doubling of every data isn't good for me (2*5 days, 2*"number of activities", etc.) because I can't generate similar timetables to weekA and weekB.

My first idea was the same random seed on weekA and weekB but it didn't work.
Second idea: I generate the timetableA, read the time-constraints of activities (which are week-independent) and add these constraints to datas of weekB (with a script not with by hand :) ). But it didn't work too (as I thought) because can't generate timetable (the generation of weekA was some (2-3) minutes, weekB wasn't ready after 30 minutes).
Third idea (I didn't probe it, it is new idea (about 10 minutes old :))): generate timetableA, read the time-constraints of week-independent activities and I add these constraint without hour only with day (so I don't say that literature should first hour on monday, it is enough when literature will on monday).

What do you think about my third idea? Or do you have any other idea?

Liviu Lalescu

Quote from: Zsolt Udvari on July 30, 2012, 08:26:45 AM
So I think the doubling of every data isn't good for me (2*5 days, 2*"number of activities", etc.) because I can't generate similar timetables to weekA and weekB.

You can generate similar timetables, like I wrote: double all the data in a single file, then say Math 4 hours per week, constraint activities these 4*2 Math per fortnight occupy max different slots 4 from all slots per week. Please read this new constraint's help. Math will then be similar in week 1 and 2 (both weeks in a single .fet file).

Zsolt Udvari

Hm, I think I don't understand this constraint or your idea.

This constraint: I add the activities of Math select some timeslot and the maximum occupy to 2 (e.g. hour 5 and hour 6 on all days). When I understand well is this mean that FET places Math activites to hour 1-4 and maximum two maths will on hour 5 and hour 6 (maybe one or zero math-activities). Is it good-understand? Is this similar to "PreferredStartingTime"-constraint? My old topic.

If I understand this constraint correctly I don't understand why will be the two timetable (in one timetable)  similar. I've 4 maths (on every week). I've add two constraint: "occupy 4 maths on weekA and occupy 4 maths on weekB". And I do it to every constraint. Why will be the two timetables similar?

Liviu Lalescu

No.

Say teacher T, 4 activities each week. Double teacher T: T1 and T2 in new file. Add 8 activities (4 T1, 4 T2). Keep number of days and hours in the file. Then these 8 activities will occupy the same slots with the constraint above, but T1 is week 1 and T2 is on a so-called week 2.

Please let me know now.

Zsolt Udvari

Oh, understand now why did you say to double the teachers and rooms.
So again, I hope it well be clear for me :)

The days and hours the "normal", monday-friday and hours 1.-6., so in my case it's 5*6=30 timeslots.
I'll record everything else twice (e.g. my_fav_room will my_fav_room and my_fav_room_B, my_fav_teacher will my_fav_teacher and my_fav_teacher_B and same with classes, subgroups, activities).

All actvity_A will have a room-constraint: activity_A can be place in any room_A, activity_B can be place in any room_B.

And I'll have a timetable for all TeacherA and for all TeacherB and for all YearA and for all YearB (and groups, subgroups too).

It's ok (hopefully).

But the main question: what guaranteed that the parallel timetables (for WeekA and for WeekB) will similar? And why should I need the occupy-constraint?
I think I'm stupid :(

Liviu Lalescu

Quote from: Zsolt Udvari on July 30, 2012, 01:21:24 PM

It's ok (hopefully).


Maybe there  is a problem with rooms. Please think about it.

Quote

But the main question: what guaranteed that the parallel timetables (for WeekA and for WeekB) will similar? And why should I need the occupy-constraint?


Max 4 slots occupied makes the 8 activities be in only 4 slots, so the activities of T1 are in the same day+hour as T2, in my example.

Zsolt Udvari

Quote from: Liviu Lalescu on July 30, 2012, 02:51:23 PM
Maybe there  is a problem with rooms. Please think about it.
First I try to understand :)

Quote from: Liviu Lalescu on July 30, 2012, 02:51:23 PM
Max 4 slots occupied makes the 8 activities be in only 4 slots, so the activities of T1 are in the same day+hour as T2, in my example.
Oh, I think I begin to understand :) I thought wrong. I didn't think that can use these constraint to different activities (different=another class, another teacher, etc., not two different sub-activity of an activity).
But with this method has a problem IMHO: the teachers and their "NotAvailableTime". And I don't need "same day+hour", it's enough "same day" (same day+same hour is better of course but I'm afraid this is too strong constraint in some cases).

I've an idea:

  • if teacher hasn't too much time-constraint (and few activities) I can use "occupy-constraint"
  • if the teacher has many time-constraint I'll use "same starting day"
What do you think? Is it better method? Or "same starting day" is stronger and harder than occupy?

Rooms:
I'll add room-constraints to activity_A only room_A and to activity_B only room_B. I hope it's enough.

Zsolt Udvari

It seems this idea is too hard to FET (or I do something bad).

The generation of one week is some minutes.
If I add the next week and the activities (about double activities) FET can't generate timetable - after 10 minutes the maximum placed activities about 30-50% or less.

Liviu, do you think I did something wrong?

Liviu Lalescu

If same starting day is weaker, then it is easier for FET (should be, otherwise is a bug).

Please attach your file, but I can't promise to work on it too much.

Zsolt Udvari

It seems "same starting day" works with lower weight.
I'll test it.

I think the occupy-constraint with weight 100% is too much.

Liviu Lalescu

#14
I attach a very small example of what I have in mind. I added t1, y1 and s1 for the first week; t2, y2 and s2 for the second week -- just to make sure we are talking about the same thing.

Maybe you could also try without rooms, firstly. Because you constrained the activities very much, in a single room.