double actionHeapTopDate() const { return action_heap_.top().first; }
Action* actionHeapPop();
- bool actionHeapIsEmpty() const { return action_heap_.empty(); }
/**
* @brief Share the resources between the actions
}
// hereafter must have already the min value for this resource model
- if (not actionHeapIsEmpty()) {
+ if (not action_heap_.empty()) {
double min = actionHeapTopDate() - now;
XBT_DEBUG("minimum with the HEAP %f", min);
return min;
void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
{
- while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
+ while (not get_action_heap().empty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
CpuAction* action = static_cast<CpuAction*>(actionHeapPop());
XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
}
/* get the min next event if heap not empty */
- if (not actionHeapIsEmpty())
+ if (not get_action_heap().empty())
min_action_duration = actionHeapTopDate() - now;
XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
void CpuTiModel::update_actions_state(double now, double /*delta*/)
{
- while (not actionHeapIsEmpty() && actionHeapTopDate() <= now) {
+ while (not get_action_heap().empty() && actionHeapTopDate() <= now) {
CpuTiAction* action = static_cast<CpuTiAction*>(actionHeapPop());
XBT_DEBUG("Action %p: finish", action);
action->finish(kernel::resource::Action::State::done);
void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
{
- while (not actionHeapIsEmpty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
+ while (not get_action_heap().empty() && double_equals(actionHeapTopDate(), now, sg_surf_precision)) {
NetworkCm02Action* action = static_cast<NetworkCm02Action*>(actionHeapPop());
XBT_DEBUG("Something happened to action %p", action);