X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/0ebfaf6eb40a90d31baa3813c891eb7261e818d2..6f21403d553131b282aeff52a2c496d71d05c97e:/loba_makhoul3.cpp?ds=sidebyside diff --git a/loba_makhoul3.cpp b/loba_makhoul3.cpp index 9517002..fd06d22 100644 --- a/loba_makhoul3.cpp +++ b/loba_makhoul3.cpp @@ -9,10 +9,10 @@ void loba_makhoul3::load_balance() pneigh_sort_by_load(std::less()); print_loads_p(false, xbt_log_priority_debug); - int nb_less_loaded=0; - for (unsigned i = 0 ; i < pneigh.size() ; ++i) { - nb_less_loaded+=(pneigh[i]->get_load()<=get_load()); - } + int nb_less_loaded = 0; + for (unsigned i = 0 ; i < pneigh.size() ; ++i) { + nb_less_loaded += (pneigh[i]->get_load() <= get_load()); + } double alpha = 1.0 / (nb_less_loaded ); double my_load = get_load();