}
/* get the min next event if heap not empty */
- if (xbt_heap_size(getActionHeap()) > 0)
- min_action_duration = xbt_heap_maxkey(getActionHeap()) - now;
+ if (not actionHeapIsEmpty())
+ min_action_duration = actionHeapTopDate() - now;
XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
void CpuTiModel::updateActionsState(double now, double /*delta*/)
{
- while ((xbt_heap_size(getActionHeap()) > 0) && (xbt_heap_maxkey(getActionHeap()) <= now)) {
- CpuTiAction* action = static_cast<CpuTiAction*>(xbt_heap_pop(getActionHeap()));
+ while (not actionHeapIsEmpty() && actionHeapTopDate() <= now) {
+ CpuTiAction* action = static_cast<CpuTiAction*>(actionHeapPop());
XBT_DEBUG("Action %p: finish", action);
action->finish(Action::State::done);
/* set the remains to 0 due to precision problems when updating the remaining amount */