FET Forum

FET Support (English) => Programming Help => Topic started by: znyak on March 07, 2018, 08:45:17 PM

Title: FET Algorithm
Post by: znyak on March 07, 2018, 08:45:17 PM
As mentioned in algorithm " Try to place each activity (A_i) in an allowed time slot" ,but how do we define these time slots programmatically? do we use Arrays for that?
and how can I see its implementation in FET source code?

I'm using FET-5.35.3.
Thank you :)

Title: Re: FET Algorithm
Post by: Liviu Lalescu on March 07, 2018, 09:00:59 PM
The algorithm of generation is in src/engine/generate.cpp, and the sorting of activities in initial order and other initializations is in src/engine/generate_pre.cpp.

There is a Solution class c, which has c.times[activity_index] (and rooms, but let's exclude rooms for now, for simplicity). So you have c.times[2] which is the day and hour of the third activity. c.times[2]=day_act_3+hour_act_3*n_days_per_week.

In generate.cpp, see for instance the functions Generate::moveActivity and Generate::randomSwap. These are important.
Title: Re: FET Algorithm
Post by: znyak on March 11, 2018, 10:55:49 AM
As Described in the Last step of Algorithm

2 g) If we are at level 0, and we had no success in placing A_i, place it like in steps (2 b) and (2 c), but without recursion. We have now 3 - 1 = 2 more activities to place. Go to step (2) (some methods to avoid cycling are used here).

We couldn't get what this exactly mean?

We couldn't decide where to put the conflicts generated after placing A_i as described by step 2 g). Should We add these generated conflicts to the original list of Activities in newly sorted order and repeat the algorithm from starting?

Title: Re: FET Algorithm
Post by: Volker Dirr on March 11, 2018, 11:04:28 AM
I think we can understand your problem better if you see your current code.
Title: Re: FET Algorithm
Post by: Liviu Lalescu on March 11, 2018, 06:27:47 PM
Quote from: znyak on March 11, 2018, 10:55:49 AM
As Described in the Last step of Algorithm

2 g) If we are at level 0, and we had no success in placing A_i, place it like in steps (2 b) and (2 c), but without recursion. We have now 3 - 1 = 2 more activities to place. Go to step (2) (some methods to avoid cycling are used here).

We couldn't get what this exactly mean?

We couldn't decide where to put the conflicts generated after placing A_i as described by step 2 g). Should We add these generated conflicts to the original list of Activities in newly sorted order and repeat the algorithm from starting?

FET-5.35.3:

Please see generate.cpp, lines 3047-3175, then again generate.cpp, lines 9991-10080.