for (Element const& elem : cnst.disabled_element_set_) {
// We should have staged variables only if concurrency is reached in some constraint
xbt_assert(cnst.get_concurrency_limit() < 0 || elem.variable->staged_penalty_ == 0 ||
- elem.variable->get_min_concurrency_slack() < elem.variable->concurrency_share_,
+ elem.variable->get_min_concurrency_slack() == 0,
"should not have staged variable!");
}
sharing_penalty_ = sharing_penalty;
staged_penalty_ = 0.0;
bound_ = bound_value;
- concurrency_share_ = 1;
value_ = 0.0;
visited_ = visited_value;
mu_ = 0.0;
if (enabling_var) {
var->staged_penalty_ = penalty;
int minslack = var->get_min_concurrency_slack();
- if (minslack < var->concurrency_share_) {
- XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack %i, with penalty %f and concurrency"
- " share %i",
- minslack, penalty, var->concurrency_share_);
+ if (minslack == 0) {
+ XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack is 0");
return;
}
XBT_DEBUG("Enabling var with min concurrency slack %i", minslack);
/** @brief Get the maximum value of the variable (-1.0 if no specified maximum) */
double get_bound() const { return bound_; }
- /**
- * @brief Set the concurrent share of the variable
- * @param value The new concurrency share
- */
- void set_concurrency_share(short int value) { concurrency_share_ = value; }
-
/**
* @brief Get the numth constraint associated to the variable
* @param num The rank of constraint we want to get
/** @brief Check if a variable can be enabled
* Make sure to set staged_penalty before, if your intent is only to check concurrency
*/
- bool can_enable() const { return staged_penalty_ > 0 && get_min_concurrency_slack() >= concurrency_share_; }
+ bool can_enable() const { return staged_penalty_ > 0 && get_min_concurrency_slack() > 0; }
/* hookup to system */
boost::intrusive::list_member_hook<> variable_set_hook_;
met */
double bound_;
double value_;
- short int concurrency_share_; /* The maximum number of elements that variable will add to a constraint */
resource::Action* id_;
int rank_; // Only used in debug messages to identify the variable
unsigned visited_; /* used by System::update_modified_cnst_set() */
if (link->get_sharing_policy() != s4u::Link::SharingPolicy::WIFI)
get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), .05);
}
- // Change concurrency_share here, if you want that cross-traffic is included in the SURF concurrency
- // (You would also have to change simgrid::kernel::lmm::Element::get_concurrency())
- // action->getVariable()->set_concurrency_share(2)
}
}
var = Sys.variable_new(nullptr, 1.0, -1.0, nb_elem);
//Have a few variables with a concurrency share of two (e.g. cross-traffic in some cases)
short concurrency_share = 1 + static_cast<short>(simgrid::xbt::random::uniform_int(0, max_share - 1));
- var->set_concurrency_share(concurrency_share);
std::vector<int> used(nb_cnst, 0);
for (int j = 0; j < nb_elem; j++) {