- 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());
+ if (pneigh[i]->get_load() + transfer <= get_load() - transfer) {
+ send(pneigh[i], transfer);
+ XBT_DEBUG("sent %g to %s", transfer, pneigh[i]->get_name());
+ } else {
+ cont = false;
+ }