FET WITH JAVA

Started by it.manveer.singh, September 05, 2009, 03:03:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

it.manveer.singh

Hello,
      I am really a newbie. Just want to know how to find the source code of FET. I have fet 5.0. I don't have generate.cpp. Please tell me little bit more about FET. Can i get current version of FET. How to find the source code of FET.
        And can I convert the FET algorithm into JAVA Code.

Thanks in advance.

Manveer Singh.



Liviu Lalescu

QuoteHello,
      I am really a newbie. Just want to know how to find the source code of FET. I have fet 5.0. I don't have generate.cpp. Please tell me little bit more about FET. Can i get current version of FET. How to find the source code of FET.
        And can I convert the FET algorithm into JAVA Code.

Thanks in advance.

Manveer Singh.



You can get the latest source code from FET web page, the tar.bz2 contains generate.cpp in directory src/engine/.

It is difficult to convert to Java. Maybe you could use the command line version of FET.

The algorithm contains references to these classes which are not standard C++: QList, QSet and QHash (I hope I enumerated all of them).

it.manveer.singh

Thanks for your response.
      Can you help me to understand this algorithm. If I want to check and understand it's code. how could I. I don't know who is the main class.
     Please help.

Thanks in advance.
Manveer Singh

Liviu Lalescu

#3
For the algorithm, ignore all the rest, these are important: generate.cpp (and generate_pre.cpp to see initialization of structures). And generate.h and generate_pre.h.

I have very little time now, I am working on improvements, but I will try to answer your specific questions about generate.cpp.

The solution is an array of nactivities time and rooms (solution.h - not important this file for you).

it.manveer.singh

Hello,
   I am trying to understand the code in generate.cpp file. But I couldn't. Can you tell me you have use some inline functions like this--->
inline void Generate::getTchTimetable(int tch, const QList<int>& conflActivities)
{
     for(int d2=0; d2<gt.rules.nDaysPerWeek; d2++)
           for(int h2=0; h2<gt.rules.nHoursPerDay; h2++){
                 int ai2=newTeachersTimetable[tch][d2][h2];
                 if(ai2>=0 && !conflActivities.contains(ai2))
                       tchTimetable[d2][h2]=ai2;
                 else
                       tchTimetable[d2][h2]=-1;
           }
           
     /*for(int dur=0; dur<act->duration; dur++){
           assert(tchTimetable[d][h+dur]==-1);
           tchTimetable[d][h+dur]=ai;
     }*/
}
You are calling this function from generate.h. but you didn't specify any variables within it. How it works..? Please help. It is really too much important for me.
Thanks in advance.
Manveer Singh

Liviu Lalescu

#5
QuoteHello,
   I am trying to understand the code in generate.cpp file. But I couldn't. Can you tell me you have use some inline functions like this--->
inline void Generate::getTchTimetable(int tch, const QList<int>& conflActivities)
{
     for(int d2=0; d2<gt.rules.nDaysPerWeek; d2++)
           for(int h2=0; h2<gt.rules.nHoursPerDay; h2++){
                 int ai2=newTeachersTimetable[tch][d2][h2];
                 if(ai2>=0 && !conflActivities.contains(ai2))
                       tchTimetable[d2][h2]=ai2;
                 else
                       tchTimetable[d2][h2]=-1;
           }
           
     /*for(int dur=0; dur<act->duration; dur++){
           assert(tchTimetable[d][h+dur]==-1);
           tchTimetable[d][h+dur]=ai;
     }*/
}
You are calling this function from generate.h. but you didn't specify any variables within it. How it works..? Please help. It is really too much important for me.
Thanks in advance.
Manveer Singh

This function gets the teachers timetable, without the activities which are already in the list of activities to be displaced.

The newTeachersTimetable[tch] keeps the timetable for each teacher, at the start of Generate::randomSwap function. In randomSwap, I displace activities in each time slot. I use tchTimetable for current timetable, at each constraint.

This function is not critical for algorithm understanding.

it.manveer.singh

Hello,
 Can you tell me. In generate new menuitem. What is going on? And What is the processing of checking time table each and every slot means like day monday, tuesday, wednesday, thursday.. and same for time. 9-10, 10-11, 11-12... and so on.
 And can you tell me. How can I find the right method for this checking.

Please help.

Liviu Lalescu

QuoteHello,
 Can you tell me. In generate new menuitem. What is going on?

It is called function Generate::generate, or this is what you want to ask?

Quote
And What is the processing of checking time table each and every slot means like day monday, tuesday, wednesday, thursday.. and same for time. 9-10, 10-11, 11-12... and so on.
 And can you tell me. How can I find the right method for this checking.

Sorry, but I do not understand. The timetable is generated in Generate::generate and the soft conflicts are computed in Time(Space)Constraint::fitness

it.manveer.singh

Hello,
Can you explain it more.... where you pick 5 from ?
The routine random_swap will only search (recursively) the first (best)
slot if level>=5. That is, we search at level 0 all slots, at level 1 the same,
..., at level 4 the same, at level 5 only the first (best) slot, at level 6 only
the first (best) slot, etc., we reach level 13, then we go back to level 4 and
choose the next slot, etc.

Liviu Lalescu

#9
QuoteHello,
Can you explain it more.... where you pick 5 from ?
The routine random_swap will only search (recursively) the first (best)
slot if level>=5. That is, we search at level 0 all slots, at level 1 the same,
..., at level 4 the same, at level 5 only the first (best) slot, at level 6 only
the first (best) slot, etc., we reach level 13, then we go back to level 4 and
choose the next slot, etc.

Has no theoretical meaning, I found it practically :-). It is a compromise between speed and power of search. Speed means lower values, power of search means higher values.

I added now a comment in generate.cpp for that.

it.manveer.singh

Hello,
     I want to set the schedule like this. One teacher can teach one class three times of a week. When I am generating time table in FET. It shows me different week. and the activities are not proper in order. Like one day gap between each lecture or one hour gap of each lecture.
Please describe.


Liviu Lalescu

QuoteHello,
     I want to set the schedule like this. One teacher can teach one class three times of a week. When I am generating time table in FET. It shows me different week. and the activities are not proper in order. Like one day gap between each lecture or one hour gap of each lecture.
Please describe.


Sorry, I do not understand. Maybe you need an activity with duration 3?

it.manveer.singh

Hello,
       Can you graphically explain that how to generating time table by clicking on generate new. And which file are you using for generating time table and this menubar. Please help.


Liviu Lalescu

QuoteHello,
       Can you graphically explain that how to generating time table by clicking on generate new. And which file are you using for generating time table and this menubar. Please help.


In fetmainform.cpp, .h and _template.ui is the main menu. In timetablegenerateform.cpp, .h and _template.ui is the generation menu.

it.manveer.singh

Hello,
      I want to about sortActivities method. What is it's working. Is is sorting complex means which has two type of activity like 2 activities_grouped, sameStartingTime. and so on. Please tell me about the procedure which you are following. And Also tell me THRESHOLD. And Please can you send documentation of this code in details. I will be thankful to you.
Thanks
 Manveer Singh