Changeset 211


Ignore:
Timestamp:
02/24/10 14:17:53 (14 years ago)
Author:
bernard
Message:

generation of the hidden file then directly fill the theOrderTable vector

Location:
trunk/yao/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/Translator.cpp

    r209 r211  
    202202 
    203203   Order  myOrder(&theConnectionTable, &theModulTable, &theSpaceTable, &theOperatorTable); 
    204    myOrder.automaticOrderGenerator(projectName); 
     204   myOrder.automaticOrderGenerator(projectName, theOrderTable); 
    205205 
    206206  // End Translator 
  • trunk/yao/src/YAOObjects/Order.cpp

    r209 r211  
    596596 
    597597 
    598 void Order::automaticOrderGenerator(string projectName) { 
     598void Order::automaticOrderGenerator(string projectName, Table<Order>& theOrderTable) { 
     599 
     600        // As the orderTable should be empty (because the generator is called), this clearing is just relevant in the testing phase  
     601        // ------------------------------------------------------------------------------------------------------------------------  
     602  
     603        theOrderTable.clear();  
     604 
     605        // OBJ Order myOrder(1); 
     606 
     607        // Add a dot to the project name to hide the file 
     608        // ----------------------------------------------- 
    599609 
    600610        theProject = "." + projectName; 
     611 
     612        // Create a output file stream object 
     613        // ---------------------------------- 
    601614         
    602615        ofstream hiddenFile; 
     616         
     617        // Open and close the hidden file without append flag : delete the former hidden file if the project already have one (it should exist some more dedicated functions) 
     618        // ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
    603619 
    604620        hiddenFile.open(theProject.c_str()); 
     
    819835                                // ------------------------ 
    820836 
    821                                 // ofstream hiddenFile;  
    822  
    823837                                hiddenFile.open(theProject.c_str(), ios::app); 
    824838 
    825                                 cout << endl << endl << "order modinspace " << spaceName << endl; 
    826          
    827839                                hiddenFile << endl << endl << "order modinspace " << spaceName << endl; 
    828                          
    829                                 hiddenFile.close();  
    830  
     840 
     841                                hiddenFile.close(); 
     842 
     843 
     844                                // OBJ myOrder.setOrderPhase(1); 
     845                                // OBJ myOrder.setName(spaceName); 
     846                                // OBJ myOrder.orderTokens.clear(); 
     847 
     848                                // OBJ myOrderTokens.clear(); 
     849 
     850 
     851                                // The current object pointer is used here (more convenient) but it will maybe not be available when the function will be static 
     852                                // -----------------------------------------------------------------------------------------------------------------------------         
     853 
     854                                // Set the current phase (here for a modinspace) 
     855                                // --------------------------------------------- 
     856 
     857                                this -> setOrderPhase(1); 
     858                                 
     859                                // Set the current space name 
     860                                // -------------------------- 
     861 
     862                                this -> setName(spaceName);  
     863 
     864                                // Reset the orderTokens string vector 
     865                                // ----------------------------------- 
     866 
     867                                this -> orderTokens.clear(); 
    831868 
    832869                                // Dedicated light structures that will be used to create the main graph then populate its properties  
     
    10231060                                }  
    10241061                         
    1025                                 cout << endl << "forder"; 
    1026  
    10271062                                hiddenFile.open(theProject.c_str(), ios::app); 
    10281063 
     1064                                // Close the current modinspace statement 
     1065                                // -------------------------------------- 
     1066 
    10291067                                hiddenFile << endl << "forder"; 
    10301068 
    10311069                                hiddenFile.close(); 
     1070 
     1071                                // Insert in the order Table the current Order (which contain all informations on the current modinspace) 
     1072                                // ------------------------------------------------------------------------------------------------------ 
     1073 
     1074                                theOrderTable.push_back(*this); 
     1075 
    10321076                        } 
    10331077                } 
     
    10471091        for(int noTraj = 0; noTraj < trajOrder.size(); noTraj++) { 
    10481092 
    1049                 cout << endl << endl << "order spaceintraj " << trajOrder[noTraj].second << endl << endl << "\t"; 
    1050          
    10511093                ofstream hiddenFile; 
    10521094 
     
    10541096 
    10551097                hiddenFile << endl << endl << "order spaceintraj " << trajOrder[noTraj].second << endl << endl << "\t"; 
     1098 
     1099                // OBJ myOrder.setOrderPhase(2); 
     1100                // OBJ myOrder.setName(trajOrder[noTraj].second); 
     1101                // OBJ myOrder.orderTokens.clear(); 
     1102                // OBJ myOrderTokens.clear(); 
     1103 
     1104                // Set the current phase (which is a spacintraj here) 
     1105                // -------------------------------------------------- 
     1106 
     1107                this -> setOrderPhase(2);  
     1108 
     1109                // Set the trajectory name 
     1110                // ----------------------- 
     1111 
     1112                this -> setName(trajOrder[noTraj].second);  
     1113 
     1114                // Clear the orderTokens vector of string  
     1115                // -------------------------------------- 
     1116 
     1117                this -> orderTokens.clear(); 
     1118 
    10561119 
    10571120                // For all the space numbers  
     
    10731136                                        // ----------------------------------------- 
    10741137 
    1075                                         cout << trajMap.find(spacesList[noTopo]) -> first << " "; 
    1076          
    10771138                                        hiddenFile << trajMap.find(spacesList[noTopo]) -> first << " "; 
     1139 
     1140                                        // OBJ myOrderTokens.push_back(trajMap.find(spacesList[noTopo]) -> first); 
     1141 
     1142                                        // Insert the current trajectory name in the order tokens vector   
     1143                                        // ------------------------------------------------------------- 
     1144 
     1145                                        this -> orderTokens.push_back(trajMap.find(spacesList[noTopo]) -> first); 
    10781146                        } 
    10791147                } 
     
    10831151        // --------------------------------------- 
    10841152 
    1085         cout << endl << endl <<  "forder"; 
    1086  
    10871153        hiddenFile << endl << endl <<  "forder"; 
    10881154 
    10891155        hiddenFile.close(); 
    10901156 
     1157        // Insert in the Order table the current Order (which contain all informations on the current spaceintraj) 
     1158        // -------------------------------------------------------------------------------------------------------  
     1159 
     1160        theOrderTable.push_back(*this); 
     1161 
    10911162        } 
    10921163 
     1164        // Just for tests (look at the Order Table at the end of the generation) 
     1165        // --------------------------------------------------------------------- 
     1166         
     1167        showTokens(theOrderTable); 
    10931168 
    10941169}; 
     
    11891264void Order::showOuter() { 
    11901265 
    1191         cout << endl << "PROTOTYPE : outerComp[noComp3D]" << endl; 
    1192  
    11931266        // For all 3D component embedded in the vector outerComp 
    11941267        // ----------------------------------------------------- 
     
    12111284void Order::showInner(int noFixed1, int noFixed2, int freeDim) { 
    12121285 
    1213         // ***** cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl; 
    1214  
    12151286        //  For all 3D component embedded in the vector outerComp 
    12161287        // ------------------------------------------------------ 
     
    12431314 
    12441315cout << endl; 
    1245 /* 
    1246  
    1247  Dim1 : " << 
    1248                             innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << " , second : " << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second; 
    1249  
    1250 */ 
    1251  
    1252 /* 
    1253         cout << endl; 
    1254  
    1255                                 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) { 
    1256  
    1257                                         int noModd = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]; 
    1258  
    1259                                         cout << endl << "NO MOD : " <<  noModd; 
    1260  
    1261                                         cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "].embeddedModuls[" << noMod << "] : " 
    1262                                              << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]); 
    1263  
    1264                                 } 
    1265  
    1266                         cout << endl; 
    1267  
    1268                         ******/ 
    12691316 
    12701317                        } 
     
    20872134                                // ------------------------------------------------------------------------------------------------------- 
    20882135 
    2089                                 if(noParam == 3) { cout << endl << endl << "\t\tforder"; hiddenFile << endl << endl << "\t\tforder"; } 
     2136                                if(noParam == 3) hiddenFile << endl << endl << "\t\tforder";  
    20902137 
    20912138                                // If the current level is the second one, it means the order have to be closed with one tabulation offset 
    20922139                                // ------------------------------------------------------------------------------------------------------- 
    20932140 
    2094                                 if(noParam == 2) { cout << endl << endl << "\tforder"; hiddenFile << endl << endl << "\tforder"; } 
     2141                                if(noParam == 2) hiddenFile << endl << endl << "\tforder"; 
    20952142 
    20962143                                // If the current level is the first one, it means the order have to be closed without tabulation offset  
    20972144                                // ----------------------------------------------------------------------------------------------------- 
    20982145 
    2099                                 if(noParam == 1) { cout << endl << endl << "forder"; hiddenFile << endl << endl << "forder"; } 
     2146                                if(noParam == 1) hiddenFile << endl << endl << "forder";  
     2147 
     2148                                this -> orderTokens.push_back("forder"); 
     2149 
    21002150                        break; 
    21012151 
     
    21082158                                // --------------------------------------------------------------------------------------------------------------------------------------- 
    21092159 
    2110                                 if(noParam == 2) { cout << endl << endl << "\t\tforder" << endl << "\tforder"; hiddenFile <<  endl << endl << "\t\tforder" << endl << "\tforder"; } 
     2160                                if(noParam == 2) hiddenFile <<  endl << endl << "\t\tforder" << endl << "\tforder";   
     2161                                                 
    21112162 
    21122163                                // If the current parameter is the first one, the order statement  have to be closed with one tabulation offset then no offset 
    21132164                                // --------------------------------------------------------------------------------------------------------------------------- 
    21142165 
    2115                                 if(noParam == 1) { cout << endl << endl << "\tforder" << endl << "forder"; hiddenFile << endl << endl << "\tforder" << endl << "forder"; } 
     2166                                if(noParam == 1) hiddenFile << endl << endl << "\tforder" << endl << "forder";  
     2167 
     2168                                this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); 
     2169 
     2170                                // OBJ myOrderTokens.push_back("forder"); myOrderTokens.push_back("forder");                     
     2171 
    21162172                        break; 
    21172173 
     
    21242180                                // ---------------------------------------------------------------------------------------------------------------------------------------- 
    21252181 
    2126                                 cout << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder"; 
    2127  
    21282182                                hiddenFile << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder"; 
     2183 
     2184                                this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); 
     2185 
     2186                                // OBJ myOrderTokens.push_back("forder"); myOrderTokens.push_back("forder");  myOrderTokens.push_back("forder"); 
    21292187 
    21302188                        break; 
     
    21412199                        // ------------------------------------------------------- 
    21422200 
    2143                         case 1: cout << endl << endl; hiddenFile << endl << endl; break;  
     2201                        case 1: hiddenFile << endl << endl; break;  
    21442202 
    21452203                        // If the parameter is the second, then one offset is needed 
    21462204                        // --------------------------------------------------------- 
    21472205 
    2148                         case 2: cout << endl << endl << "\t"; hiddenFile << endl << endl << "\t"; break;  
     2206                        case 2: hiddenFile << endl << endl << "\t"; break;  
    21492207 
    21502208                        // If the parameter is the third, then two offsets are needed 
    21512209                        // ---------------------------------------------------------- 
    21522210 
    2153                         case 3: cout << endl << endl << "\t\t"; hiddenFile << endl << endl << "\t\t"; break; 
     2211                        case 3: hiddenFile << endl << endl << "\t\t"; break; 
    21542212                        } 
    21552213 
     
    21572215        // ------------------------------------------------------- 
    21582216 
     2217        stringstream valParam;   
     2218         
     2219        this -> orderTokens.push_back("order"); 
     2220 
    21592221        switch(valAxis) { 
    21602222 
     
    21622224                        // ------------------------------------------------------------------------------------------------------------ 
    21632225 
    2164                         case  0: cout << "order " << "\t" << "Y." << noAxis + 1; hiddenFile << "order " << "\t" << "Y." << noAxis + 1; break; 
     2226                        case  0: hiddenFile << "order " << "\t" << "Y." << noAxis + 1; valParam << "YA"; break; 
    21652227 
    21662228                        // If the axis value is set to 3 (no edges), then the dimension can be crossed both way (free) 
    21672229                        // ------------------------------------------------------------------------------------------- 
    21682230 
    2169                         case  3: cout << "order " << "\t" << "Y." << noAxis + 1; hiddenFile << "order " << "\t" << "Y." << noAxis + 1; break; 
     2231                        case  3: hiddenFile << "order " << "\t" << "Y." << noAxis + 1; valParam << "YA"; break; 
    21702232 
    21712233                        // If the axis value is set to -1, then the dimension must be crossed increasingly  
    21722234                        // ------------------------------------------------------------------------------- 
    21732235 
    2174                         case -1: cout << "order " << "\t" << "YA" << noAxis + 1; hiddenFile << "order " << "\t" << "YA" << noAxis + 1; break; 
     2236                        case -1: hiddenFile << "order " << "\t" << "YA" << noAxis + 1; valParam << "YA"; break; 
    21752237 
    21762238                        // If the axis value is set to +1, then the dimension must be crossed decreasingly 
    21772239                        // ------------------------------------------------------------------------------- 
    21782240 
    2179                         case  1: cout << "order " << "\t" << "YB" << noAxis + 1; hiddenFile << "order " << "\t" << "YB" << noAxis + 1; break; 
     2241                        case  1: hiddenFile << "order " << "\t" << "YB" << noAxis + 1; valParam << "YB"; break; 
    21802242 
    21812243                        // If the axis value is set to 2 (no common value), then the dimension can be crossed both way (free) 
    21822244                        // -------------------------------------------------------------------------------------------------- 
    21832245 
    2184                         case  2: cout << "order " << "\t" << "Y." << noAxis + 1; hiddenFile << "order " << "\t" << "Y." << noAxis + 1; break;        // A VOIR !!!! 
     2246                        case  2: hiddenFile << "order " << "\t" << "Y." << noAxis + 1; valParam << "YA"; break; // A VOIR !!!! 
    21852247                        } 
     2248 
     2249                        valParam << noAxis + 1;  
     2250 
     2251                        this -> orderTokens.push_back(valParam.str()); 
     2252 
     2253                        // OBJ myOrderTokens.push_back("order"); 
     2254                        // OBJ myOrderTokens.push_back(valParam.str());  
    21862255} 
    21872256 
     
    21942263        // --------------------------------------------------------------------------------------------------------------------------------- 
    21952264 
    2196         if(lastParam == 3) { cout       << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder" << endl << endl; 
    2197                             hiddenFile  << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder" << endl << endl; } 
     2265        if(lastParam == 3) {    hiddenFile  << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder" << endl << endl;  
     2266 
     2267                                this -> orderTokens.push_back("forder");  this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); }                     
     2268                 
     2269                                // OBJ myOrderTokens.push_back("forder"); myOrderTokens.push_back("forder"); myOrderTokens.push_back("forder"); } 
    21982270 
    21992271        // If the last parameter was the second in the order statement, then two parameters have to be closed (one for each open parameter) 
    22002272        // -------------------------------------------------------------------------------------------------------------------------------- 
    22012273 
    2202         if(lastParam == 2) { cout       << endl << endl << "\tforder" << endl << "forder" << endl << endl; 
    2203                              hiddenFile << endl << endl << "\tforder" << endl << "forder" << endl << endl; } 
     2274        if(lastParam == 2) {    hiddenFile << endl << endl << "\tforder" << endl << "forder" << endl << endl; 
     2275         
     2276                                this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); } 
     2277         
     2278                                // OBJ myOrderTokens.push_back("forder"); myOrderTokens.push_back("forder"); } 
    22042279 
    22052280        // If the last parameter was the first in the order statement, then one parameter have to be closed  
    22062281        // ------------------------------------------------------------------------------------------------ 
    22072282 
    2208         if(lastParam == 1) { cout       << endl << endl << "forder" << endl << endl; 
    2209                              hiddenFile << endl << endl << "forder" << endl << endl; } 
     2283        if(lastParam == 1) { hiddenFile << endl << endl << "forder" << endl << endl; this -> orderTokens.push_back("forder"); } // OBJ myOrderTokens.push_back("forder"); } 
     2284 
    22102285 
    22112286        // Reset the lastParam static value to avoid a closing order at the beginning of the next order statement 
     
    27452820                        for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][1].size(); noComp1D++)  { 
    27462821 
    2747                                 // Getting the value of the third axis (no need to get the number of the axis as there is only one) 
    2748                                 // ------------------------------------------------------------------------------------------------      
     2822                                // Get the value of the first axis (third in the data structure as it is a 3D data structure, no need to get the number of the axis as there is only one) 
     2823                                // ------------------------------------------------------------------------------------------------------------------------------------------------------      
    27492824 
    27502825                                int valAxis1 = innerComp[noComp3D][0][noComp2D][1][noComp1D].cfcSign[0].second; 
     
    27572832                                hiddenFile.open(theProject.c_str(), ios::app); 
    27582833 
    2759                                 cout << endl << endl << "\t\t"; 
    2760  
    27612834                                hiddenFile << endl << endl << "\t\t"; 
    27622835 
     
    27692842                                        // --------------------------------------- 
    27702843 
    2771                                         cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod]) << " "; 
    2772          
    27732844                                        hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod]) << " "; 
     2845 
     2846                                        this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod])); 
     2847 
     2848                                        // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod])); 
    27742849 
    27752850                                } 
     
    27932868        ofstream hiddenFile; 
    27942869 
    2795         // For all 3D component in the main graph 
     2870        // For all 3D components in the main graph 
     2871        // ---------------------------------------- 
    27962872 
    27972873        for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 
    27982874 
    27992875                // For all components in the 2D graph coming from the current 3D component with the first axis fixed   
     2876                // ------------------------------------------------------------------------------------------------- 
    28002877 
    28012878                for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++)  { 
    28022879 
    2803                         // Get the the the second axis dimension  
     2880                        // Get the the the first axis dimension (second in the data structure as it is a 3D data structure) 
     2881                        // ------------------------------------------------------------------------------------------------ 
    28042882 
    28052883                        int noFixed1  = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 
    28062884 
    2807                         // Get the second axis value  
     2885                        // Get the first axis value (second in the data structure as it is a 3D data structure) 
     2886                        // ------------------------------------------------------------------------------------ 
    28082887 
    28092888                        int valFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].second; 
    28102889         
    2811                         // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 
     2890                        // Read the order parameter for this dimension and this axis (decrease the axis dimension number as it is just the first parameter) 
     2891                        // -------------------------------------------------------------------------------------------------------------------------------- 
    28122892 
    28132893                        readParam(noFixed1 -1, valFixed1, 1); 
    28142894                 
    2815                         cout << endl << endl << "\t\t"; 
    2816          
    28172895                        hiddenFile.open(theProject.c_str(), ios::app); 
    28182896         
     
    28212899                        hiddenFile.close(); 
    28222900         
    2823                         // Get the third axis dimension  
     2901                        // Get the second axis dimension (third in the data structure as it is a 3D data structure) 
     2902                        // ---------------------------------------------------------------------------------------- 
    28242903 
    28252904                        int noAxis2  = middleComp[noComp3D][0][noComp2D].cfcSign[1].first; 
    28262905 
    2827                         // Get the third axis value  
     2906                        // Get the second axis value (third in the data structure as it is a 3D data structure) 
     2907                        // ------------------------------------------------------------------------------------ 
    28282908 
    28292909                        int valAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].second; 
    28302910 
    2831                         // If the third axis value is defined  
     2911                        // If the second axis value is defined  
     2912                        // ----------------------------------- 
    28322913 
    28332914                        if(valAxis2 != 2) { 
    28342915 
    28352916                                // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 
     2917                                // ---------------------------------------------------------------------------------------------------------------------------- 
    28362918 
    28372919                                readParam(noAxis2 -1, valAxis2, 2); 
    28382920         
    2839                                 cout << endl << endl << "\t\t"; 
    2840          
    28412921                                hiddenFile.open(theProject.c_str(), ios::app); 
    28422922 
    28432923                                hiddenFile << endl << endl << "\t\t"; 
    28442924         
    2845                                 // hiddenFile.close(); 
    2846  
    2847                                 // For all components in the 1D graph coming from the current 2D component with the two first axis fixed 
     2925                                // For all components in the 1D graph coming from the current 2D component with the two first axis fixed  
     2926                                // ----------------------------------------------------------------------------------------------------- 
    28482927 
    28492928                                for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 
    28502929 
    28512930                                        // For all the moduls embedded in the current 1D component  
     2931                                        // -------------------------------------------------------       
    28522932 
    28532933                                        for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 
    28542934 
    2855                                                 // Insert the modul name  in the current order parameter  
    2856  
    2857                                                 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    2858          
    2859                                                 // hiddenFile.open(".myHidden", ios::app); 
    2860          
     2935                                                // Insert the modul name in the current order parameter  
     2936                                                // ---------------------------------------------------- 
     2937 
    28612938                                                hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    2862          
    2863                                                 // hiddenFile.close(); 
     2939                                         
     2940                                                this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]));   
     2941                                                 
     2942                                                // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]));  
    28642943         
    28652944                                        } 
     
    28702949                        }  
    28712950 
    2872                         //  If the third axis value is not defined 
     2951                        // If the second axis value is not defined 
     2952                        // --------------------------------------- 
    28732953 
    28742954                        else { 
    28752955         
    2876                                 // ***** noAxis2  = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 
    2877  
    2878                                 // For all  components in the 1D graph coming from the current 2D component with the first axis fixed  
     2956                                // For all components in the 1D graph coming from the current 2D component with the first axis fixed  
     2957                                // ------------------------------------------------------------------------------------------------- 
    28792958                         
    28802959                                for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 
    28812960 
    2882                                         // Get the third axis dimension 
     2961                                        // Get the second axis dimension (third in the data structure as it is a 3D data structure) 
     2962                                        // ---------------------------------------------------------------------------------------- 
    28832963 
    28842964                                        int noAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 
    28852965 
    2886                                         // Get the third axis value 
     2966                                        // Get the second axis value (third in the data structure as it is a 3D data structure) 
     2967                                        // ------------------------------------------------------------------------------------ 
    28872968                                
    28882969                                        int valAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 
    28892970 
    28902971                                        // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 
     2972                                        // ---------------------------------------------------------------------------------------------------------------------------- 
    28912973                                
    28922974                                        readParam(noAxis3 -1, valAxis3, 2); 
    28932975 
    2894                                         cout << endl << endl << "\t\t"; 
    2895          
    28962976                                        hiddenFile.open(theProject.c_str(), ios::app); 
    28972977 
    28982978                                        hiddenFile << endl << endl << "\t\t"; 
    28992979 
    2900                                         // hiddenFile.close(); 
    2901          
    29022980                                        // For all the moduls embedded in the current 1D component 
     2981                                        // ------------------------------------------------------- 
    29032982                                
    29042983                                        for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 
    29052984         
    2906                                                 // Insert the modul name  in the current order parameter         
     2985                                                // Insert the modul name in the current order parameter  
     2986                                                // ---------------------------------------------------- 
    29072987                                         
    2908                                                 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    2909          
    2910                                                 // hiddenFile.open(".myHidden", ios::app); 
    2911          
    29122988                                                hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    2913          
    2914                                                 // hiddenFile.close(); 
     2989 
     2990                                                this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
     2991                                                 
     2992                                                // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
     2993         
    29152994                                        } 
    29162995 
     
    29223001         
    29233002        // Close the order statement  
     3003        // ------------------------- 
    29243004 
    29253005        readParam(0, 0, 0); 
     
    29813061                                hiddenFile.open(theProject.c_str(), ios::app); 
    29823062 
    2983                                 cout << endl << endl << "\t\t\t"; 
    2984          
    29853063                                hiddenFile << endl << endl << "\t\t\t"; 
    29863064 
     
    30083086                                                        // -----------------------------------------------------------------------------------------------       
    30093087 
    3010                                                         cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    3011          
    30123088                                                        hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
     3089 
     3090                                        this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
     3091                                         
     3092                                         // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
     3093 
    30133094                                                } 
    30143095                                        } 
     
    30553136                                        hiddenFile.open(theProject.c_str(), ios::app); 
    30563137 
    3057                                         cout << endl << endl << "\t\t\t"; 
    3058  
    30593138                                        hiddenFile << endl << endl << "\t\t\t"; 
    30603139 
     
    30673146                                                // ----------------------------------------------------------------------------------------------- 
    30683147 
    3069                                                 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    3070          
    30713148                                                hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
     3149 
     3150                                                this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]));    
     3151 
     3152                                                // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
    30723153 
    30733154                                        } 
     
    31333214                                        hiddenFile.open(theProject.c_str(), ios::app); 
    31343215 
    3135                                         cout << endl << endl << "\t\t\t"; 
    3136  
    31373216                                        hiddenFile << endl << endl << "\t\t\t"; 
    31383217 
     
    31503229                                                        // ------------------------------------------------------------------------------------------------- 
    31513230 
    3152                                                         cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    3153          
    31543231                                                        hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
     3232 
     3233                                                this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
     3234          
     3235                                                // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
    31553236 
    31563237                                                } 
     
    31873268                                                hiddenFile.open(theProject.c_str(), ios::app);   
    31883269 
    3189                                                 cout << endl << endl << "\t\t\t"; 
    3190  
    31913270                                                hiddenFile << endl << endl << "\t\t\t"; 
    31923271 
     
    31993278                                                        // ------------------------------------------------------------------------------------------------- 
    32003279 
    3201                                                         cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
    3202          
    32033280                                                        hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 
     3281 
     3282                                                this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
     3283 
     3284                                                // OBJ myOrderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 
    32043285 
    32053286                                                } 
     
    34923573 
    34933574 
     3575void Order::showTokens(Table<Order>&  theOrderTable) { 
     3576        for(Table<Order>::iterator tok_tab = theOrderTable.begin(); tok_tab < theOrderTable.end(); tok_tab++) {      
     3577          
     3578                cout << endl << tok_tab -> getName();  
     3579                cout << endl << tok_tab -> getOrderPhase(); 
     3580                                                     
     3581                for(vector<string>::iterator tok_str = tok_tab -> orderTokens.begin(); tok_str < tok_tab -> orderTokens.end(); tok_str++) {  
     3582                        cout << endl << "\t" << *tok_str; 
     3583                } 
     3584        } 
     3585}; 
     3586 
     3587 
     3588 
    34943589 
    34953590 
    34963591//-----------------CB--------------------- 
    34973592 
     3593 
  • trunk/yao/src/YAOObjects/Order.hpp

    r209 r211  
    3737#include "Connection.hpp" 
    3838#include "Operator.hpp" 
    39 #include <fstream.h> 
     39#include <fstream> 
    4040 
    4141#include <boost/graph/adjacency_list.hpp> 
     
    112112    //! Default constructor. 
    113113    Order(Table<Modul> * aTheModulTable){ theModulTable = aTheModulTable; } 
     114 
    114115     
    115116/*    //! Constructor for the order coherences check 
     
    122123 
    123124// -- AJOUT CB  --  
     125 
     126    //! a dummy order that will be just used to topulate the orderTable from the automaticOrderGenerator  
     127 
     128    // Order(int i) { } 
    124129 
    125130    Order(Table<Connection> * aConnectionTable, Table<Modul> * aModulTable, Table<Space> * aSpaceTable, Table<Operator> * aOperatorTable) : myConnectionTable(aConnectionTable), 
     
    213218   Table<Operator> * myOperatorTable; 
    214219 
     220   // OBJ vector<string> myOrderTokens; 
     221         
     222 
    215223   // dedicated light structures that register, from the yaoo objects,  all the informations needed to perform the order generation 
    216224   typedef pair<int, int> edge; 
     
    261269   boost::graph_traits<myGraphType>::edge_iterator edgeIterOne, edgeIterTwo; 
    262270 
     271   // A string that contain the project name given as a paramater to automaticOrderGenerator (declared here to avoid changing all the function calls) 
    263272   string theProject; 
    264273    
     
    270279         * The dedicated structures are declared as global datas then accessed and updated by the functions.  
    271280         */ 
    272          void automaticOrderGenerator(string projectName); 
     281         void automaticOrderGenerator(string projectName, Table<Order>& theOrderTable); 
    273282 
    274283    private: 
    275284 
    276         // -- Fonctions créant et renseignant les structures --- 
     285        // -- Functions that build and populate the data structures -- 
    277286 
    278287        /** 
     
    333342        void setInner(int noComp3D, int noFixed1, int noComp2D, int noFixed2, int freeDim, myGraphType& upperGraph); 
    334343 
    335         // --  Fonctions permettant de manipuler les graphes -- 
     344        // --  Functions for managing the graphs -- 
    336345 
    337346        /** 
     
    392401 
    393402 
    394         // -- Fonction de gestion des signes et des axes -- 
     403        // -- Functions for managing axis (sign and ordering) -- 
    395404 
    396405        /** 
     
    471480        int getCommonSignInner(int noFixed, int noFree, myGraphType& currentGraph); 
    472481 
    473         // -- Fonctions d'affichage --  
     482       /* 
     483        * This function perform almost the same operations than getCommonSign() except the target modul does not have to be in  
     484        * the checked component.  
     485        */ 
     486        int getCommonFixedSign(int noDim, int noComp, myGraphType& currentGraph); 
     487 
     488 
     489        // -- Functions that create the hidden file and populate the order Table by reading the data structures --  
     490 
     491       /* 
     492        * Function that read one order statement and his parameter ("order Y**")  
     493        * @param noAxis the axis dimension number on which the order have to be displayed (0 = i, 1 = j, 2 = k) 
     494        * @param valAxis the axis value on which the order have to be displayed (used to display A or B) 
     495        * @param noParam the parameter number on which the order have to be displayed (is the parameter is the first, second or third)            
     496        */ 
     497        void readParam(int noAxis, int valAxis, int noParam); 
    474498 
    475499        /** 
     
    502526        void read3D(); 
    503527 
     528        // -- Functions that display data structures --  
     529 
    504530        /** 
    505531        * Function that show vertices and edges of a graph and their attributes 
    506         * @param currentGraph a raference to the graph on which informations have to be shown 
     532        * @param currentGraph a reference to the graph on which informations have to be shown 
    507533        */ 
    508534        void showGraph(myGraphType& currentGraph); 
     
    534560        void showInner(int noFixed1, int noFixed2, int freeDim); 
    535561 
    536  
    537         // -- Fonctions outils -- // 
     562        // -- Tool functions --  
    538563 
    539564        /** 
     
    547572 
    548573        /* 
    549         * Function that read one order statement and his parameter ("order Y**")  
    550         * @param noAxis the axis dimension number on which the order have to be displayed (0 = i, 1 = j, 2 = k) 
    551         * @param valAxis the axis value on which the order have to be displayed (used to display A or B) 
    552         * @param noParam the parameter number on which the order have to be displayed (is the parameter is the first, second or third)            
    553         */ 
    554         void readParam(int noAxis, int valAxis, int noParam); 
    555  
    556  
    557         int getCommonFixedSign(int noDim, int noComp, myGraphType& currentGraph);  
     574        * Function that allow to see what is inside the orderTable given as a parameter 
     575        * This function is just usefull for testing the result of the generation, so it is temporary  
     576        * @param theOrderTable a reference to a vector of Order objects  
     577        */ 
     578        void showTokens(Table<Order>& theOrderTable);  
     579 
    558580 
    559581 // ------------- FIN AJOUT CB GENERATION AUTOMATIQUE DE L'ORDER --------------- // 
Note: See TracChangeset for help on using the changeset viewer.