tests.cpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /**
  2. * @file tests/boost_graph/tests.cpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013-2015 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #include <boost/timer.hpp>
  26. #include <paradevs/common/RootCoordinator.hpp>
  27. #include <tests/boost_graph/models.hpp>
  28. #include <tests/boost_graph/graph_defs.hpp>
  29. #include <tests/boost_graph/graph_builder.hpp>
  30. #include <tests/boost_graph/graph_generator.hpp>
  31. #include <tests/boost_graph/graph_manager.hpp>
  32. #include <tests/boost_graph/graph_partitioning.hpp>
  33. using namespace paradevs::common;
  34. using namespace paradevs::common::scheduler;
  35. using namespace paradevs::pdevs;
  36. using namespace paradevs::tests::boost_graph;
  37. #include <fstream>
  38. std::ofstream log_file("log");
  39. /* flat models */
  40. template < class GraphBuilder >
  41. void flat_heap_test(double duration)
  42. {
  43. RootCoordinator <
  44. DoubleTime,
  45. paradevs::pdevs::Coordinator <
  46. DoubleTime,
  47. InBuildFlatGraphManager < GraphBuilder > >
  48. > rc(0, duration, "root");
  49. rc.run();
  50. }
  51. // template < class GraphBuilder >
  52. // void flat_vector_test(double duration)
  53. // {
  54. // RootCoordinator <
  55. // DoubleTime,
  56. // paradevs::pdevs::Coordinator <
  57. // DoubleTime,
  58. // paradevs::common::scheduler::VectorScheduler <
  59. // paradevs::common::DoubleTime >,
  60. // paradevs::common::scheduler::NoSchedulerHandle,
  61. // InBuildFlatGraphManager <
  62. // paradevs::common::scheduler::NoSchedulerHandle,
  63. // GraphBuilder > >
  64. // > rc(0, duration, "root");
  65. // rc.run();
  66. // }
  67. /* partitionning models */
  68. template < class GraphGenerator >
  69. void partitionning_heap_test(double duration,
  70. int cluster_number,
  71. std::string partitioning_method_name,
  72. int contraction_coef,
  73. bool contraction_coef_flag,
  74. GraphGenerator& g)
  75. {
  76. RootCoordinator <
  77. DoubleTime,
  78. paradevs::pdevs::Coordinator <
  79. DoubleTime,
  80. HeapHierarchicalGraphManager < PartitioningGraphBuilder>,
  81. paradevs::common::NoParameters,
  82. PartitioningParameters >
  83. > rc(0, duration, "root", NoParameters(),
  84. PartitioningParameters(cluster_number, partitioning_method_name,
  85. contraction_coef, contraction_coef_flag,
  86. g));
  87. rc.run();
  88. }
  89. // template < class GraphGenerator >
  90. // void partitionning_vector_test(double duration,
  91. // int cluster_number,
  92. // std::string partitioning_method_name,
  93. // int contraction_coef,
  94. // bool contraction_coef_flag,
  95. // GraphGenerator& g)
  96. // {
  97. // RootCoordinator <
  98. // DoubleTime,
  99. // paradevs::pdevs::Coordinator <
  100. // DoubleTime,
  101. // paradevs::common::scheduler::VectorScheduler <
  102. // paradevs::common::DoubleTime >,
  103. // paradevs::common::scheduler::NoSchedulerHandle,
  104. // VectorHierarchicalGraphManager <
  105. // paradevs::common::scheduler::NoSchedulerHandle,
  106. // PartitioningGraphBuilder >,
  107. // paradevs::common::NoParameters,
  108. // PartitioningParameters >
  109. // > rc(0, duration, "root", NoParameters(),
  110. // PartitioningParameters(cluster_number, partitioning_method_name,
  111. // contraction_coef, contraction_coef_flag, g));
  112. // rc.run();
  113. // }
  114. /* iteration for partitionning methods */
  115. template < class GraphGenerator >
  116. void test(double duration, std::string partitioning_method_name,
  117. unsigned int min, unsigned int max, unsigned int step,
  118. bool vector, bool heap,
  119. int contraction_coef,
  120. bool contraction_coef_flag,
  121. GraphGenerator& g)
  122. {
  123. boost::timer t;
  124. int nbr_ite = 10;
  125. log_file << "==== " << partitioning_method_name << " with ";
  126. if (contraction_coef_flag) {
  127. log_file << "/";
  128. }
  129. log_file << contraction_coef << " ===" << std::endl;
  130. log_file << "n";
  131. if (heap) {
  132. log_file << "\t heap";
  133. }
  134. if (vector) {
  135. log_file << "\t vector";
  136. }
  137. log_file << std::endl;
  138. if (contraction_coef_flag) {
  139. for (unsigned int n = min; n <= max; n += step) {
  140. log_file << n << "\t";
  141. if (heap) {
  142. double t1 = t.elapsed();
  143. for (unsigned int i = 0; i < nbr_ite; ++i) {
  144. partitionning_heap_test(duration, n,
  145. partitioning_method_name,
  146. contraction_coef,
  147. contraction_coef_flag, g);
  148. }
  149. double t2 = t.elapsed();
  150. log_file << (t2 - t1) / nbr_ite << "\t";
  151. }
  152. if (vector) {
  153. double t1 = t.elapsed();
  154. for (unsigned int i = 0; i < nbr_ite; ++i) {
  155. // partitionning_vector_test(duration, n,
  156. // partitioning_method_name,
  157. // contraction_coef,
  158. // contraction_coef_flag, g);
  159. }
  160. double t2 = t.elapsed();
  161. log_file << (t2 - t1) / nbr_ite << std::endl;
  162. } else {
  163. log_file << std::endl;
  164. }
  165. }
  166. } else {
  167. log_file << contraction_coef << "\t";
  168. if (heap) {
  169. double t1 = t.elapsed();
  170. for (unsigned int i = 0; i < nbr_ite; ++i) {
  171. partitionning_heap_test(duration, contraction_coef,
  172. partitioning_method_name,
  173. contraction_coef,
  174. contraction_coef_flag, g);
  175. }
  176. double t2 = t.elapsed();
  177. log_file << (t2 - t1) / nbr_ite << "\t";
  178. }
  179. if (vector) {
  180. double t1 = t.elapsed();
  181. for (unsigned int i = 0; i < nbr_ite; ++i) {
  182. // partitionning_vector_test(duration, contraction_coef,
  183. // partitioning_method_name,
  184. // contraction_coef,
  185. // contraction_coef_flag, g);
  186. }
  187. double t2 = t.elapsed();
  188. log_file << (t2 - t1) / nbr_ite << std::endl;
  189. } else {
  190. log_file << std::endl;
  191. }
  192. }
  193. }
  194. /* 38 nodes graph */
  195. const double duration_38 = 20;
  196. void test_flat_38()
  197. {
  198. boost::timer t;
  199. log_file << "== 38 nodes ==" << std::endl;
  200. log_file << "flat graph with heap = ";
  201. for (unsigned int i = 0; i < 20; ++i) {
  202. flat_heap_test< FlatGraphBuilder >(duration_38);
  203. }
  204. double t2 = t.elapsed();
  205. log_file << t2 / 20 << std::endl;
  206. log_file << "flat graph with vector = ";
  207. for (unsigned int i = 0; i < 20; ++i) {
  208. // flat_vector_test< FlatGraphBuilder >(duration_38);
  209. }
  210. double t3 = t.elapsed();
  211. log_file << (t3 - t2) / 20 << std::endl;
  212. }
  213. void test_partitioning_38()
  214. {
  215. ArtificialGraphGenerator g(38);
  216. for (int i = 1; i <= 2; ++i) {
  217. /*std::cout<<"Méthode ggp"<<std::endl;
  218. test < ArtificialGraphGenerator >(duration_38, "ggp", 2, 16, 2,
  219. true, true, i, true, g);*/
  220. std::cout<<"Méthode gggp"<<std::endl;
  221. test < ArtificialGraphGenerator >(duration_38, "gggp_pond", 2, 16, 2,
  222. true, true, i, true, g);
  223. std::cout<<"Méthode random"<<std::endl;
  224. test < ArtificialGraphGenerator >(duration_38, "random", 2, 16, 2,
  225. true, true, i, true, g);
  226. }
  227. for (int i = 2; i <= 8; i += 2) {
  228. test < ArtificialGraphGenerator >(duration_38, "gggp_pond", 0, 0, 0,
  229. true, true, i, false, g);
  230. }
  231. }
  232. /* random graph */
  233. const double duration_random = 0;
  234. void test_flat_random()
  235. {
  236. boost::timer t;
  237. uint nbr_ite = 20;
  238. log_file << "== Random Graph ==" << std::endl;
  239. log_file << "flat graph with heap = ";
  240. for (unsigned int i = 0; i < nbr_ite; ++i) {
  241. flat_heap_test< RandomFlatGraphBuilder >(duration_random);
  242. }
  243. double t2 = t.elapsed();
  244. /*log_file << t2 / 10 << std::endl;
  245. log_file << "flat graph with vector = ";
  246. for (unsigned int i = 0; i < 10; ++i) {
  247. flat_vector_test< FlatGraphBuilder >(duration_random);
  248. }
  249. double t3 = t.elapsed();*/
  250. //log_file << (t3 - t2) / 10 << std::endl;
  251. log_file << t2 / nbr_ite << std::endl;
  252. }
  253. void test_partitioning_random()
  254. {
  255. std::vector < int > levels = {/*5,4,*/ 3, 2 };
  256. int nbr_sommets = 200;
  257. int sources = nbr_sommets/100*1;
  258. RandomGraphGenerator g(nbr_sommets, levels, sources, 2, 3);
  259. /*test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 200, 2,
  260. false, true, 5, true, g);
  261. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 200, 2,
  262. false, true, 10, true, g);
  263. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 200, 2,
  264. false, true, 20, true, g);
  265. test < RandomGraphGenerator >(duration_random, "gggp_pond", 42, 42, 2,
  266. false, true, 40, true, g);
  267. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 50, 2,
  268. false, true, 60, true, g);*/
  269. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 200, 2,
  270. false, true, 1 , true, g);
  271. /* test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  272. false, true, 100, true, g);
  273. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 30, 2,
  274. false, true, 200, true, g);*/
  275. /*test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  276. false, true, 15, false, g);
  277. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  278. false, true, 20, false, g);
  279. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  280. false, true, 25, false, g);
  281. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  282. false, true, 30, false, g);
  283. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  284. false, true, 35, false, g);
  285. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  286. false, true, 40, false, g);
  287. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  288. false, true, 45, false, g);
  289. test < RandomGraphGenerator >(duration_random, "gggp_pond", 2, 32, 2,
  290. false, true, 50, false, g);*/
  291. /*test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  292. false, true, 5, true, g);
  293. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  294. false, true, 10, true, g);
  295. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  296. false, true, 20, true, g);
  297. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  298. false, true, 40, true, g);
  299. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  300. false, true, 60, true, g);
  301. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  302. false, true, 80, true, g);
  303. test < RandomGraphGenerator >(duration_random, "ggp", 2, 30, 2,
  304. false, true, 100, true, g);*/
  305. /*test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  306. false, true, 15, false, g);
  307. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  308. false, true, 20, false, g);
  309. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  310. false, true, 25, false, g);
  311. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  312. false, true, 30, false, g);
  313. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  314. false, true, 35, false, g);
  315. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  316. false, true, 40, false, g);
  317. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  318. false, true, 45, false, g);
  319. test < RandomGraphGenerator >(duration_random, "ggp", 2, 32, 2,
  320. false, true, 50, false, g);
  321. test < RandomGraphGenerator >(duration_random, "random", 2, 32, 2,
  322. false, true, 5, true, g);
  323. test < RandomGraphGenerator >(duration_random, "random", 2, 32, 2,
  324. false, true, 10, true, g);
  325. test < RandomGraphGenerator >(duration_random, "random", 2, 32, 2,
  326. false, true, 20, true, g);
  327. test < RandomGraphGenerator >(duration_random, "random", 2, 32, 2,
  328. false, true, 40, true, g);
  329. test < RandomGraphGenerator >(duration_random, "random", 2, 22, 2,
  330. false, true, 100, true, g);*/
  331. }
  332. const double duration_random_grid = 40;
  333. void test_flat_random_grid()
  334. {
  335. boost::timer t;
  336. uint nbr_ite = 10;
  337. log_file << "== Random Graph ==" << std::endl;
  338. log_file << "flat graph with heap = ";
  339. for (unsigned int i = 0; i < nbr_ite; ++i) {
  340. flat_heap_test< RandomGridFlatGraphBuilder >(duration_random_grid);
  341. }
  342. double t2 = t.elapsed();
  343. /*log_file << t2 / 10 << std::endl;
  344. log_file << "flat graph with vector = ";
  345. for (unsigned int i = 0; i < 10; ++i) {
  346. flat_vector_test< FlatGraphBuilder >(duration_random);
  347. }
  348. double t3 = t.elapsed();*/
  349. //log_file << (t3 - t2) / 10 << std::endl;
  350. log_file << t2 / nbr_ite << std::endl;
  351. }
  352. void test_partitioning_random_grid()
  353. {
  354. unsigned int side = 90;
  355. std::vector<std::pair<int,int>> vertex_selection;
  356. std::pair<int,int> tmp;
  357. tmp.first = 0;
  358. tmp.second = 3;
  359. vertex_selection.push_back(tmp);
  360. Entiers weight_vertex;
  361. weight_vertex.push_back(1);
  362. const char *edge_weight;
  363. edge_weight = "../../sortie_graphe/tests_grid.txt";
  364. bool rec = false;
  365. RandomGridGraphGenerator g(side, vertex_selection, weight_vertex, edge_weight, rec);
  366. test < RandomGridGraphGenerator >(duration_random_grid, "gggp_pond", 2, 100, 2,
  367. false, true, 80 , true, g);
  368. test < RandomGridGraphGenerator >(duration_random_grid, "gggp_pond", 2, 100, 2,
  369. false, true, 40 , true, g);
  370. }
  371. const double duration_random_linked = 30;
  372. void test_flat_random_linked()
  373. {
  374. boost::timer t;
  375. uint nbr_ite = 20;
  376. log_file << "== Random Linked Graph ==" << std::endl;
  377. log_file << "flat graph with heap = ";
  378. for (unsigned int i = 0; i < nbr_ite; ++i) {
  379. flat_heap_test< RandomLinkedFlatGraphBuilder >(duration_random_linked);
  380. }
  381. double t2 = t.elapsed();
  382. /*log_file << t2 / 10 << std::endl;
  383. log_file << "flat graph with vector = ";
  384. for (unsigned int i = 0; i < 10; ++i) {
  385. flat_vector_test< FlatGraphBuilder >(duration_random);
  386. }
  387. double t3 = t.elapsed();*/
  388. //log_file << (t3 - t2) / 10 << std::endl;
  389. log_file << t2 / nbr_ite << std::endl;
  390. }
  391. void test_partitioning_random_linked()
  392. {
  393. unsigned int levels = 60;
  394. int nbr_sommets = 5000;
  395. RandomLinkedGraphGenerator g(nbr_sommets, levels, 2, 3);
  396. // gggp
  397. /*test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  398. false, true, 5, true, g);*/
  399. test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  400. false, true, 10, true, g);
  401. test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  402. false, true, 20, true, g);
  403. test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  404. false, true, 40, true, g);
  405. test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  406. false, true, 60, true, g);
  407. /*test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  408. false, true, 80, true, g);
  409. test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  410. false, true, 100, true, g);
  411. test < RandomLinkedGraphGenerator >(duration_random_linked, "gggp_pond", 2, 50, 2,
  412. false, true, 200, true, g);*/
  413. // ggp
  414. /*test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  415. false, true, 5, true, g);
  416. test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  417. false, true, 10, true, g);
  418. test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  419. false, true, 20, true, g);
  420. test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  421. false, true, 40, true, g);
  422. test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  423. false, true, 60, true, g);
  424. test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  425. false, true, 80, true, g);
  426. test < RandomLinkedGraphGenerator >(duration_random_linked, "ggp", 2, 50, 2,
  427. false, true, 100, true, g);*/
  428. }
  429. /* corsen graph */
  430. const double corsen_duration = 20;
  431. void test_flat_corsen()
  432. {
  433. boost::timer t;
  434. log_file << "== CORSEN == " << std::endl;
  435. log_file << "flat graph with heap = ";
  436. for (unsigned int i = 0; i < 20; ++i) {
  437. flat_heap_test< CorsenFlatGraphBuilder >(corsen_duration);
  438. }
  439. double t2 = t.elapsed();
  440. log_file << t2 / 20 << std::endl;
  441. log_file << "flat graph with vector = ";
  442. for (unsigned int i = 0; i < 20; ++i) {
  443. // flat_vector_test< CorsenFlatGraphBuilder >(corsen_duration);
  444. }
  445. double t3 = t.elapsed();
  446. log_file << (t3 - t2) / 20 << std::endl;
  447. }
  448. void test_partitioning_corsen()
  449. {
  450. CorsenGraphGenerator g;
  451. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  452. false, true, 10, true, g);
  453. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  454. false, true, 20, true, g);
  455. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  456. false, true, 40, true, g);
  457. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  458. false, true, 80, true, g);
  459. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 22, 2,
  460. false, true, 200, true, g);
  461. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  462. false, true, 30, false, g);
  463. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  464. false, true, 40, false, g);
  465. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  466. false, true, 50, false, g);
  467. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  468. false, true, 60, false, g);
  469. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  470. false, true, 70, false, g);
  471. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  472. false, true, 80, false, g);
  473. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  474. false, true, 90, false, g);
  475. test < CorsenGraphGenerator >(corsen_duration, "gggp_pond", 2, 32, 2,
  476. false, true, 100, false, g);
  477. /*test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  478. false, true, 10, true, g);
  479. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  480. false, true, 20, true, g);
  481. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  482. false, true, 40, true, g);
  483. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  484. false, true, 80, true, g);
  485. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 22, 2,
  486. false, true, 200, true, g);
  487. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  488. false, true, 30, false, g);
  489. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  490. false, true, 40, false, g);
  491. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  492. false, true, 50, false, g);
  493. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  494. false, true, 60, false, g);
  495. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  496. false, true, 70, false, g);
  497. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  498. false, true, 80, false, g);
  499. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  500. false, true, 90, false, g);
  501. test < CorsenGraphGenerator >(corsen_duration, "ggp", 2, 32, 2,
  502. false, true, 100, false, g);
  503. test < CorsenGraphGenerator >(corsen_duration, "random", 2, 32, 2,
  504. false, true, 10, true, g);
  505. test < CorsenGraphGenerator >(corsen_duration, "random", 2, 32, 2,
  506. false, true, 20, true, g);
  507. test < CorsenGraphGenerator >(corsen_duration, "random", 2, 32, 2,
  508. false, true, 40, true, g);
  509. test < CorsenGraphGenerator >(corsen_duration, "random", 2, 32, 2,
  510. false, true, 80, true, g);
  511. test < CorsenGraphGenerator >(corsen_duration, "random", 2, 22, 2,
  512. false, true, 200, true, g);*/
  513. }
  514. /* three graph types : 38 nodes, corsen and random */
  515. void test_38()
  516. {
  517. test_flat_38();
  518. test_partitioning_38();
  519. }
  520. void test_corsen()
  521. {
  522. test_flat_corsen();
  523. test_partitioning_corsen();
  524. }
  525. void test_random()
  526. {
  527. test_flat_random();
  528. test_partitioning_random();
  529. }
  530. void test_random_linked()
  531. {
  532. test_flat_random_linked();
  533. test_partitioning_random_linked();
  534. }
  535. void test_random_grid()
  536. {
  537. test_flat_random_grid();
  538. test_partitioning_random_grid();
  539. }
  540. int main()
  541. {
  542. srand(7262);
  543. //std::cout<<"Simulation pour graphe 38"<<std::endl;
  544. //test_38();
  545. //std::cout<<std::endl;
  546. //std::cout<<"Simulation pour graphe RANDOM 4000"<<std::endl;
  547. //test_random();
  548. std::cout<<"Simulation pour graphe RANDOM_TREE 200"<<std::endl;
  549. test_random_grid();
  550. //std::cout<<"Simulation pour graphe RANDOM_LINKED 6000"<<std::endl;
  551. //test_random_linked();
  552. //std::cout<<std::endl;
  553. //std::cout<<"Simulation pour graphe CORSEN"<<std::endl;
  554. //test_corsen();
  555. return 0;
  556. }