Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
preshot sonar (dead code; equality test between double)
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 3 Feb 2022 21:27:18 +0000 (22:27 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 3 Feb 2022 21:42:10 +0000 (22:42 +0100)
src/kernel/resource/WifiLinkImpl.cpp
src/surf/network_cm02.cpp

index f4c9b75..66c0652 100644 (file)
@@ -77,8 +77,6 @@ void WifiLinkImpl::refresh_decay_bandwidths()
     double min_bw     = bandwidth.peak - (wifi_max_rate_ - wifi_min_rate_);
     double model_rate = bandwidth.peak - (wifi_max_rate_ - model_rate_);
 
-    //xbt_assert(min_bw > 0, "Your WIFI link is using bandwidth(s) which is too low for the decay model.");
-
     double N0     = max_bw - min_bw;
     double lambda = (-log(model_rate - min_bw) + log(N0)) / model_n_;
     // Since decay model start at 0 we should use (nSTA-1)
index 29604a5..7076236 100644 (file)
@@ -223,19 +223,18 @@ void NetworkCm02Model::comm_action_expand_constraints(const s4u::Host* src, cons
   /* WI-FI links needs special treatment, do it here */
   if (src_wifi_link != nullptr) {
     /* In case of 0Mbps data rate, don't consider it in the LMM */
-    if (src_wifi_link->get_host_rate(src) != 0)
+    if (src_wifi_link->get_host_rate(src) > 0)
       get_maxmin_system()->expand(src_wifi_link->get_constraint(), action->get_variable(),
                                   1.0 / src_wifi_link->get_host_rate(src));
     else
       get_maxmin_system()->update_variable_penalty(action->get_variable(), 0);
   }
   if (dst_wifi_link != nullptr) {
-    if (dst_wifi_link->get_host_rate(dst) != 0)
+    if (dst_wifi_link->get_host_rate(dst) > 0)
       get_maxmin_system()->expand(dst_wifi_link->get_constraint(), action->get_variable(),
                                   1.0 / dst_wifi_link->get_host_rate(dst));
-    else {
+    else
       get_maxmin_system()->update_variable_penalty(action->get_variable(), 0);
-    }
   }
 
   for (auto const* link : route) {