Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
transitions in the same actor are dependent
[simgrid.git] / src / plugins / link_energy_wifi.cpp
index 5b46eb975f89f07549de34515a975c85017bef21..481f1f2400ce4a9d9e6a525741ebdbc523cc2acd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-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. */
@@ -10,6 +10,7 @@
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/resource/StandardLinkImpl.hpp"
 #include "src/kernel/resource/WifiLinkImpl.hpp"
+#include "src/simgrid/module.hpp"
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
@@ -214,7 +215,7 @@ void LinkEnergyWifi::init_watts_range_list()
     try {
       control_duration_ = std::stod(beacons_factor);
     } catch (const std::invalid_argument&) {
-      throw std::invalid_argument(std::string("Invalid beacons factor value for link ") + this->link_->get_cname());
+      throw std::invalid_argument("Invalid beacons factor value for link " + this->link_->get_name());
     }
   }
 
@@ -237,22 +238,22 @@ void LinkEnergyWifi::init_watts_range_list()
       try {
         pSleep_ = std::stod(current_power_values.at(3));
       } catch (const std::invalid_argument&) {
-        throw std::invalid_argument(std::string("Invalid idle power value for link ") + this->link_->get_cname());
+        throw std::invalid_argument("Invalid idle power value for link " + this->link_->get_name());
       }
       try {
         pRx_ = std::stod(current_power_values.at(2));
       } catch (const std::invalid_argument&) {
-        throw std::invalid_argument(std::string("Invalid idle power value for link ") + this->link_->get_cname());
+        throw std::invalid_argument("Invalid idle power value for link " + this->link_->get_name());
       }
       try {
         pTx_ = std::stod(current_power_values.at(1));
       } catch (const std::invalid_argument&) {
-        throw std::invalid_argument(std::string("Invalid idle power value for link ") + this->link_->get_cname());
+        throw std::invalid_argument("Invalid idle power value for link " + this->link_->get_name());
       }
       try {
         pIdle_ = std::stod(current_power_values.at(0));
       } catch (const std::invalid_argument&) {
-        throw std::invalid_argument(std::string("Invalid busy power value for link ") + this->link_->get_cname());
+        throw std::invalid_argument("Invalid busy power value for link " + this->link_->get_name());
       }
 
       XBT_DEBUG("Values aa initialized with: pSleep=%f pIdle=%f pTx=%f pRx=%f", pSleep_, pIdle_, pTx_, pRx_);