Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / src / kernel / lmm / fair_bottleneck.cpp
index 1db0704..98397a6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2021. 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. */
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin);
 
-simgrid::kernel::lmm::System* simgrid::kernel::lmm::make_new_fair_bottleneck_system(bool selective_update)
-{
-  return new simgrid::kernel::lmm::FairBottleneck(selective_update);
-}
-
 void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
 {
   if (not modified_)
@@ -67,7 +62,7 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
       int nb = 0;
       XBT_DEBUG("Processing cnst %p ", &cnst);
       cnst.usage_ = 0.0;
-      for (Element& elem : cnst.enabled_element_set_) {
+      for (const Element& elem : cnst.enabled_element_set_) {
         xbt_assert(elem.variable->sharing_penalty_ > 0);
         if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook_.is_linked())
           nb++;
@@ -108,14 +103,14 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
       Constraint& cnst = *iter;
       XBT_DEBUG("Updating cnst %p ", &cnst);
       if (cnst.sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE) {
-        for (Element& elem : cnst.enabled_element_set_) {
+        for (const Element& elem : cnst.enabled_element_set_) {
           xbt_assert(elem.variable->sharing_penalty_ > 0);
           XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g", &cnst, cnst.remaining_, elem.variable,
                     elem.variable->mu_);
           double_update(&cnst.remaining_, elem.consumption_weight * elem.variable->mu_, sg_maxmin_precision);
         }
       } else {
-        for (Element& elem : cnst.enabled_element_set_) {
+        for (const Element& elem : cnst.enabled_element_set_) {
           xbt_assert(elem.variable->sharing_penalty_ > 0);
           XBT_DEBUG("\tNon-Shared variable. Update constraint usage of %p (%g) with variable %p by %g", &cnst,
                     cnst.usage_, elem.variable, elem.variable->mu_);
@@ -130,7 +125,7 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
         XBT_DEBUG("\tGet rid of constraint %p", &cnst);
 
         iter = cnst_list.erase(iter);
-        for (Element& elem : cnst.enabled_element_set_) {
+        for (const Element& elem : cnst.enabled_element_set_) {
           if (elem.variable->sharing_penalty_ <= 0)
             break;
           if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook_.is_linked()) {