action.get_state() == kernel::resource::Action::State::not_in_the_system) {
action.set_finish_time(date);
action.set_state(kernel::resource::Action::State::failed);
- action.heapRemove(model()->getActionHeap());
+ action.heapRemove();
}
}
}
action.set_finish_time(speedIntegratedTrace_->solve(now, total_area));
/* verify which event will happen before (max_duration or finish time) */
if (action.get_max_duration() > NO_MAX_DURATION &&
- action.get_start_time() + action.get_max_duration() < action.getFinishTime())
+ action.get_start_time() + action.get_max_duration() < action.get_finish_time())
min_finish = action.get_start_time() + action.get_max_duration();
else
- min_finish = action.getFinishTime();
+ min_finish = action.get_finish_time();
} else {
/* put the max duration time on heap */
if (action.get_max_duration() > NO_MAX_DURATION)
}
/* add in action heap */
if (min_finish > NO_MAX_DURATION)
- action.heapUpdate(model()->getActionHeap(), min_finish, kernel::resource::Action::Type::NOTSET);
+ action.heapUpdate(min_finish, kernel::resource::Action::Type::NOTSET);
else
- action.heapRemove(model()->getActionHeap());
+ action.heapRemove();
XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
- &action, action.get_start_time(), action.getFinishTime(), action.get_max_duration());
+ &action, action.get_start_time(), action.get_finish_time(), action.get_max_duration());
}
/* remove from modified cpu */
modified(false);
continue;
/* skip action that are finishing now */
- if (action.getFinishTime() >= 0 && action.getFinishTime() <= now)
+ if (action.get_finish_time() >= 0 && action.get_finish_time() <= now)
continue;
/* update remaining */
if (action_ti_hook.is_linked())
simgrid::xbt::intrusive_erase(cpu_->actionSet_, *this);
/* remove from heap */
- heapRemove(get_model()->getActionHeap());
+ heapRemove();
cpu_->modified(true);
}
void CpuTiAction::cancel()
{
this->set_state(Action::State::failed);
- heapRemove(get_model()->getActionHeap());
+ heapRemove();
cpu_->modified(true);
}
XBT_IN("(%p)", this);
if (suspended_ != Action::SuspendStates::sleeping) {
suspended_ = Action::SuspendStates::suspended;
- heapRemove(get_model()->getActionHeap());
+ heapRemove();
cpu_->modified(true);
}
XBT_OUT();
Action::set_max_duration(duration);
if (duration >= 0)
- min_finish = (get_start_time() + get_max_duration()) < getFinishTime() ? (get_start_time() + get_max_duration())
- : getFinishTime();
+ min_finish = (get_start_time() + get_max_duration()) < get_finish_time() ? (get_start_time() + get_max_duration())
+ : get_finish_time();
else
- min_finish = getFinishTime();
+ min_finish = get_finish_time();
/* add in action heap */
- heapUpdate(get_model()->getActionHeap(), min_finish, Action::Type::NOTSET);
+ heapUpdate(min_finish, Action::Type::NOTSET);
XBT_OUT();
}