-/* Copyright (c) 2019-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2019-2023. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
return host_rates_.size();
}
-double WifiLinkImpl::wifi_link_dynamic_sharing(const WifiLinkImpl& link, double /*capacity*/, int n)
+double WifiLinkImpl::wifi_link_dynamic_sharing(const WifiLinkImpl& link, double /*capacity*/, int /*n*/)
{
- double ratio = link.get_max_ratio(n);
- XBT_DEBUG("New ratio value concurrency %d: %lf of link capacity on link %s", n, ratio, link.get_name().c_str());
+ double ratio = link.get_max_ratio();
+ XBT_DEBUG("New ratio value concurrency %d: %lf of link capacity on link %s", link.nb_active_flux_, ratio, link.get_name().c_str());
return ratio;
}
}
}
-double WifiLinkImpl::get_max_ratio(int nb_active_flux) const
+double WifiLinkImpl::get_max_ratio() const
{
- double new_peak = -1;
+ 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);