Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define helper methods to access actionHeap_.
[simgrid.git] / src / surf / cpu_ti.cpp
index 8818c21..42d080f 100644 (file)
@@ -359,8 +359,8 @@ double CpuTiModel::nextOccuringEvent(double now)
   }
 
 /* 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);
 
@@ -369,8 +369,8 @@ double CpuTiModel::nextOccuringEvent(double now)
 
 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 */