* @param delta Amount to remove from the remaining time */
void update_remains(double delta);
+ virtual void update_remains_lazy(double now) = 0;
+
/** @brief Set the remaining time of the current action */
void set_remains(double value) { remains_ = value; }
boost::optional<heap_type::handle_type> heap_handle_ = boost::none;
public:
- virtual void updateRemainingLazy(double now) = 0;
void heapInsert(heap_type& heap, double key, Action::Type hat);
void heapRemove(heap_type& heap);
void heapUpdate(heap_type& heap, double key, Action::Type hat);
if (get_model()->getUpdateMechanism() == UM_LAZY && state_set_ == get_model()->getRunningActionSet() &&
sharing_priority_ > 0) {
// If we have a lazy model, we need to update the remaining value accordingly
- updateRemainingLazy(surf_get_clock());
+ update_remains_lazy(surf_get_clock());
}
}
suspended_ = SuspendStates::suspended;
XBT_IN("(%p)", this);
/* update remains before return it */
if (get_model()->getUpdateMechanism() == UM_LAZY) /* update remains before return it */
- updateRemainingLazy(surf_get_clock());
+ update_remains_lazy(surf_get_clock());
XBT_OUT();
return remains_;
}
if (action->get_priority() <= 0 || action->getType() == Action::Type::LATENCY)
continue;
- action->updateRemainingLazy(now);
+ action->update_remains_lazy(now);
double min = -1;
double share = action->getVariable()->get_value();
* Action *
**********/
-void CpuAction::updateRemainingLazy(double now)
+void CpuAction::update_remains_lazy(double now)
{
xbt_assert(get_state_set() == get_model()->getRunningActionSet(), "You're updating an action that is not running.");
xbt_assert(get_priority() > 0, "You're updating an action that seems suspended.");
void set_state(simgrid::kernel::resource::Action::State state) override;
- void updateRemainingLazy(double now) override;
+ void update_remains_lazy(double now) override;
std::list<Cpu*> cpus();
void suspend() override;
* Action *
**********/
-void NetworkCm02Action::updateRemainingLazy(double now)
+void NetworkCm02Action::update_remains_lazy(double now)
{
if (suspended_ != Action::SuspendStates::not_suspended)
return;
public:
NetworkCm02Action(kernel::resource::Model* model, double cost, bool failed) : NetworkAction(model, cost, failed){};
virtual ~NetworkCm02Action() = default;
- void updateRemainingLazy(double now) override;
+ void update_remains_lazy(double now) override;
};
}
}
NetworkConstantAction::~NetworkConstantAction() = default;
-void NetworkConstantAction::updateRemainingLazy(double /*now*/)
+void NetworkConstantAction::update_remains_lazy(double /*now*/)
{
THROW_IMPOSSIBLE;
}
NetworkConstantAction(NetworkConstantModel *model_, double size, double latency);
~NetworkConstantAction();
double initialLatency_;
- void updateRemainingLazy(double now) override;
+ void update_remains_lazy(double now) override;
};
}
{
THROW_UNIMPLEMENTED;
}
-void NetworkNS3Action::updateRemainingLazy(double /*now*/)
+void NetworkNS3Action::update_remains_lazy(double /*now*/)
{
THROW_IMPOSSIBLE;
}
void suspend() override;
void resume() override;
std::list<LinkImpl*> links() override;
- void updateRemainingLazy(double now) override;
+ void update_remains_lazy(double now) override;
// private:
double lastSent_ = 0;
{
THROW_UNIMPLEMENTED;
}
-void StorageN11Action::updateRemainingLazy(double /*now*/)
+void StorageN11Action::update_remains_lazy(double /*now*/)
{
THROW_IMPOSSIBLE;
}
bool isSuspended() override;
void set_max_duration(double duration) override;
void set_priority(double priority) override;
- void updateRemainingLazy(double now) override;
+ void update_remains_lazy(double now) override;
};
}