FET WITH JAVA

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

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Liviu Lalescu

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.

it.manveer.singh

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

Liviu Lalescu

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.

it.manveer.singh

hello,
Please tell me which file makes table with limited rows and columns.

it.manveer.singh

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

Liviu Lalescu

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).

it.manveer.singh

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

Liviu Lalescu

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.

it.manveer.singh

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.

Liviu Lalescu

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].

it.manveer.singh

#25
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.

Liviu Lalescu

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.

it.manveer.singh

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

Liviu Lalescu

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.

it.manveer.singh

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.