*/
action.update_remains(action.get_remains());
}
- action.update_remains(action.get_variable()->get_value() * delta);
+ action.update_remains(action.get_rate() * delta);
if (action.get_max_duration() != NO_MAX_DURATION)
action.update_max_duration(delta);
} else {
bw_factor = get_bandwidth_factor(size);
}
+ xbt_assert(bw_factor != 0, "Invalid param for comm %s -> %s. Bandwidth factor cannot be 0", src->get_cname(),
+ dst->get_cname());
+ action->set_rate_factor(bw_factor);
+
/* get mininum bandwidth among links in the route and multiply by correct factor
* ignore wi-fi links, they're not considered for bw_factors */
double bandwidth_bound = -1.0;
if (bandwidth_bound == -1.0 || l->get_bandwidth() < bandwidth_bound)
bandwidth_bound = l->get_bandwidth();
}
- bandwidth_bound *= bw_factor;
+ /* increase rate given by user considering the factor, since the actual rate will be
+ * modified by it */
+ rate = rate / bw_factor;
/* the bandwidth is determined by the minimum between flow and user's defined rate */
if (rate >= 0 && rate < bandwidth_bound)
bandwidth_bound = rate;
-
action->set_user_bound(bandwidth_bound);
action->lat_current_ = action->latency_;
{
bandwidth_.scale = 1.0;
bandwidth_.peak = bandwidth;
- this->set_constraint(system->constraint_new(this, sg_bandwidth_factor * bandwidth));
+ this->set_constraint(system->constraint_new(this, bandwidth));
}
void NetworkCm02Link::apply_event(kernel::profile::Event* triggered, double value)
{
bandwidth_.peak = value;
- get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(),
- sg_bandwidth_factor * (bandwidth_.peak * bandwidth_.scale));
+ get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), (bandwidth_.peak * bandwidth_.scale));
LinkImpl::on_bandwidth_change();
}
set_last_update();
- set_last_value(get_variable()->get_value());
+ set_last_value(get_rate());
}
} // namespace resource