]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/resource/WifiLinkImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't use ucontextes on Apple hosts
[simgrid.git] / src / kernel / resource / WifiLinkImpl.cpp
index 92ebf0b7aa65dabe654374f44325af2b85674a80..0d5ed178017d77d5c76d292c40379b0e226f87b8 100644 (file)
@@ -1,13 +1,12 @@
-/* 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. */
 
 #include <simgrid/s4u/Host.hpp>
 
-#include "src/kernel/resource/WifiLinkImpl.hpp"
-#include "src/surf/surf_interface.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
+#include "src/kernel/resource/WifiLinkImpl.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 
@@ -82,7 +81,7 @@ void WifiLinkImpl::dec_active_flux()
 
 void WifiLinkImpl::update_bw_comm_start(const kernel::activity::CommImpl& comm)
 {
-  auto const* actionWifi = dynamic_cast<const simgrid::kernel::resource::WifiLinkAction*>(comm.surf_action_);
+  auto const* actionWifi = dynamic_cast<const simgrid::kernel::resource::WifiLinkAction*>(comm.model_action_);
   if (actionWifi == nullptr)
     return;
 
@@ -114,7 +113,7 @@ void WifiLinkImpl::update_bw_comm_end(const simgrid::kernel::resource::NetworkAc
 
 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);