- modified_ = true;
-
- // Check if this variable already has an active element in this constraint
- // If it does, subtract it from the required slack
- int current_share = 0;
- if (var->concurrency_share_ > 1) {
- for (const Element& elem : var->cnsts_) {
- if (elem.constraint == cnst && elem.enabled_element_set_hook.is_linked())
- current_share += elem.get_concurrency();
- }
- }
-
- // Check if we need to disable the variable
- if (var->sharing_penalty_ > 0 && var->concurrency_share_ - current_share > cnst->get_concurrency_slack()) {
- double penalty = var->sharing_penalty_;
- disable_var(var);
- for (Element const& elem : var->cnsts_)
- on_disabled_var(elem.constraint);
- consumption_weight = 0;
- var->staged_penalty_ = penalty;
- xbt_assert(not var->sharing_penalty_);
- }
-