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.
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).
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
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).
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
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.
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.
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
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.
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.
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.
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?
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.
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.
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
QuoteHello,
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
I have no documentation, unfortunately.
THRESHOLD is chosen practically, 80%. >=THRESHOLD means constraint is taken care of, <THRESHOLD means constraint is ignored.
The routine puts at first the activities which seem more difficult, considering not available, preferred times, same starting time-s, grouped, consecutive, preferred room(s). It is not difficult to understand this procedure.
Hello,
Can You tell me. What is going in this line. I have this QList<int> activitiesSameStartingDayActivities[MAX_ACTIVITIES] and QList<double> activitiesSameStartingDayPercentages[MAX_ACTIVITIES];. Why we used this statement following below:
for(int i=0; i<gt.rules.nInternalActivities; i++){
activitiesSameStartingDayActivities.clear();
activitiesSameStartingDayPercentages.clear();
}
I am thinking you are getting all elements in activitiesSameStartingDayActivities by passing i. After that you are clearing this list by using .clear() method. Am i right. And Also what is append. in QList. Append means : You have used :int t=activitiesHomeRoomsHomeRooms[a].indexOf(spr->_room);
activitiesHomeRoomsHomeRooms[a].clear();
activitiesHomeRoomsPercentage[a]=max(activitiesHomeRoomsPercentage[a], spr->weightPercentage);
if(t!=-1){
activitiesHomeRoomsHomeRooms[a].append(spr->_room);
}
Please explain it. It is really very important to me. In high lighted line where you are initializing t variable. What is this activitiesHomeRoomsHomeRooms[a].indexOf(spr->_room). I am unable to understand it. Please help. And also tell activitiesHomeRoomsHomeRooms[a].append(spr->_room); Is it adding this room element to activitiesHomeRoomsHomeRooms with it's index [a] or something else.
Thanks in advance.
Manveer
QuoteHello,
Can You tell me. What is going in this line. I have this QList<int> activitiesSameStartingDayActivities[MAX_ACTIVITIES] and QList<double> activitiesSameStartingDayPercentages[MAX_ACTIVITIES];. Why we used this statement following below:
for(int i=0; i<gt.rules.nInternalActivities; i++){
activitiesSameStartingDayActivities.clear();
activitiesSameStartingDayPercentages.clear();
}
I am thinking you are getting all elements in activitiesSameStartingDayActivities by passing i. After that you are clearing this list by using .clear() method. Am i right. And Also what
This is initialization. i goes for all activities. The list is from 0 to nActivities-1.
Quote
is append. in QList. Append means : You have used :int t=activitiesHomeRoomsHomeRooms[a].indexOf(spr->_room);
activitiesHomeRoomsHomeRooms[a].clear();
activitiesHomeRoomsPercentage[a]=max(activitiesHomeRoomsPercentage[a], spr->weightPercentage);
if(t!=-1){
activitiesHomeRoomsHomeRooms[a].append(spr->_room);
}
Please explain it. It is really very important to me. In high lighted line where you are initializing t variable. What is this activitiesHomeRoomsHomeRooms[a].indexOf(spr->_room). I am unable to understand it. Please help. And also tell activitiesHomeRoomsHomeRooms[a].append(spr->_room); Is it adding this room element to activitiesHomeRoomsHomeRooms with it's index [a] or something else.
Thanks in advance.
Manveer
Home room is spr->room, other rooms are excluded because of current constraint, and the weight is maximum from other constraints and this constraint.
hello,
Please tell me which file makes table with limited rows and columns.
Hello,
Please tell me one thing. In generate.cpp you are using void Generate::generate(int maxSeconds, bool& impossible, bool& timeExceeded, bool threaded) method in generate.cpp. Can you tell me from where you are passing these parameter in generate() function. And from where you are calling this function. Please tell. It's really urgent.
Manveer
QuoteHello,
Please tell me one thing. In generate.cpp you are using void Generate::generate(int maxSeconds, bool& impossible, bool& timeExceeded, bool threaded) method in generate.cpp. Can you tell me from where you are passing these parameter in generate() function. And from where you are calling this function. Please tell. It's really urgent.
Manveer
In timetablegenerateform.cpp, timetablegeneratemultipleform.cpp and fet.cpp (three places - generate single, multiple or command line).
Hello,
Can you help me..Please See this logic....
again_if_impossible_activity:
for(int i=0; i<gt.rules.nHoursPerWeek; i++)
perm=i;
for(int i=0; i<gt.rules.nHoursPerWeek; i++){
int t=perm;
int r=randomKnuth()%(gt.rules.nHoursPerWeek-i);
perm=perm[i+r];
perm[i+r]=t;
}
You are using this logic. nhoursPerWeek means 60. When you are assigning this value to perm=i;
In which perm[] =new Perm[31]; MAX_LEVEL. Then how could it possible to iterate i 60 times. It is giving me an error. ArrayIndexOutOfBound. Please tell me what to do. I will be thankful to you.
Thanks
Manveer
This portion is generating a random permutation, like in CLRS (Cormen, Leiserson, Rivest and Stein). Be more careful, permL[MAX_LEVEL][MAX_HOURS_PER_WEEK] and perm=permL[level], so perm has MAX_HOURS_PER_WEEK slots.
Hello,
Can you explain why are you using permL[MAX_LEVEL][MAX_HOURS_PER_WEEK] and perm=permL[level], so perm has MAX_HOURS_PER_WEEK slots. How to do this I am really unable to understand this logic. Can you tell me reference of any web page for this tutorial. Or If you can help me then please explaint it. I don't want to use macro. please help it's really urgent.
Thanks a lot for your help.
I use that macro so that code is faster (the variable is created only once instead of once each call to randomSwap). If you want, just define a local variable perm[MAX_HOURS_PER_WEEK].
Hello,
I am getting one problem in randomSwap() function. Some times it is quiting automatically without exiting the program. Can you tell me what is the reason of getting this problem. it is not showing any errors just quiting the program. And the what is the value of nHoursPerWeek. And You are using MAX_RETRIES_FOR_AN_ACTIVITY_AT_LEVEL_0 = 200000; Can i reduce this value. And Can I use another functions instead of goto statement. Please help.
QuoteHello,
I am getting one problem in randomSwap() function. Some times it is quiting automatically without exiting the program. Can you tell me what is the reason of getting this problem. it is not showing any errors just quiting the program. And the what is the value of nHoursPerWeek. And You are using MAX_RETRIES_FOR_AN_ACTIVITY_AT_LEVEL_0 = 200000; Can i reduce this value. And Can I use another functions instead of goto statement. Please help.
nHoursPerWeek=nDaysPerWeek*nHoursPerDay. You can reduce from 200000, yes. Yes, you can use other functions instead of goto, but you have to change the code much, probably.
hello,
Please tell me about this block: if(!skipRandom(notAllowedTimesPercentages[ai][newtime])){
nConflActivities[newtime]=MAX_ACTIVITIES;
continue;
}
In this block when the skipRandom function is not true then it will go inside this block and then use continue; where the continue label send the control again at again_if_impossible_activity: label which execute it again and again. Am i right about this. And please tell me about #if 0 and #endif. In randomswap() function. Is it compulsory to use this. Please help.
Thanks
Quotehello,
Please tell me about this block: if(!skipRandom(notAllowedTimesPercentages[ai][newtime])){
nConflActivities[newtime]=MAX_ACTIVITIES;
continue;
}
In this block when the skipRandom function is not true then it will go inside this block and then use continue; where the continue label send the control again at again_if_impossible_activity: label which execute it again and again. Am i right about this. And please tell me about #if 0 and #endif. In randomswap() function. Is it compulsory to use this. Please help.
Thanks
It will try it 200,000 times, not more. #if 0 ...code... #endif -> code will not be executed. You can remove this code.
Hello,
Can you tell me how to set the value of level in randomswap(). in prevvalue function you are passing 0 by default. I want to increase the value of level as I defined.
Thanks in advance.
QuoteHello,
Can you tell me how to set the value of level in randomswap(). in prevvalue function you are passing 0 by default. I want to increase the value of level as I defined.
Thanks in advance.
I am not sure I understand your purpose. level is a parameter of randomSwap, it is not set there. You can modify level at start of randomSwap function, if you really want.
Hello,
Can I use database instead of xml file. Please help. And which files are important with database. There are lots of files.
Just add in the database all the information from the xml. But you have a lot of work to set up such information.
The data file is the .fet input file.
Thanks for this.
Can you tell about how to set the schedule value in a table cell after generating the schedule. I want to set each schedule activity in table cell by using it's rows and column. And please also tell me that can I save the generate scheduled data into one another table. This is because, I don't want to generate schedule again and again.
Please help.
Thanks
See timetableviewstudentsform.cpp (and teachers, and rooms).
Hello,
I have seen rules.cpp. In this class you have used computeInternalStructure() which is computing teacherList.size(). Can you tell me from where are you getting the value of teacherList. similarly subjectList and subgroupList.
QuoteHello,
I have seen rules.cpp. In this class you have used computeInternalStructure() which is computing teacherList.size(). Can you tell me from where are you getting the value of teacherList. similarly subjectList and subgroupList.
teachersList is from the data inputted by the user, for instance in teachersform.cpp.
Hello,
Can you tell me in solution.cpp class you have used fitness parameterized function. Can you tell me from where are you calling and passing the values into this.
Please help.
QuoteHello,
Can you tell me in solution.cpp class you have used fitness parameterized function. Can you tell me from where are you calling and passing the values into this.
Please help.
I am calling the fitness of a solution in timetable generate form (or generate multiple) and the fitness of a solution is the sum of fitness of all constraints' fitness for the solution.
Hello,
Can you help me a bit more. This code is so sophistacated. And there is lots of conditions that I can not understand properly. Did you made any other school scheduler in any other language. I think your c++ logics are so strong. Then why you don't go for java. And made this scheduler in java. Sorry for this sugestion. but I want a satisfactory answer.
Thanks a lot.
QuoteHello,
Can you help me a bit more. This code is so sophistacated. And there is lots of conditions that I can not understand properly. Did you made any other school scheduler in any other language. I think your c++ logics are so strong. Then why you don't go for java. And made this scheduler in java. Sorry for this sugestion. but I want a satisfactory answer.
Thanks a lot.
Java is slower than C++, that is why I prefer C++. I have not written the code in other language than C++.
hello.
Thanks for this. I want to make this scheduler in java. I want your help to making this code in java. Can you help in java. And please tell about QList<qint16> b[TEACHERS_FREE_PERIODS_N_CATEGORIES][MAX_DAYS_PER_WEEK][MAX_HOURS_PER_DAY]. In java there is no array declaration of list. please help.
I will thankful to you.
Quotehello.
Thanks for this. I want to make this scheduler in java. I want your help to making this code in java. Can you help in java. And please tell about QList<qint16> b[TEACHERS_FREE_PERIODS_N_CATEGORIES][MAX_DAYS_PER_WEEK][MAX_HOURS_PER_DAY]. In java there is no array declaration of list. please help.
I will thankful to you.
I have no time to convert FET to Java, and also the financial support for FET is very low (see http://lalescu.ro/liviu/fet/forum/index.php?topic=30.msg171#msg171)
About that array of lists: it is Volker's code. If you have a List class, then you must have available a possibility to make an array of this List class, even in Java.
Hello,
I thought about this project. It is desktop application. If this will be web based then you will earn more than here. You know every school and colleges are want there scheduling online. They can see it anywhere. May be this is the problem of your fet project. If you can spend more time for any other projects please give some time to it and make it web based project. I really thought your financial status will grow.
This is the online time table-->www.school-timetable.eu.
QuoteYou know every school and colleges are want there scheduling online. They can see it anywhere. May be this is the problem of your fet project.
That is not true. most schools i know don't want/need that.
The highliest missing thing is the recovery planning software. That is why we do that with programm "willi".
QuoteThis is the online time table-->www.school-timetable.eu.
That is highly critical.
Do you know data privacy law?
For example in NRW (germany) your tool will be nearly impossible to use, because of this rule:
http://www.schulministerium.nrw.de/BP/Lehrer/VODVII/#A_1
Did you care about that? For example that law say you must have an "AVD-Arbeitsplatz". One of the rules say, that the person that care about data privacy at our school must have access to the hardware and software database of the computer you use to store the data. You save the data somewhere in the world. So our person that care about data privacy has access into the house/computer of your webhoster to check if you care about data privacy correct? (so he must be able so go into the house and see the hardware!)
Okay !
Actually I don't know about privacy law. Thanks for this. Can you tell me in TimeTableGenerateForm.cpp. You are going to generate time table of all activities. That means you are calling all functions of generate.cpp generatepre.cpp and solution.cpp. I don't want to use Thread, just want simple functions like start and stop with run. And also tell me about timeTableviewTeachersForm.cpp. Is it getting data from any input file that you have store some where, or getting data from other sources.
Please help.
QuoteOkay !
Actually I don't know about privacy law. Thanks for this. Can you tell me in TimeTableGenerateForm.cpp. You are going to generate time table of all activities. That means you are calling all functions of generate.cpp generatepre.cpp and solution.cpp. I don't want to use Thread, just want simple functions like start and stop with run. And also tell me about timeTableviewTeachersForm.cpp. Is it getting data from any input file that you have store some where, or getting data from other sources.
Please help.
To generate without thread, see fet.cpp, command line version. You need to call Generate::generate with threaded=false.
Timetable view teachers uses a matrix, teachers timetable.
Yes,
You have used teachersTimeTable. But in your program there should be atleast declaration of teachersTimeTable matrix as rows and column.
QuoteYes,
You have used teachersTimeTable. But in your program there should be atleast declaration of teachersTimeTable matrix as rows and column.
There is teachers_timetable_weekly, search where it is declared.
Hello,
The timeTableGenerateForm.cpp is generating time table means. Is it setting each rows and column of matrix with respective data. Data means teachersTimeTable, subjectTimeTable, RoomsTimeTable, SectionTimeTable etc.
Is timetablegenerateForm.cpp main part of fet. why we use timetablegeneratemultipleform. cpp. Please help.
No, the part setting the timetable is in TimetableExport::getTeachersTimetable.
hello,
Please tell about detailActivity(teachersTimetableTable->currentRow(), teachersTimetableTable->currentColumn()); in timetableviewteachersform.cpp. Just tell teachersTimeTableTable->currentRow(), from where are you getting ?
In teachers_timetable_weekly is not working in this function.
hello,
Can you please tell one thing after clicking on generate new label in fet main form, which will generate the timetable. May be it can be teachersTimeTable, SubjectTimeTable, and roomTimetable. During this execution, is the fet storing or saving this generated data in any files.
please help. Then when we are using timeTableViewTeacherForm.cpp to display the data into table, we are getting data from there.
Please help.
Quotehello,
Please tell about detailActivity(teachersTimetableTable->currentRow(), teachersTimetableTable->currentColumn()); in timetableviewteachersform.cpp. Just tell teachersTimeTableTable->currentRow(), from where are you getting ?
In teachers_timetable_weekly is not working in this function.
I am getting this from gt.rules.internalActivitiesList, where the activity index is teachers_timetable_weekly[tch][d][h].
Quotehello,
Can you please tell one thing after clicking on generate new label in fet main form, which will generate the timetable. May be it can be teachersTimeTable, SubjectTimeTable, and roomTimetable. During this execution, is the fet storing or saving this generated data in any files.
please help. Then when we are using timeTableViewTeacherForm.cpp to display the data into table, we are getting data from there.
Please help.
The timetable is computed only if user presses "Stop" or the timetable is finished.
Yes it is.
But You are saving this timetable anywhere may be in directory or any xml file. If yes please tell.
Thanks
Manveer
QuoteYes it is.
But You are saving this timetable anywhere may be in directory or any xml file. If yes please tell.
Thanks
Manveer
I am saving it in timetableexport.cpp, function TimetableExport::writeSimulationResults().
Hello,
You said you are saving your data into timetableexport.cpp, function TimetableExport::writeSimulationResults(). But you are getting with data from solution.cpp class. In all operation you never used generatePre.cpp. but only one function from generate.cpp generate(INF, maxsecond, timeexceeded, threaded). Please explain it.
QuoteHello,
You said you are saving your data into timetableexport.cpp, function TimetableExport::writeSimulationResults(). But you are getting with data from solution.cpp class. In all operation you never used generatePre.cpp. but only one function from generate.cpp generate(INF, maxsecond, timeexceeded, threaded). Please explain it.
Generate modifies Solution. GeneratePre computes the arrays listed in the beginning of file generate_pre.cpp. generate.cpp has many functions, each one is used. generate(INF, max...) calls other functions from generate.cpp
Can you tell me,
How to save generate time table data into database. That data comes from solution.cpp. I don't want to use xml file to save time table data.
Please see timetableexport.cpp, writeSimulationResults(). If you want to save data+timetable not as XML, you have to see the Rules::write function.
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.
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.
Thank you,
Please tell me, what is going on these lines:
if(ai!=UNALLOCATED_ACTIVITY){
//Activity* act=gt.rules.activitiesList.at(ai);
Activity* act=>.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
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.
QuoteThank you,
Please tell me, what is going on these lines:
if(ai!=UNALLOCATED_ACTIVITY){
//Activity* act=gt.rules.activitiesList.at(ai);
Activity* act=>.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).
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).
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.
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.
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.
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"?
No,
It is usual code. But difficult to understand for each and every developer may be.
That's why I called it is typical.
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.
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.
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.
hello,
Can you please tell me ConstraintActivitiesNotOverlapping::ConstraintActivitiesNotOverlapping(double wp, int nact, const int act[])
: TimeConstraint(wp)
{
assert(nact>=2 && nact<=MAX_CONSTRAINT_ACTIVITIES_NOT_OVERLAPPING);
this->n_activities=nact;
for(int i=0; i<nact; i++)
this->activitiesId=act;
this->type=CONSTRAINT_ACTIVITIES_NOT_OVERLAPPING;
}
From where you are calling this above highlighted method. It is declare in timeconstraints.h class. you have use variables of this ConstraintActivitiesNotOverlapping class in generate_pre.cpp. so please help a bit more.
Thanks
Quotehello,
Can you please tell me ConstraintActivitiesNotOverlapping::ConstraintActivitiesNotOverlapping(double wp, int nact, const int act[])
: TimeConstraint(wp)
{
assert(nact>=2 && nact<=MAX_CONSTRAINT_ACTIVITIES_NOT_OVERLAPPING);
this->n_activities=nact;
for(int i=0; i<nact; i++)
this->activitiesId=act;
this->type=CONSTRAINT_ACTIVITIES_NOT_OVERLAPPING;
}
From where you are calling this above highlighted method. It is declare in timeconstraints.h class. you have use variables of this ConstraintActivitiesNotOverlapping class in generate_pre.cpp. so please help a bit more.
Thanks
I call it in Rules::read and in the interface, probably in addconstraintactivitiesnotoverlappingform.cpp.
QuoteHello 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.
I answerd this mail:
QuoteHello,
I thought about this project. It is desktop application. If this will be web based then you will earn more than here. You know every school and colleges are want there scheduling online. They can see it anywhere. May be this is the problem of your fet project. If you can spend more time for any other projects please give some time to it and make it web based project. I really thought your financial status will grow.
This is the online time table-->www.school-timetable.eu.
In my opinion it sound like you are an author of that software and want to implement the FET algorithm into that tool.
No,
No, It is totally different. I don't know who is the author of this web based project. I found it on surfing on web. It want to develop my own with your help with gpl. So please don't think about this.
Hello,
Can you please tell me what is going on timeConstraints.cpp and SpaceConstraints.cpp. I thought, in every constraint class you are getting data from xml file but which data. Is is raw material of timeTable or it is generated time table data. Please help a bit more.
Thanks a lot liviu for your precious time.
QuoteHello,
Can you please tell me what is going on timeConstraints.cpp and SpaceConstraints.cpp. I thought, in every constraint class you are getting data from xml file but which data. Is is raw material of timeTable or it is generated time table data. Please help a bit more.
Thanks a lot liviu for your precious time.
The data is read from disk or inputted by the user. See Rules::read section for constraints or each AddConstraint....cpp in interface directory.
Hello,
Yes it is reading data from disk or user inputted file. But this is not for time table. We have to generate first time table, which shows the output from this raw data to well formed time table data. Am I right.?
QuoteHello,
Yes it is reading data from disk or user inputted file. But this is not for time table. We have to generate first time table, which shows the output from this raw data to well formed time table data. Am I right.?
I don't understand.
ok,
Let me know about timeConstraints.cpp. What is the main moto of this class.?(what is the use of timeconstraints.cpp & spaceConstraints.cpp).
QuoteHello,
Yes it is reading data from disk or user inputted file. But this is not for time table. We have to generate first time table, which shows the output from this raw data to well formed time table data. Am I right.?
i think i understand:
yes, you are right; just try this sample:
open a sample file have a look at the FET->timetables. that will not work, because you didn't generate a timetable.
then generate a timetable. after that you can see it at FET-timetables.
the result is stored/saved in the results direcory.
close fet and open the generated timetable.
try to look in FET->timetables. that doesn't work because the timetable was not generated in memory (the timechromosome was not generated). so you need to generate the timetable first (that will be done this tme very fast, because the saved timetable constain many fixed time constraint for all activities), then you can have a look at the timetable.
so for example also the timetableexport.cpp work only if you done generate.cpp before!
please check this sample and maybe also "kdiff3" the original sample file with the saved generated fet file in the result directory to understand better.
for(int j=0; j<gt.rules.nInternalActivities; j++){
minNDaysListOfActivities[j].clear();
minNDaysListOfMinDays[j].clear();
minNDaysListOfConsecutiveIfSameDay[j].clear();
minNDaysListOfWeightPercentages[j].clear();
}
Hello,
Can you tell me this is List. And you are using this minNDaysListOfActivities list as array. How can i use it. I have simple List now list Array. Can I use it like it:
minNDaysListOfActivities.get(j);
minNDaysListOfActivities.clear();
if you have only a simple list and not a list array, then i think you can translate it into a 2 diminsional array.
so instead of
minNDaysListOfActivities[nInternalActivities]
you can do same with:
minNDaysActivities[nInternalActivities][nInternalActivities]
but of course that has disadvantages:
- you need more memory
- you need to add later a check if that value is needed -> so your algorithm (generating the timetable) will slow down very much.
so i don't recommend this even it is possible.
if java don't know array list, you should think about coding that yourself.
Hello,
Please can you explain it->
for(int j=0; j<sst._n_activities; j++){
int ai1=sst._activities[j];
for(int k=0; k<sst._n_activities; k++){
int ai2=sst._activities[k];
if(ai1!=ai2){
int t=activitiesSameStartingTimeActivities[ai1].indexOf(ai2);
double perc=-1;
if(t!=-1){
perc=activitiesSameStartingTimePercentages[ai1].at(t);
assert(perc>=0 && perc<=100);
}
if(t==-1 /*|| perc<sst.weightPercentage*/){
activitiesSameStartingTimeActivities[ai1].append(ai2);
activitiesSameStartingTimePercentages[ai1].append(sst.weightPercentage);
assert(activitiesSameStartingTimeActivities[ai1].count()==activitiesSameStartingTimePercentages[ai1].count());
}
else if(t>=0 && perc<sst.weightPercentage){
activitiesSameStartingTimePercentages[ai1][t]=sst.weightPercentage;
}
}
}
}
Is it right, the above highlighted lines shows appending new object into this list at specified position or some thing else.
Please help.
Read Qt documentation, qt.nokia.com/doc/, class QList, functions append(...) and indexOf(...).
hello,
I have read QList but don't understand QList<int> activitiesSameStartingTimeActivities[MAX_ACTIVITIES];. Please tell about it. In java When we declare List, we use List<Integer> activitiesSameStartingTimeActivities = new List<Integer>(MAX_ACTIVITIES);. Can you explain it a little bit more. I really thankful to you.
Quotehello,
I have read QList but don't understand QList<int> activitiesSameStartingTimeActivities[MAX_ACTIVITIES];. Please tell about it. In java When we declare List, we use List<Integer> activitiesSameStartingTimeActivities = new List<Integer>(MAX_ACTIVITIES);. Can you explain it a little bit more. I really thankful to you.
QList<int> assta[MAX_ACTIVITIES] means an array with dimension MAX_ACTIVITIES, where each value assta
is a QList<int>. We have an array for each activity, with a list of same starting time activities. This is a C++ matter, you can find it in C++ documentation, probably.
Hello,
Can you please help a bit more. In TimeConstraints.cpp, You are using every class with thier methods. like computeInternalStructure(rules r), and isRelatedToTeacher(Teacher t), Where Teacher is one seperate class. Can you tell me from where you are calling these methods to pass values in thier arguments? please help.
QuoteHello,
Can you please help a bit more. In TimeConstraints.cpp, You are using every class with thier methods. like computeInternalStructure(rules r), and isRelatedToTeacher(Teacher t), Where Teacher is one seperate class. Can you tell me from where you are calling these methods to pass values in thier arguments? please help.
TimeConstraint::computeInternalStructure is called from Rules::computeInternalStructure, for each constraint. TimeConstraint::isRelatedToTeacher is called from Teacher::getDetailedDescriptionWithConstraints, for each constraint. If constraint is related, the description of the teacher will have this constraint attached (in teachers dialog).
Hello,
Can you please tell me about it ->class StudentsYear;
class StudentsGroup;
class StudentsSubgroup;
class Rules;. You have declare these classes in studentsSet.h. What does mean by these classes. You use class StudentsGroup. Please tell about solution.cpp. What will it do ? please explain a little bit more. I will thankful to you.
Thanks a lot for helping me.
hello,
You said you are using Teacher::getDetailsDescription(), reads the constraints, which is alloted to teacher. But You are also using Rules.cpp class with reading all constraints like this->TimeConstraint* Rules::readBasicCompulsoryTime(const QDomElement& elem3, QString& xmlReadingLog. Can you tell me, What is going in this function? Please help a bit more.
Hello Man,
Can you help me little bit more. Can you tell me what is use of assert in c++. Please reply. I really want your help. Thanks a lot for helping me.
QuoteHello Man,
Can you help me little bit more. Can you tell me what is use of assert in c++. Please reply. I really want your help. Thanks a lot for helping me.
It is a C++ function, read about it on the internet
Quotehello,
You said you are using Teacher::getDetailsDescription(), reads the constraints, which is alloted to teacher. But You are also using Rules.cpp class with reading all constraints like this->TimeConstraint* Rules::readBasicCompulsoryTime(const QDomElement& elem3, QString& xmlReadingLog. Can you tell me, What is going in this function? Please help a bit more.
I just read from the hard disk the constraint
And Please also tell about this question-->
Hello,
Can you please tell me about it ->class StudentsYear;
class StudentsGroup;
class StudentsSubgroup;
class Rules;. You have declare these classes in studentsSet.h. What does mean by these classes. You use class StudentsGroup. Please tell about solution.cpp. What will it do ? please explain a little bit more. I will thankful to you.
Thanks a lot for helping me.
QuoteAnd Please also tell about this question-->
Hello,
Can you please tell me about it ->class StudentsYear;
class StudentsGroup;
class StudentsSubgroup;
class Rules;. You have declare these classes in studentsSet.h. What does mean by these classes. You use class StudentsGroup. Please tell about solution.cpp. What will it do ? please explain a little bit more. I will thankful to you.
Thanks a lot for helping me.
StudentsYear, S...Grou and S...Subgroup are subclasses of StudentsSet. They define like in FET - years, groups, subgroups. Solution is a class to keep a solution-> an array of times and rooms for each activity.
Hello,
Can you please tell me, from where you are getting data for activity.(Which function is used for get data of one single activitiy). The Activity can be-> Act:T:John, s:Call, ST:PreInt, F/T, Id:13,d:1, A:yes. This is one complete activity. Can you tell me from where you are getting it. When are going to make one new time table, there is no input file of xml or .fet file. Please tell, Actually I dind't understand the getXmlDescription in Activity.cpp class. Please help.
QuoteHello,
Can you please tell me, from where you are getting data for activity.(Which function is used for get data of one single activitiy). The Activity can be-> Act:T:John, s:Call, ST:PreInt, F/T, Id:13,d:1, A:yes. This is one complete activity. Can you tell me from where you are getting it. When are going to make one new time table, there is no input file of xml or .fet file. Please tell, Actually I dind't understand the getXmlDescription in Activity.cpp class. Please help.
interface/addactivityform.cpp
Hello,
I am working on your fet gui version. There is a problem occurred during adding activities. When I am selecting multiple teachers, and multiple classes but not multiple subjects and activity tag. Then It shows me one message activity added. When I am generating time Table. It shows three teachers taking one class at same time.
QuoteHello,
I am working on your fet gui version. There is a problem occurred during adding activities. When I am selecting multiple teachers, and multiple classes but not multiple subjects and activity tag. Then It shows me one message activity added. When I am generating time Table. It shows three teachers taking one class at same time.
Yes, of course, that is the normal behavior (the behavior me and other users want).
hello,
Can you tell me one thing. I really need it I will donate for this particular, but with database connectivity. and in java without any xml file. And please please tell me one thing, this code can't convert into java. Because of memory allocation if you can made your algorithm in java with one suitable activity entry as Teacher-A, teachs-8th-a, english, with activities_preferred_starting_time on 8:00 Am on monday and then store this activity in database. Please help and give a suitable example. Thanks for helping me.
Quotehello,
Can you tell me one thing. I really need it I will donate for this particular, but with database connectivity. and in java without any xml file. And please please tell me one thing, this code can't convert into java. Because of memory allocation if you can made your algorithm in java with one suitable activity entry as Teacher-A, teachs-8th-a, english, with activities_preferred_starting_time on 8:00 Am on monday and then store this activity in database. Please help and give a suitable example. Thanks for helping me.
I am not sure I understand everything from your request.
I think I cannot do that. It is very complicated and tedious. I like challenges, to create new algorithms, not to convert existing ones.
Maybe you could use the command line version of FET, why don't you like that?
Hello,
I want to use this program in my web page, that's why I am asking for that. I can't use c++ program in web page. So this is the problem. I can't convert this code into java. I am getting many errors and the most one is memory problem like heap space with these arrays. I can't use this program as command line. If you can take a new challenge then please do it for me in java. That will use database connectivity. If you can then please help me.
i guess your request need around 1/2 year of coding (coding with a full time job!) if you skill is very good in java, database and fet. Per item your skill is not very good, i guess you need 1/2 year more for this work.
Like i wrote in previous mail your request is very critical (not allowed by german law). Also your request has very low priority, there are several much more needed features and i currently can't implement them, because i already spend nearly my whole spare time into this project.
Maybe spent yourself time and code it.
if you can't do that maybe search a guy that you can pay for this work. so if you find a good skilled java and database coder, he just need read fet source and so i guess he need around 1 year to code it. so what do you think how much that guy need to pay his live (hire (flat), food, electricity bill, water bill, tax, ...). can you pay a guy for one year?
QuoteHello,
I want to use this program in my web page, that's why I am asking for that. I can't use c++ program in web page. So this is the problem. I can't convert this code into java. I am getting many errors and the most one is memory problem like heap space with these arrays. I can't use this program as command line. If you can take a new challenge then please do it for me in java. That will use database connectivity. If you can then please help me.
I am sorry, but I can only help with advice. You need to learn a bit more C++ /experiment with it to think how to avoid memory allocation problems.