4 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(loba);
6 #include "loba_fairstrategy.h"
10 bool operator()(const neighbor*a, const neighbor*b) {
11 return a->get_load() > b->get_load();
15 void loba_fairstrategy::load_balance()
17 const double delta = 0.001;
19 std::sort(pneigh.begin(), pneigh.end(), compare());
21 print_loads_p(false, xbt_log_priority_debug);
27 for (unsigned i = 0 ; i < pneigh.size() ; ++i) {
28 if (pneigh[i]->get_load() <= get_load() - 2 * delta) {
30 send(pneigh[i], delta);
31 DEBUG1("sent to %s", pneigh[i]->get_name());