Changeset 211
- Timestamp:
- 02/24/10 14:17:53 (14 years ago)
- Location:
- trunk/yao/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/Translator.cpp
r209 r211 202 202 203 203 Order myOrder(&theConnectionTable, &theModulTable, &theSpaceTable, &theOperatorTable); 204 myOrder.automaticOrderGenerator(projectName );204 myOrder.automaticOrderGenerator(projectName, theOrderTable); 205 205 206 206 // End Translator -
trunk/yao/src/YAOObjects/Order.cpp
r209 r211 596 596 597 597 598 void Order::automaticOrderGenerator(string projectName) { 598 void 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 // ----------------------------------------------- 599 609 600 610 theProject = "." + projectName; 611 612 // Create a output file stream object 613 // ---------------------------------- 601 614 602 615 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 // ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 603 619 604 620 hiddenFile.open(theProject.c_str()); … … 819 835 // ------------------------ 820 836 821 // ofstream hiddenFile;822 823 837 hiddenFile.open(theProject.c_str(), ios::app); 824 838 825 cout << endl << endl << "order modinspace " << spaceName << endl;826 827 839 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(); 831 868 832 869 // Dedicated light structures that will be used to create the main graph then populate its properties … … 1023 1060 } 1024 1061 1025 cout << endl << "forder";1026 1027 1062 hiddenFile.open(theProject.c_str(), ios::app); 1028 1063 1064 // Close the current modinspace statement 1065 // -------------------------------------- 1066 1029 1067 hiddenFile << endl << "forder"; 1030 1068 1031 1069 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 1032 1076 } 1033 1077 } … … 1047 1091 for(int noTraj = 0; noTraj < trajOrder.size(); noTraj++) { 1048 1092 1049 cout << endl << endl << "order spaceintraj " << trajOrder[noTraj].second << endl << endl << "\t";1050 1051 1093 ofstream hiddenFile; 1052 1094 … … 1054 1096 1055 1097 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 1056 1119 1057 1120 // For all the space numbers … … 1073 1136 // ----------------------------------------- 1074 1137 1075 cout << trajMap.find(spacesList[noTopo]) -> first << " ";1076 1077 1138 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); 1078 1146 } 1079 1147 } … … 1083 1151 // --------------------------------------- 1084 1152 1085 cout << endl << endl << "forder";1086 1087 1153 hiddenFile << endl << endl << "forder"; 1088 1154 1089 1155 hiddenFile.close(); 1090 1156 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 1091 1162 } 1092 1163 1164 // Just for tests (look at the Order Table at the end of the generation) 1165 // --------------------------------------------------------------------- 1166 1167 showTokens(theOrderTable); 1093 1168 1094 1169 }; … … 1189 1264 void Order::showOuter() { 1190 1265 1191 cout << endl << "PROTOTYPE : outerComp[noComp3D]" << endl;1192 1193 1266 // For all 3D component embedded in the vector outerComp 1194 1267 // ----------------------------------------------------- … … 1211 1284 void Order::showInner(int noFixed1, int noFixed2, int freeDim) { 1212 1285 1213 // ***** cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl;1214 1215 1286 // For all 3D component embedded in the vector outerComp 1216 1287 // ------------------------------------------------------ … … 1243 1314 1244 1315 cout << 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 ******/1269 1316 1270 1317 } … … 2087 2134 // ------------------------------------------------------------------------------------------------------- 2088 2135 2089 if(noParam == 3) { cout << endl << endl << "\t\tforder"; hiddenFile << endl << endl << "\t\tforder"; }2136 if(noParam == 3) hiddenFile << endl << endl << "\t\tforder"; 2090 2137 2091 2138 // If the current level is the second one, it means the order have to be closed with one tabulation offset 2092 2139 // ------------------------------------------------------------------------------------------------------- 2093 2140 2094 if(noParam == 2) { cout << endl << endl << "\tforder"; hiddenFile << endl << endl << "\tforder"; }2141 if(noParam == 2) hiddenFile << endl << endl << "\tforder"; 2095 2142 2096 2143 // If the current level is the first one, it means the order have to be closed without tabulation offset 2097 2144 // ----------------------------------------------------------------------------------------------------- 2098 2145 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 2100 2150 break; 2101 2151 … … 2108 2158 // --------------------------------------------------------------------------------------------------------------------------------------- 2109 2159 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 2111 2162 2112 2163 // If the current parameter is the first one, the order statement have to be closed with one tabulation offset then no offset 2113 2164 // --------------------------------------------------------------------------------------------------------------------------- 2114 2165 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 2116 2172 break; 2117 2173 … … 2124 2180 // ---------------------------------------------------------------------------------------------------------------------------------------- 2125 2181 2126 cout << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder";2127 2128 2182 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"); 2129 2187 2130 2188 break; … … 2141 2199 // ------------------------------------------------------- 2142 2200 2143 case 1: cout << endl << endl;hiddenFile << endl << endl; break;2201 case 1: hiddenFile << endl << endl; break; 2144 2202 2145 2203 // If the parameter is the second, then one offset is needed 2146 2204 // --------------------------------------------------------- 2147 2205 2148 case 2: cout << endl << endl << "\t";hiddenFile << endl << endl << "\t"; break;2206 case 2: hiddenFile << endl << endl << "\t"; break; 2149 2207 2150 2208 // If the parameter is the third, then two offsets are needed 2151 2209 // ---------------------------------------------------------- 2152 2210 2153 case 3: cout << endl << endl << "\t\t";hiddenFile << endl << endl << "\t\t"; break;2211 case 3: hiddenFile << endl << endl << "\t\t"; break; 2154 2212 } 2155 2213 … … 2157 2215 // ------------------------------------------------------- 2158 2216 2217 stringstream valParam; 2218 2219 this -> orderTokens.push_back("order"); 2220 2159 2221 switch(valAxis) { 2160 2222 … … 2162 2224 // ------------------------------------------------------------------------------------------------------------ 2163 2225 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; 2165 2227 2166 2228 // If the axis value is set to 3 (no edges), then the dimension can be crossed both way (free) 2167 2229 // ------------------------------------------------------------------------------------------- 2168 2230 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; 2170 2232 2171 2233 // If the axis value is set to -1, then the dimension must be crossed increasingly 2172 2234 // ------------------------------------------------------------------------------- 2173 2235 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; 2175 2237 2176 2238 // If the axis value is set to +1, then the dimension must be crossed decreasingly 2177 2239 // ------------------------------------------------------------------------------- 2178 2240 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; 2180 2242 2181 2243 // If the axis value is set to 2 (no common value), then the dimension can be crossed both way (free) 2182 2244 // -------------------------------------------------------------------------------------------------- 2183 2245 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 !!!! 2185 2247 } 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()); 2186 2255 } 2187 2256 … … 2194 2263 // --------------------------------------------------------------------------------------------------------------------------------- 2195 2264 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"); } 2198 2270 2199 2271 // If the last parameter was the second in the order statement, then two parameters have to be closed (one for each open parameter) 2200 2272 // -------------------------------------------------------------------------------------------------------------------------------- 2201 2273 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"); } 2204 2279 2205 2280 // If the last parameter was the first in the order statement, then one parameter have to be closed 2206 2281 // ------------------------------------------------------------------------------------------------ 2207 2282 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 2210 2285 2211 2286 // Reset the lastParam static value to avoid a closing order at the beginning of the next order statement … … 2745 2820 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][1].size(); noComp1D++) { 2746 2821 2747 // Get ting 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 // ------------------------------------------------------------------------------------------------------------------------------------------------------ 2749 2824 2750 2825 int valAxis1 = innerComp[noComp3D][0][noComp2D][1][noComp1D].cfcSign[0].second; … … 2757 2832 hiddenFile.open(theProject.c_str(), ios::app); 2758 2833 2759 cout << endl << endl << "\t\t";2760 2761 2834 hiddenFile << endl << endl << "\t\t"; 2762 2835 … … 2769 2842 // --------------------------------------- 2770 2843 2771 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod]) << " ";2772 2773 2844 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])); 2774 2849 2775 2850 } … … 2793 2868 ofstream hiddenFile; 2794 2869 2795 // For all 3D component in the main graph 2870 // For all 3D components in the main graph 2871 // ---------------------------------------- 2796 2872 2797 2873 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 2798 2874 2799 2875 // For all components in the 2D graph coming from the current 3D component with the first axis fixed 2876 // ------------------------------------------------------------------------------------------------- 2800 2877 2801 2878 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++) { 2802 2879 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 // ------------------------------------------------------------------------------------------------ 2804 2882 2805 2883 int noFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 2806 2884 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 // ------------------------------------------------------------------------------------ 2808 2887 2809 2888 int valFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].second; 2810 2889 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 // -------------------------------------------------------------------------------------------------------------------------------- 2812 2892 2813 2893 readParam(noFixed1 -1, valFixed1, 1); 2814 2894 2815 cout << endl << endl << "\t\t";2816 2817 2895 hiddenFile.open(theProject.c_str(), ios::app); 2818 2896 … … 2821 2899 hiddenFile.close(); 2822 2900 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 // ---------------------------------------------------------------------------------------- 2824 2903 2825 2904 int noAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].first; 2826 2905 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 // ------------------------------------------------------------------------------------ 2828 2908 2829 2909 int valAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].second; 2830 2910 2831 // If the third axis value is defined 2911 // If the second axis value is defined 2912 // ----------------------------------- 2832 2913 2833 2914 if(valAxis2 != 2) { 2834 2915 2835 2916 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 2917 // ---------------------------------------------------------------------------------------------------------------------------- 2836 2918 2837 2919 readParam(noAxis2 -1, valAxis2, 2); 2838 2920 2839 cout << endl << endl << "\t\t";2840 2841 2921 hiddenFile.open(theProject.c_str(), ios::app); 2842 2922 2843 2923 hiddenFile << endl << endl << "\t\t"; 2844 2924 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 // ----------------------------------------------------------------------------------------------------- 2848 2927 2849 2928 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 2850 2929 2851 2930 // For all the moduls embedded in the current 1D component 2931 // ------------------------------------------------------- 2852 2932 2853 2933 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2854 2934 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 2861 2938 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])); 2864 2943 2865 2944 } … … 2870 2949 } 2871 2950 2872 // If the third axis value is not defined 2951 // If the second axis value is not defined 2952 // --------------------------------------- 2873 2953 2874 2954 else { 2875 2955 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 // ------------------------------------------------------------------------------------------------- 2879 2958 2880 2959 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 2881 2960 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 // ---------------------------------------------------------------------------------------- 2883 2963 2884 2964 int noAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2885 2965 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 // ------------------------------------------------------------------------------------ 2887 2968 2888 2969 int valAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2889 2970 2890 2971 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 2972 // ---------------------------------------------------------------------------------------------------------------------------- 2891 2973 2892 2974 readParam(noAxis3 -1, valAxis3, 2); 2893 2975 2894 cout << endl << endl << "\t\t";2895 2896 2976 hiddenFile.open(theProject.c_str(), ios::app); 2897 2977 2898 2978 hiddenFile << endl << endl << "\t\t"; 2899 2979 2900 // hiddenFile.close();2901 2902 2980 // For all the moduls embedded in the current 1D component 2981 // ------------------------------------------------------- 2903 2982 2904 2983 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2905 2984 2906 // Insert the modul name in the current order parameter 2985 // Insert the modul name in the current order parameter 2986 // ---------------------------------------------------- 2907 2987 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 2912 2988 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 2915 2994 } 2916 2995 … … 2922 3001 2923 3002 // Close the order statement 3003 // ------------------------- 2924 3004 2925 3005 readParam(0, 0, 0); … … 2981 3061 hiddenFile.open(theProject.c_str(), ios::app); 2982 3062 2983 cout << endl << endl << "\t\t\t";2984 2985 3063 hiddenFile << endl << endl << "\t\t\t"; 2986 3064 … … 3008 3086 // ----------------------------------------------------------------------------------------------- 3009 3087 3010 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " ";3011 3012 3088 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 3013 3094 } 3014 3095 } … … 3055 3136 hiddenFile.open(theProject.c_str(), ios::app); 3056 3137 3057 cout << endl << endl << "\t\t\t";3058 3059 3138 hiddenFile << endl << endl << "\t\t\t"; 3060 3139 … … 3067 3146 // ----------------------------------------------------------------------------------------------- 3068 3147 3069 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " ";3070 3071 3148 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])); 3072 3153 3073 3154 } … … 3133 3214 hiddenFile.open(theProject.c_str(), ios::app); 3134 3215 3135 cout << endl << endl << "\t\t\t";3136 3137 3216 hiddenFile << endl << endl << "\t\t\t"; 3138 3217 … … 3150 3229 // ------------------------------------------------------------------------------------------------- 3151 3230 3152 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " ";3153 3154 3231 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])); 3155 3236 3156 3237 } … … 3187 3268 hiddenFile.open(theProject.c_str(), ios::app); 3188 3269 3189 cout << endl << endl << "\t\t\t";3190 3191 3270 hiddenFile << endl << endl << "\t\t\t"; 3192 3271 … … 3199 3278 // ------------------------------------------------------------------------------------------------- 3200 3279 3201 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " ";3202 3203 3280 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])); 3204 3285 3205 3286 } … … 3492 3573 3493 3574 3575 void 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 3494 3589 3495 3590 3496 3591 //-----------------CB--------------------- 3497 3592 3593 -
trunk/yao/src/YAOObjects/Order.hpp
r209 r211 37 37 #include "Connection.hpp" 38 38 #include "Operator.hpp" 39 #include <fstream .h>39 #include <fstream> 40 40 41 41 #include <boost/graph/adjacency_list.hpp> … … 112 112 //! Default constructor. 113 113 Order(Table<Modul> * aTheModulTable){ theModulTable = aTheModulTable; } 114 114 115 115 116 /* //! Constructor for the order coherences check … … 122 123 123 124 // -- AJOUT CB -- 125 126 //! a dummy order that will be just used to topulate the orderTable from the automaticOrderGenerator 127 128 // Order(int i) { } 124 129 125 130 Order(Table<Connection> * aConnectionTable, Table<Modul> * aModulTable, Table<Space> * aSpaceTable, Table<Operator> * aOperatorTable) : myConnectionTable(aConnectionTable), … … 213 218 Table<Operator> * myOperatorTable; 214 219 220 // OBJ vector<string> myOrderTokens; 221 222 215 223 // dedicated light structures that register, from the yaoo objects, all the informations needed to perform the order generation 216 224 typedef pair<int, int> edge; … … 261 269 boost::graph_traits<myGraphType>::edge_iterator edgeIterOne, edgeIterTwo; 262 270 271 // A string that contain the project name given as a paramater to automaticOrderGenerator (declared here to avoid changing all the function calls) 263 272 string theProject; 264 273 … … 270 279 * The dedicated structures are declared as global datas then accessed and updated by the functions. 271 280 */ 272 void automaticOrderGenerator(string projectName );281 void automaticOrderGenerator(string projectName, Table<Order>& theOrderTable); 273 282 274 283 private: 275 284 276 // -- F onctions créant et renseignant les structures ---285 // -- Functions that build and populate the data structures -- 277 286 278 287 /** … … 333 342 void setInner(int noComp3D, int noFixed1, int noComp2D, int noFixed2, int freeDim, myGraphType& upperGraph); 334 343 335 // -- F onctions permettant de manipuler les graphes --344 // -- Functions for managing the graphs -- 336 345 337 346 /** … … 392 401 393 402 394 // -- F onction de gestion des signes et des axes--403 // -- Functions for managing axis (sign and ordering) -- 395 404 396 405 /** … … 471 480 int getCommonSignInner(int noFixed, int noFree, myGraphType& currentGraph); 472 481 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); 474 498 475 499 /** … … 502 526 void read3D(); 503 527 528 // -- Functions that display data structures -- 529 504 530 /** 505 531 * Function that show vertices and edges of a graph and their attributes 506 * @param currentGraph a r aference to the graph on which informations have to be shown532 * @param currentGraph a reference to the graph on which informations have to be shown 507 533 */ 508 534 void showGraph(myGraphType& currentGraph); … … 534 560 void showInner(int noFixed1, int noFixed2, int freeDim); 535 561 536 537 // -- Fonctions outils -- // 562 // -- Tool functions -- 538 563 539 564 /** … … 547 572 548 573 /* 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 558 580 559 581 // ------------- FIN AJOUT CB GENERATION AUTOMATIQUE DE L'ORDER --------------- //
Note: See TracChangeset
for help on using the changeset viewer.