]> AND Private Git Repository - loba.git/blobdiff - loba_makhoul.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Add forgotten files.
[loba.git] / loba_makhoul.cpp
index 8ee3b3e82dbe579afe2d86f55ba9d9a679811f66..1807da410d935ffdf278da856909c9bb815eb4c5 100644 (file)
@@ -16,12 +16,10 @@ void loba_makhoul::load_balance()
         double delta = std::max(myLoad - pneigh[i]->get_load(), 0.0);
         double transfer = alpha * delta;
         XBT_DEBUG("delta = %g ; transfer = %g", delta, transfer);
-        if (pneigh[i]->get_load() <= get_load() - 2 * transfer) {
-            send(pneigh[i], transfer);
-            XBT_DEBUG("sent %g to %s", transfer, pneigh[i]->get_name());
-        } else {
+        if (get_load() - 2 * transfer < pneigh[i]->get_load())
             break;
-        }
+        send(pneigh[i], transfer);
+        XBT_DEBUG("sent %g to %s", transfer, pneigh[i]->get_name());
     }
 }