tests.cpp 25 KB

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