+ double new_peak;
+ if (nb_active_flux_ > conc_lim_) {
+ new_peak = (nb_active_flux_-conc_lim_) * co_acc_ + x0_;
+ XBT_DEBUG("Wi-Fi link peak=(%d-%d)*%lf+%lf=%lf", nb_active_flux_, conc_lim_, co_acc_, x0_, new_peak);
+ } else {
+ new_peak = x0_;
+ XBT_DEBUG("Wi-Fi link peak=%lf", x0_);
+ }
+ // should be the new maximum bandwidth ratio (comparison between max throughput without concurrency and with it)
+ double propCap = new_peak / x0_;
+
+ return propCap;
+}
+
+bool WifiLinkImpl::toggle_callback()
+{
+ if (not use_callback_) {
+ XBT_DEBUG("Activate throughput reduction mechanism");
+ use_callback_ = true;
+ this->set_sharing_policy(
+ simgrid::s4u::Link::SharingPolicy::WIFI,
+ std::bind(&wifi_link_dynamic_sharing, std::cref(*this), std::placeholders::_1, std::placeholders::_2));
+ }
+ return use_callback_;