Main Menu

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.

Liviu Lalescu

Please see timetableexport.cpp, writeSimulationResults(). If you want to save data+timetable not as XML, you have to see the Rules::write function.

it.manveer.singh

hello,
  Please help, What is going in this code.for(int i=0; i<gt.rules.subjectsList.size(); i++){
           hashSubjectIDsTimetable.insert(gt.rules.subjectsList->name, QString::number(i+1));
     }
     hashActivityTagIDsTimetable.clear();
     for(int i=0; i<gt.rules.activityTagsList.size(); i++){
           hashActivityTagIDsTimetable.insert(gt.rules.activityTagsList->name, QString::number(i+1));
     }
     hashTeacherIDsTimetable.clear();
     for(int i=0; i<gt.rules.nInternalTeachers; i++){
           hashTeacherIDsTimetable.insert(gt.rules.internalTeachersList->name, QString::number(i+1));
     }
     hashRoomIDsTimetable.clear();
     for(int room=0; room<gt.rules.nInternalRooms; room++){
           hashRoomIDsTimetable.insert(gt.rules.internalRoomsList[room]->name, QString::number(room+1));
     }
     hashDayIDsTimetable.clear();
     for(int k=0; k<gt.rules.nDaysPerWeek; k++){
           hashDayIDsTimetable.insert(gt.rules.daysOfTheWeek[k], QString::number(k+1));
     }

In this code you have use loop. means that you are getting data from solution.cpp class. And the subjectsList constains all subjects. and then we get all subjects name.  Am I right ?
Please tell.

Liviu Lalescu

This data is taken from the Rules, not from Solution. It is simply to add a numeric id for each subject, teacher, etc., to write it in the html timetables. This code is written by Volker I think and it is not critical to understand the algorithm of FET.

it.manveer.singh

Thank you,
  Please tell me, what is going on these lines:
if(ai!=UNALLOCATED_ACTIVITY){
                             //Activity* act=gt.rules.activitiesList.at(ai);
                             Activity* act=&gt.rules.internalActivitiesList[ai];
                             for(QStringList::Iterator it=act->teachersNames.begin(); it!=act->teachersNames.end(); it++)
                                   tos<<" <Teacher name=\""<<protect(*it)<<"\"></Teacher>";
                             tos<<"<Subject name=\""<<protect(act->subjectName)<<"\"></Subject>";
                             foreach(QString atn, act->activityTagsNames)
                                   tos<<"<Activity_Tag name=\""<<protect(atn)<<"\"></Activity_Tag>";

                             int r=best_solution.rooms[ai];
                             if(r!=UNALLOCATED_SPACE && r!=UNSPECIFIED_ROOM){
                                   tos<<"<Room name=\""<<protect(gt.rules.internalRoomsList[r]->name)<<"\"></Room>";
                             }
                       }
In this code. What does the mean of QStringList. Is is simple QList or List or String. And please tell me about this for loop. Please help.

Thanks in advance.
Manveer

it.manveer.singh

hello,
  Please can you tell me the flow of this FET program. I am in fet.cpp file. Please help me. I will thankful to you.

Liviu Lalescu

QuoteThank you,
  Please tell me, what is going on these lines:
if(ai!=UNALLOCATED_ACTIVITY){
                             //Activity* act=gt.rules.activitiesList.at(ai);
                             Activity* act=&gt.rules.internalActivitiesList[ai];
                             for(QStringList::Iterator it=act->teachersNames.begin(); it!=act->teachersNames.end(); it++)
                                   tos<<" <Teacher name=\""<<protect(*it)<<"\"></Teacher>";
                             tos<<"<Subject name=\""<<protect(act->subjectName)<<"\"></Subject>";
                             foreach(QString atn, act->activityTagsNames)
                                   tos<<"<Activity_Tag name=\""<<protect(atn)<<"\"></Activity_Tag>";

                             int r=best_solution.rooms[ai];
                             if(r!=UNALLOCATED_SPACE && r!=UNSPECIFIED_ROOM){
                                   tos<<"<Room name=\""<<protect(gt.rules.internalRoomsList[r]->name)<<"\"></Room>";
                             }
                       }
In this code. What does the mean of QStringList. Is is simple QList or List or String. And please tell me about this for loop. Please help.

Thanks in advance.
Manveer

It is Volker's code. It just writes in a html file the teachers, subject, activity tag, room for this activity.

About QStringList: please read Qt documentation on this class (qt.nokia.com/doc/ or more precise: http://qt.nokia.com/doc/4.5/classes.html).

Liviu Lalescu

Quotehello,
  Please can you tell me the flow of this FET program. I am in fet.cpp file. Please help me. I will thankful to you.

It splits on whether the user wants command line or interface. Read function main(argc, argv).

Volker Dirr

Don't forget that FET is gpl licended.
i saw at your forum that the source of your software is closed.
so if you use algorithm-ideas and or even code, then you need to open your source too.

in §2b it say that even if you use a small code or idea, you need to open your whole project source.

it.manveer.singh

Hello,
 I have read this documentation provided by FET.  I will careful for it. But just asking about this algorithm. Because your code is really so typical. No one can understand it very easily. So please don't worry about it.

it.manveer.singh

hello,
 Can you tell me one thing are you using fitness(ruels..) method in solution.cpp with fitness in timeConstraints and fitness with spaceConstraints. Where are you calling this methods in fet.cpp or fetmainform.cpp.
Please help.

Volker Dirr

QuoteHello,
 I have read this documentation provided by FET.  I will careful for it. But just asking about this algorithm. Because your code is really so typical. No one can understand it very easily. So please don't worry about it.

what do you mean with "typical"? do you mean "peculiar" or "classic/normal"?



it.manveer.singh

No,  
  It is usual code. But difficult to understand for each and every developer may be.
 That's why I called it is typical.


Volker Dirr

#72
if you don't know where liviu (or me) call a function please get a better editor. there are editors available that can not only search in the current document. there are editors available that can also search in all files of a directory.

I am again not 100% sure what you mean.

in my opinion it is maybe not perfect code, but it as some usefull comments and the variables have very good names, so the funtion of them is clear.

i just know fet has many feaures that even commercial timetabling software doesn't have. fet has many features that are not included in a single timetabling software i know. or can you tell me a timetablingsoftware that print the teachers free periods table like fet? i don't know a single timetablingsoftware that can do that. similar to most constraints (of course in most cases not the constraint itself, but the way it is included into fet -> so flexible to every activity). also html outputfile is not "typical". i don't know a single timetablingsoftware that print simultanious activities into the same cell (i know only software that print it into pseudo classes or print it under the table.) i also never saw a timetabling software that print the years and groups table like fet. (all other software i know do it by adding pseudo classes.) so fet is more then "typical" or "usual". i checked your demo page and i saw also you don't have all that features at the moment. if i see that someone get ideas/source from fet and enter it into his programm without doing it under the gpl, then i will worry about that.

Liviu Lalescu

Quotehello,
 Can you tell me one thing are you using fitness(ruels..) method in solution.cpp with fitness in timeConstraints and fitness with spaceConstraints. Where are you calling this methods in fet.cpp or fetmainform.cpp.
Please help.

I am calling the fitness in timetablegenerateform.cpp, for the current solution obtained after the generation. Also I think I am calling it in the timetablegeneratemultipleform.cpp, but I am not sure.

it.manveer.singh

#74
Hello Volker Dirr,
   I mean to say that can I change this code in java under gpl. Can you tell me "i checked your demo page". Can you explain it.