X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/014983949544db9a324cece29a0ccc46b1e3e1f3..92d7eb81980a40dda0715b23e874a1537cf3adb8:/deployment.cpp?ds=sidebyside diff --git a/deployment.cpp b/deployment.cpp index 1b26a8a..c5a1f9d 100644 --- a/deployment.cpp +++ b/deployment.cpp @@ -64,33 +64,6 @@ void deployment_generator::deploy() xbt_dynar_free(&args); } -void deployment_line::generate() -{ - for (unsigned i = 0 ; i < size() - 1 ; ++i) - set_link(i, i + 1); -} - -void deployment_ring::generate() -{ - set_neighbor(0, size() - 1); - for (unsigned i = 0 ; i < size() - 1 ; ++i) - set_link(i, i + 1); - set_neighbor(size() - 1, 0); -} - -void deployment_star::generate() -{ - for (unsigned i = 1 ; i < size() ; ++i) - set_link(0, i); -} - -void deployment_clique::generate() -{ - for (unsigned i = 0 ; i < size() ; ++i) - for (unsigned j = 0 ; j < i ; ++j) - set_link(i, j); -} - void deployment_btree::generate() { for (unsigned i = 0 ; i < size() / 2 ; ++i) { @@ -104,9 +77,12 @@ void deployment_btree::generate() } } -// void deployment_torus::generate() -// { -// } +void deployment_clique::generate() +{ + for (unsigned i = 0 ; i < size() ; ++i) + for (unsigned j = 0 ; j < i ; ++j) + set_link(i, j); +} void deployment_hcube::generate() { @@ -125,3 +101,27 @@ void deployment_hcube::generate() set_link(i, j); } } + +void deployment_line::generate() +{ + for (unsigned i = 0 ; i < size() - 1 ; ++i) + set_link(i, i + 1); +} + +void deployment_ring::generate() +{ + set_neighbor(0, size() - 1); + for (unsigned i = 0 ; i < size() - 1 ; ++i) + set_link(i, i + 1); + set_neighbor(size() - 1, 0); +} + +void deployment_star::generate() +{ + for (unsigned i = 1 ; i < size() ; ++i) + set_link(0, i); +} + +// void deployment_torus::generate() +// { +// }