- if ((action->getRemains() <= 0) &&
- (lmm_get_variable_weight(action->getVariable()) > 0)) {
- action->finish();
- action->setState(Action::State::done);
- } else if ((action->getMaxDuration() != NO_MAX_DURATION) &&
- (action->getMaxDuration() <= 0)) {
- action->finish();
- action->setState(Action::State::done);
- } else {
- /* Need to check that none of the model has failed */
- lmm_constraint_t cnst = nullptr;
- int i = 0;
-
- while ((cnst = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i++))) {
- void *constraint_id = lmm_constraint_id(cnst);
- if (static_cast<simgrid::surf::Resource*>(constraint_id)->isOff()) {
- XBT_DEBUG("Action (%p) Failed!!", action);
- action->finish();
- action->setState(Action::State::failed);
- break;
- }
+ if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
+ ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
+ action.finish(kernel::resource::Action::State::FINISHED);
+ continue;
+ }
+
+ /* Need to check that none of the model has failed */
+ int i = 0;
+ kernel::lmm::Constraint* cnst = action.get_variable()->get_constraint(i);
+ while (cnst != nullptr) {
+ i++;
+ void* constraint_id = cnst->get_id();
+ if (not static_cast<simgrid::kernel::resource::Resource*>(constraint_id)->is_on()) {
+ XBT_DEBUG("Action (%p) Failed!!", &action);
+ action.finish(kernel::resource::Action::State::FAILED);
+ break;