public:
/* Lazy update needs this Set hook to maintain a list of the tracked actions */
boost::intrusive::list_member_hook<> modified_set_hook_;
- bool isLinkedModifiedSet() const { return modified_set_hook_.is_linked(); }
+ bool is_within_modified_set() const { return modified_set_hook_.is_linked(); }
typedef boost::intrusive::list<
Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>
ModifiedSet;
/** @brief Get the start time of the current action */
double get_start_time() const { return start_time_; }
/** @brief Get the finish time of the current action */
- double getFinishTime() const { return finish_time_; }
+ double get_finish_time() const { return finish_time_; }
/** @brief Get the user data associated to the current action */
void* get_data() const { return data_; }
/**@brief Add a reference to the current action (refcounting) */
void ref();
/** @brief Unref that action (and destroy it if refcount reaches 0)
- * @return true if the action was destroyed and false if someone still has references on it
- */
+ * @return true if the action was destroyed and false if someone still has references on it */
int unref();
/** @brief Cancel the current Action if running */
virtual void resume();
/** @brief Returns true if the current action is running */
- virtual bool isSuspended();
+ bool is_suspended();
/** @brief Get the maximum duration of the current action */
double get_max_duration() const { return max_duration_; }
elem.make_active();
simgrid::kernel::resource::Action* action = static_cast<simgrid::kernel::resource::Action*>(elem.variable->id);
- if (modified_set_ && not action->isLinkedModifiedSet())
+ if (modified_set_ && not action->is_within_modified_set())
modified_set_->push_back(*action);
}
}
XBT_OUT();
}
-bool Action::isSuspended()
+bool Action::is_suspended()
{
return suspended_ == SuspendStates::suspended;
}
sd_global->completed_tasks->insert(task);
task->start_time = task->surf_action->get_start_time();
if (new_state == SD_DONE){
- task->finish_time = task->surf_action->getFinishTime();
+ task->finish_time = task->surf_action->get_finish_time();
#if SIMGRID_HAVE_JEDULE
jedule_log_sd_event(task);
#endif
double SD_task_get_finish_time(SD_task_t task)
{
if (task->surf_action) /* should never happen as actions are destroyed right after their completion */
- return task->surf_action->getFinishTime();
+ return task->surf_action->get_finish_time();
else
return task->finish_time;
}
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)
action.heapRemove(model()->getActionHeap());
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 */
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);
double_update(&deltap, action.latency_, sg_surf_precision);
action.latency_ = 0.0;
}
- if (action.latency_ <= 0.0 && not action.isSuspended())
+ if (action.latency_ <= 0.0 && not action.is_suspended())
maxmin_system_->update_variable_weight(action.getVariable(), action.weight_);
}
if (TRACE_is_enabled()) {
while ((var = constraint()->get_variable_safe(&elem, &nextelem, &numelem))) {
NetworkCm02Action* action = static_cast<NetworkCm02Action*>(var->get_id());
action->weight_ += delta;
- if (not action->isSuspended())
+ if (not action->is_suspended())
model()->getMaxminSystem()->update_variable_weight(action->getVariable(), action->weight_);
}
}
XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f", action->latCurrent_);
}
}
- if (not action->isSuspended())
+ if (not action->is_suspended())
model()->getMaxminSystem()->update_variable_weight(action->getVariable(), action->weight_);
}
}
THROW_IMPOSSIBLE;
}
-/* Test whether a flow is suspended */
-bool NetworkNS3Action::isSuspended()
-{
- return false;
-}
-
}
}
public:
NetworkNS3Action(kernel::resource::Model* model, double cost, s4u::Host* src, s4u::Host* dst);
- bool isSuspended() override;
void suspend() override;
void resume() override;
std::list<LinkImpl*> links() override;
} else {
action.latency_ = 0.0;
}
- if ((action.latency_ <= 0.0) && (action.isSuspended() == 0)) {
+ if ((action.latency_ <= 0.0) && (action.is_suspended() == 0)) {
action.updateBound();
maxmin_system_->update_variable_weight(action.getVariable(), 1.0);
}
THROW_UNIMPLEMENTED;
}
-bool StorageN11Action::isSuspended()
-{
- return suspended_ == Action::SuspendStates::suspended;
-}
-
void StorageN11Action::set_max_duration(double /*duration*/)
{
THROW_UNIMPLEMENTED;
void suspend() override;
void cancel() override;
void resume() override;
- bool isSuspended() override;
void set_max_duration(double duration) override;
void set_priority(double priority) override;
void update_remains_lazy(double now) override;