-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2020. 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. */
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++;
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_);
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()) {