int n = action->getVariable()->get_number_of_constraint();
for (int i = 0; i < n; i++){
- lmm_constraint_t constraint = action->getVariable()->get_constraint(i);
+ kernel::lmm::Constraint* constraint = action->getVariable()->get_constraint(i);
NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
double value = action->getVariable()->get_value() * action->getVariable()->get_constraint_weight(i);
TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), value, action->getLastUpdate(),
}
// if I am wearing a latency hat
- if (action->getHat() == LATENCY) {
+ if (action->getType() == Action::Type::LATENCY) {
XBT_DEBUG("Latency paid for action %p. Activating", action);
maxminSystem_->update_variable_weight(action->getVariable(), action->weight_);
action->heapRemove(getActionHeap());
action->refreshLastUpdate();
// if I am wearing a max_duration or normal hat
- } else if (action->getHat() == MAX_DURATION || action->getHat() == NORMAL) {
- // no need to communicate anymore
- // assume that flows that reached max_duration have remaining of 0
+ } else if (action->getType() == Action::Type::MAX_DURATION || action->getType() == Action::Type::NORMAL) {
+ // no need to communicate anymore
+ // assume that flows that reached max_duration have remaining of 0
XBT_DEBUG("Action %p finished", action);
action->setRemains(0);
action->finish(Action::State::done);
if (TRACE_is_enabled()) {
int n = action.getVariable()->get_number_of_constraint();
for (int i = 0; i < n; i++) {
- lmm_constraint_t constraint = action.getVariable()->get_constraint(i);
+ kernel::lmm::Constraint* constraint = action.getVariable()->get_constraint(i);
NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
TRACE_surf_link_set_utilization(
link->getCname(), action.getCategory(),
if (getUpdateMechanism() == UM_LAZY) {
// add to the heap the event when the latency is payed
XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency_ + action->getLastUpdate());
- action->heapInsert(getActionHeap(), action->latency_ + action->getLastUpdate(), route.empty() ? NORMAL : LATENCY);
+ action->heapInsert(getActionHeap(), action->latency_ + action->getLastUpdate(),
+ route.empty() ? Action::Type::NORMAL : Action::Type::LATENCY);
}
} else
action->setVariable(maxminSystem_->variable_new(action, 1.0, -1.0, constraints_per_variable));
if (value > 0)
turnOn();
else {
- lmm_variable_t var = nullptr;
+ kernel::lmm::Variable* var = nullptr;
const_lmm_element_t elem = nullptr;
double now = surf_get_clock();
if (sg_weight_S_parameter > 0) {
double delta = sg_weight_S_parameter / value - sg_weight_S_parameter / (bandwidth_.peak * bandwidth_.scale);
- lmm_variable_t var;
+ kernel::lmm::Variable* var;
const_lmm_element_t elem = nullptr;
const_lmm_element_t nextelem = nullptr;
int numelem = 0;
void NetworkCm02Link::setLatency(double value)
{
double delta = value - latency_.peak;
- lmm_variable_t var = nullptr;
+ kernel::lmm::Variable* var = nullptr;
const_lmm_element_t elem = nullptr;
const_lmm_element_t nextelem = nullptr;
int numelem = 0;