Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
finish snake_casing resource::Action
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Mar 2018 19:49:37 +0000 (21:49 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Mar 2018 19:49:37 +0000 (21:49 +0200)
22 files changed:
include/simgrid/kernel/resource/Action.hpp
src/kernel/activity/CommImpl.cpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/SynchroIo.cpp
src/kernel/resource/Action.cpp
src/kernel/resource/Model.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/simdag/sd_task.cpp
src/simix/libsmx.cpp
src/simix/smx_host.cpp
src/surf/HostImpl.cpp
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/network_cm02.cpp
src/surf/network_constant.cpp
src/surf/network_ns3.cpp
src/surf/ptask_L07.cpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
teshsuite/surf/surf_usage/surf_usage.cpp

index 47efce3..b42d5b4 100644 (file)
@@ -105,27 +105,28 @@ public:
   void set_data(void* data) { data_ = data; }
 
   /** @brief Get the cost of the current action */
-  double getCost() const { return cost_; }
+  double get_cost() const { return cost_; }
   /** @brief Set the cost of the current action */
-  void setCost(double cost) { cost_ = cost; }
+  void set_cost(double cost) { cost_ = cost; }
 
   /** @brief Update the maximum duration of the current action
    *  @param delta Amount to remove from the MaxDuration */
-  void updateMaxDuration(double delta);
+  void update_max_duration(double delta);
 
   /** @brief Update the remaining time of the current action
    *  @param delta Amount to remove from the remaining time */
-  void updateRemains(double delta);
+  void update_remains(double delta);
 
   /** @brief Set the remaining time of the current action */
-  void setRemains(double value) { remains_ = value; }
+  void set_remains(double value) { remains_ = value; }
+
   /** @brief Get the remaining time of the current action after updating the resource */
-  virtual double getRemains();
+  virtual double get_remains();
   /** @brief Get the remaining time of the current action without updating the resource */
-  double getRemainsNoUpdate() const { return remains_; }
+  double get_remains_no_update() const { return remains_; }
 
   /** @brief Set the finish time of the current action */
-  void setFinishTime(double value) { finish_time_ = value; }
+  void set_finish_time(double value) { finish_time_ = value; }
 
   /**@brief Add a reference to the current action (refcounting) */
   void ref();
@@ -147,32 +148,32 @@ public:
   virtual bool isSuspended();
 
   /** @brief Get the maximum duration of the current action */
-  double getMaxDuration() const { return max_duration_; }
+  double get_max_duration() const { return max_duration_; }
   /** @brief Set the maximum duration of the current Action */
-  virtual void setMaxDuration(double duration);
+  virtual void set_max_duration(double duration);
 
   /** @brief Get the tracing category associated to the current action */
-  char* getCategory() const { return category_; }
+  char* get_category() const { return category_; }
   /** @brief Set the tracing category of the current Action */
-  void setCategory(const char* category);
+  void set_category(const char* category);
 
   /** @brief Get the priority of the current Action */
-  double getPriority() const { return sharing_weight_; };
+  double get_priority() const { return sharing_priority_; };
   /** @brief Set the priority of the current Action */
-  virtual void setSharingWeight(double priority);
-  void setSharingWeightNoUpdate(double weight) { sharing_weight_ = weight; }
+  virtual void set_priority(double priority);
+  void set_priority_no_update(double priority) { sharing_priority_ = priority; }
 
   /** @brief Get the state set in which the action is */
-  StateSet* getStateSet() const { return state_set_; };
+  StateSet* get_state_set() const { return state_set_; };
 
-  simgrid::kernel::resource::Model* getModel() const { return model_; }
+  simgrid::kernel::resource::Model* get_model() const { return model_; }
 
 protected:
   StateSet* state_set_;
   int refcount_ = 1;
 
 private:
-  double sharing_weight_ = 1.0;             /**< priority (1.0 by default) */
+  double sharing_priority_ = 1.0;             /**< priority (1.0 by default) */
   double max_duration_   = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
   double remains_;           /**< How much of that cost remains to be done in the currently running task */
   double start_time_;        /**< start time  */
index bbcce11..129aeaf 100644 (file)
@@ -72,7 +72,7 @@ void simgrid::kernel::activity::CommImpl::cancel()
 /**  @brief get the amount remaining from the communication */
 double simgrid::kernel::activity::CommImpl::remains()
 {
-  return surfAction_->getRemains();
+  return surfAction_->get_remains();
 }
 
 /** @brief This is part of the cleanup process, probably an internal command */
index e5eba51..521785d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -34,14 +34,14 @@ simgrid::kernel::activity::ExecImpl::~ExecImpl()
 
 void simgrid::kernel::activity::ExecImpl::suspend()
 {
-  XBT_VERB("This exec is suspended (remain: %f)", surfAction_->getRemains());
+  XBT_VERB("This exec is suspended (remain: %f)", surfAction_->get_remains());
   if (surfAction_)
     surfAction_->suspend();
 }
 
 void simgrid::kernel::activity::ExecImpl::resume()
 {
-  XBT_VERB("This exec is resumed (remain: %f)", surfAction_->getRemains());
+  XBT_VERB("This exec is resumed (remain: %f)", surfAction_->get_remains());
   if (surfAction_)
     surfAction_->resume();
 }
@@ -52,15 +52,15 @@ double simgrid::kernel::activity::ExecImpl::remains()
                                "We would need to return a vector instead of a scalar. "
                                "Did you mean remainingRatio() instead?");
 
-  return surfAction_ ? surfAction_->getRemains() : 0;
+  return surfAction_ ? surfAction_->get_remains() : 0;
 }
 
 double simgrid::kernel::activity::ExecImpl::remainingRatio()
 {
   if (host_ == nullptr) // parallel task: their remain is already between 0 and 1 (see comment in ExecImpl::remains())
-    return surfAction_->getRemains();
+    return surfAction_->get_remains();
   else // Actually compute the ratio for sequential tasks
-    return surfAction_->getRemains() / surfAction_->getCost();
+    return surfAction_->get_remains() / surfAction_->get_cost();
 }
 
 void simgrid::kernel::activity::ExecImpl::setBound(double bound)
@@ -105,10 +105,10 @@ simgrid::kernel::activity::ExecImpl::migrate(simgrid::s4u::Host* to)
 
   if (not MC_is_active() && not MC_record_replay_is_active()) {
     simgrid::kernel::resource::Action* oldAction = this->surfAction_;
-    simgrid::kernel::resource::Action* newAction = to->pimpl_cpu->execution_start(oldAction->getCost());
-    newAction->setRemains(oldAction->getRemains());
+    simgrid::kernel::resource::Action* newAction = to->pimpl_cpu->execution_start(oldAction->get_cost());
+    newAction->set_remains(oldAction->get_remains());
     newAction->set_data(this);
-    newAction->setSharingWeight(oldAction->getPriority());
+    newAction->set_priority(oldAction->get_priority());
 
     // FIXME: the user-defined bound seem to not be kept by LMM, that seem to overwrite it for the multi-core modeling.
     // I hope that the user did not provide any.
index 3f4e149..e0158cf 100644 (file)
@@ -25,10 +25,10 @@ void simgrid::kernel::activity::IoImpl::post()
   for (smx_simcall_t const& simcall : simcalls) {
     switch (simcall->call) {
       case SIMCALL_STORAGE_WRITE:
-        simcall_storage_write__set__result(simcall, surf_io->getCost());
+        simcall_storage_write__set__result(simcall, surf_io->get_cost());
         break;
       case SIMCALL_STORAGE_READ:
-        simcall_storage_read__set__result(simcall, surf_io->getCost());
+        simcall_storage_read__set__result(simcall, surf_io->get_cost());
         break;
       default:
         break;
index 4281441..b21dbba 100644 (file)
@@ -23,9 +23,9 @@ Action::Action(simgrid::kernel::resource::Model* model, double cost, bool failed
     : remains_(cost), start_time_(surf_get_clock()), cost_(cost), model_(model), variable_(var)
 {
   if (failed)
-    state_set_ = getModel()->getFailedActionSet();
+    state_set_ = get_model()->getFailedActionSet();
   else
-    state_set_ = getModel()->getRunningActionSet();
+    state_set_ = get_model()->getRunningActionSet();
 
   state_set_->push_back(*this);
 }
@@ -39,6 +39,7 @@ void Action::finish(Action::State state)
 {
   finish_time_ = surf_get_clock();
   set_state(state);
+  set_remains(0);
 }
 
 Action::State Action::get_state() const
@@ -87,14 +88,14 @@ void Action::set_bound(double bound)
 {
   XBT_IN("(%p,%g)", this, bound);
   if (variable_)
-    getModel()->getMaxminSystem()->update_variable_bound(variable_, bound);
+    get_model()->getMaxminSystem()->update_variable_bound(variable_, bound);
 
-  if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate() != surf_get_clock())
-    heapRemove(getModel()->getActionHeap());
+  if (get_model()->getUpdateMechanism() == UM_LAZY && getLastUpdate() != surf_get_clock())
+    heapRemove(get_model()->getActionHeap());
   XBT_OUT();
 }
 
-void Action::setCategory(const char* category)
+void Action::set_category(const char* category)
 {
   category_ = xbt_strdup(category);
 }
@@ -104,31 +105,31 @@ void Action::ref()
   refcount_++;
 }
 
-void Action::setMaxDuration(double duration)
+void Action::set_max_duration(double duration)
 {
   max_duration_ = duration;
-  if (getModel()->getUpdateMechanism() == UM_LAZY) // remove action from the heap
-    heapRemove(getModel()->getActionHeap());
+  if (get_model()->getUpdateMechanism() == UM_LAZY) // remove action from the heap
+    heapRemove(get_model()->getActionHeap());
 }
 
-void Action::setSharingWeight(double weight)
+void Action::set_priority(double weight)
 {
   XBT_IN("(%p,%g)", this, weight);
-  sharing_weight_ = weight;
-  getModel()->getMaxminSystem()->update_variable_weight(getVariable(), weight);
+  sharing_priority_ = weight;
+  get_model()->getMaxminSystem()->update_variable_weight(getVariable(), weight);
 
-  if (getModel()->getUpdateMechanism() == UM_LAZY)
-    heapRemove(getModel()->getActionHeap());
+  if (get_model()->getUpdateMechanism() == UM_LAZY)
+    heapRemove(get_model()->getActionHeap());
   XBT_OUT();
 }
 
 void Action::cancel()
 {
   set_state(Action::State::failed);
-  if (getModel()->getUpdateMechanism() == UM_LAZY) {
+  if (get_model()->getUpdateMechanism() == UM_LAZY) {
     if (modified_set_hook_.is_linked())
-      simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
-    heapRemove(getModel()->getActionHeap());
+      simgrid::xbt::intrusive_erase(*get_model()->getModifiedSet(), *this);
+    heapRemove(get_model()->getActionHeap());
   }
 }
 
@@ -139,12 +140,12 @@ int Action::unref()
     if (state_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(*state_set_, *this);
     if (getVariable())
-      getModel()->getMaxminSystem()->variable_free(getVariable());
-    if (getModel()->getUpdateMechanism() == UM_LAZY) {
+      get_model()->getMaxminSystem()->variable_free(getVariable());
+    if (get_model()->getUpdateMechanism() == UM_LAZY) {
       /* remove from heap */
-      heapRemove(getModel()->getActionHeap());
+      heapRemove(get_model()->getActionHeap());
       if (modified_set_hook_.is_linked())
-        simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
+        simgrid::xbt::intrusive_erase(*get_model()->getModifiedSet(), *this);
     }
     delete this;
     return 1;
@@ -156,11 +157,11 @@ void Action::suspend()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != SuspendStates::sleeping) {
-    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
-    if (getModel()->getUpdateMechanism() == UM_LAZY) {
-      heapRemove(getModel()->getActionHeap());
-      if (getModel()->getUpdateMechanism() == UM_LAZY && state_set_ == getModel()->getRunningActionSet() &&
-          sharing_weight_ > 0) {
+    get_model()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
+    if (get_model()->getUpdateMechanism() == UM_LAZY) {
+      heapRemove(get_model()->getActionHeap());
+      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());
       }
@@ -174,10 +175,10 @@ void Action::resume()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != SuspendStates::sleeping) {
-    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), getPriority());
+    get_model()->getMaxminSystem()->update_variable_weight(getVariable(), get_priority());
     suspended_ = SuspendStates::not_suspended;
-    if (getModel()->getUpdateMechanism() == UM_LAZY)
-      heapRemove(getModel()->getActionHeap());
+    if (get_model()->getUpdateMechanism() == UM_LAZY)
+      heapRemove(get_model()->getActionHeap());
   }
   XBT_OUT();
 }
@@ -218,21 +219,21 @@ void Action::heapUpdate(heap_type& heap, double key, Action::Type hat)
   }
 }
 
-double Action::getRemains()
+double Action::get_remains()
 {
   XBT_IN("(%p)", this);
   /* update remains before return it */
-  if (getModel()->getUpdateMechanism() == UM_LAZY) /* update remains before return it */
+  if (get_model()->getUpdateMechanism() == UM_LAZY) /* update remains before return it */
     updateRemainingLazy(surf_get_clock());
   XBT_OUT();
   return remains_;
 }
 
-void Action::updateMaxDuration(double delta)
+void Action::update_max_duration(double delta)
 {
   double_update(&max_duration_, delta, sg_surf_precision);
 }
-void Action::updateRemains(double delta)
+void Action::update_remains(double delta)
 {
   double_update(&remains_, delta, sg_maxmin_precision * sg_surf_precision);
 }
index 4252b66..77560d6 100644 (file)
@@ -58,11 +58,11 @@ double Model::nextOccuringEventLazy(double now)
     maxmin_system_->modified_set_->pop_front();
     bool max_dur_flag = false;
 
-    if (action->getStateSet() != running_action_set_)
+    if (action->get_state_set() != running_action_set_)
       continue;
 
     /* bogus priority, skip it */
-    if (action->getPriority() <= 0 || action->getType() == Action::Type::LATENCY)
+    if (action->get_priority() <= 0 || action->getType() == Action::Type::LATENCY)
       continue;
 
     action->updateRemainingLazy(now);
@@ -72,25 +72,25 @@ double Model::nextOccuringEventLazy(double now)
 
     if (share > 0) {
       double time_to_completion;
-      if (action->getRemains() > 0) {
-        time_to_completion = action->getRemainsNoUpdate() / share;
+      if (action->get_remains() > 0) {
+        time_to_completion = action->get_remains_no_update() / share;
       } else {
         time_to_completion = 0.0;
       }
       min = now + time_to_completion; // when the task will complete if nothing changes
     }
 
-    if ((action->getMaxDuration() > NO_MAX_DURATION) &&
-        (min <= -1 || action->get_start_time() + action->getMaxDuration() < min)) {
+    if ((action->get_max_duration() > NO_MAX_DURATION) &&
+        (min <= -1 || action->get_start_time() + action->get_max_duration() < min)) {
       // when the task will complete anyway because of the deadline if any
-      min          = action->get_start_time() + action->getMaxDuration();
+      min          = action->get_start_time() + action->get_max_duration();
       max_dur_flag = true;
     }
 
     XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->getVariable()->id_int);
 
     XBT_DEBUG("Action(%p) Start %f. May finish at %f (got a share of %f). Max_duration %f", action,
-              action->get_start_time(), min, share, action->getMaxDuration());
+              action->get_start_time(), min, share, action->get_max_duration());
 
     if (min > -1) {
       action->heapUpdate(action_heap_, min, max_dur_flag ? Action::Type::MAX_DURATION : Action::Type::NORMAL);
@@ -119,8 +119,8 @@ double Model::nextOccuringEventFull(double /*now*/)
   for (Action& action : *getRunningActionSet()) {
     double value = action.getVariable()->get_value();
     if (value > 0) {
-      if (action.getRemains() > 0)
-        value = action.getRemainsNoUpdate() / value;
+      if (action.get_remains() > 0)
+        value = action.get_remains_no_update() / value;
       else
         value = 0.0;
       if (min < 0 || value < min) {
@@ -128,8 +128,8 @@ double Model::nextOccuringEventFull(double /*now*/)
         XBT_DEBUG("Updating min (value) with %p: %f", &action, min);
       }
     }
-    if ((action.getMaxDuration() >= 0) && (min < 0 || action.getMaxDuration() < min)) {
-      min = action.getMaxDuration();
+    if ((action.get_max_duration() >= 0) && (min < 0 || action.get_max_duration() < min)) {
+      min = action.get_max_duration();
       XBT_DEBUG("Updating min (duration) with %p: %f", &action, min);
     }
   }
index 7530cd2..da17d4a 100644 (file)
@@ -259,8 +259,8 @@ void VirtualMachineImpl::setPm(s4u::Host* destination)
   surf::CpuAction* new_cpu_action =
       static_cast<surf::CpuAction*>(destination->pimpl_cpu->execution_start(0, this->coreAmount_));
 
-  if (action_->getRemainsNoUpdate() > 0)
-    XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
+  if (action_->get_remains_no_update() > 0)
+    XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->get_remains_no_update());
 
   /* keep the bound value of the cpu action of the VM. */
   double old_bound = action_->get_bound();
index 9f8900e..dcc5b11 100644 (file)
@@ -435,7 +435,7 @@ double SD_task_get_alpha(SD_task_t task)
 double SD_task_get_remaining_amount(SD_task_t task)
 {
   if (task->surf_action)
-    return task->surf_action->getRemains();
+    return task->surf_action->get_remains();
   else
     return (task->state == SD_DONE) ? 0 : task->amount;
 }
index 2a3adc8..14f60e6 100644 (file)
@@ -138,7 +138,7 @@ void simcall_execution_set_priority(smx_activity_t execution, double priority)
     simgrid::kernel::activity::ExecImplPtr exec =
         boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
     if (exec->surfAction_)
-      exec->surfAction_->setSharingWeight(priority);
+      exec->surfAction_->set_priority(priority);
   });
 }
 
index a6455ee..b6f81fd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -148,7 +148,7 @@ SIMIX_execution_start(const char* name, double flops_amount, double priority, do
 
     exec->surfAction_ = host->pimpl_cpu->execution_start(flops_amount);
     exec->surfAction_->set_data(exec.get());
-    exec->surfAction_->setSharingWeight(priority);
+    exec->surfAction_->set_priority(priority);
 
     if (bound > 0)
       static_cast<simgrid::surf::CpuAction*>(exec->surfAction_)->set_bound(bound);
@@ -280,13 +280,13 @@ void SIMIX_set_category(smx_activity_t synchro, const char *category)
   simgrid::kernel::activity::ExecImplPtr exec =
       boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
   if (exec != nullptr) {
-    exec->surfAction_->setCategory(category);
+    exec->surfAction_->set_category(category);
     return;
   }
 
   simgrid::kernel::activity::CommImplPtr comm =
       boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
   if (comm != nullptr) {
-    comm->surfAction_->setCategory(category);
+    comm->surfAction_->set_category(category);
   }
 }
index 6edf250..889b934 100644 (file)
@@ -36,9 +36,9 @@ void HostModel::ignoreEmptyVmInPmLMM()
 
     XBT_DEBUG("set the weight of the dummy CPU action of VM%p on PM to %d (#tasks: %d)", ws_vm, impact, active_tasks);
     if (impact > 0)
-      ws_vm->getImpl()->action_->setSharingWeight(1. / impact);
+      ws_vm->getImpl()->action_->set_priority(1. / impact);
     else
-      ws_vm->getImpl()->action_->setSharingWeight(0.);
+      ws_vm->getImpl()->action_->set_priority(0.);
   }
 }
 
index 74e8263..de1baf8 100644 (file)
@@ -139,7 +139,7 @@ void CpuCas01::apply_event(tmgr_trace_event_t event, double value)
         if (action->get_state() == kernel::resource::Action::State::running ||
             action->get_state() == kernel::resource::Action::State::ready ||
             action->get_state() == kernel::resource::Action::State::not_in_the_system) {
-          action->setFinishTime(date);
+          action->set_finish_time(date);
           action->set_state(kernel::resource::Action::State::failed);
         }
       }
@@ -171,13 +171,13 @@ CpuAction *CpuCas01::sleep(double duration)
   CpuCas01Action* action = new CpuCas01Action(model(), 1.0, isOff(), speed_.scale * speed_.peak, constraint());
 
   // FIXME: sleep variables should not consume 1.0 in System::expand()
-  action->setMaxDuration(duration);
+  action->set_max_duration(duration);
   action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
   if (duration < 0) { // NO_MAX_DURATION
     /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
-    simgrid::xbt::intrusive_erase(*action->getStateSet(), *action);
+    simgrid::xbt::intrusive_erase(*action->get_state_set(), *action);
     action->state_set_ = &static_cast<CpuCas01Model*>(model())->cpuRunningActionSetThatDoesNotNeedBeingChecked_;
-    action->getStateSet()->push_back(*action);
+    action->get_state_set()->push_back(*action);
   }
 
   model()->getMaxminSystem()->update_variable_weight(action->getVariable(), 0.0);
index d5ffeef..d854732 100644 (file)
@@ -28,7 +28,7 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
     if (TRACE_is_enabled()) {
       Cpu* cpu = static_cast<Cpu*>(action->getVariable()->get_constraint(0)->get_id());
-      TRACE_surf_host_set_utilization(cpu->getCname(), action->getCategory(), action->getVariable()->get_value(),
+      TRACE_surf_host_set_utilization(cpu->getCname(), action->get_category(), action->getVariable()->get_value(),
                                       action->getLastUpdate(), now - action->getLastUpdate());
     }
 
@@ -36,7 +36,7 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
     XBT_CDEBUG(surf_kernel, "Action %p finished", action);
 
     /* set the remains to 0 due to precision problems when updating the remaining amount */
-    action->setRemains(0);
+    action->set_remains(0);
   }
   if (TRACE_is_enabled()) {
     //defining the last timestamp that we can safely dump to trace file
@@ -59,18 +59,18 @@ void CpuModel::updateActionsStateFull(double now, double delta)
     ++it; // increment iterator here since the following calls to action.finish() may invalidate it
     if (TRACE_is_enabled()) {
       Cpu* cpu = static_cast<Cpu*>(action.getVariable()->get_constraint(0)->get_id());
-      TRACE_surf_host_set_utilization(cpu->getCname(), action.getCategory(), action.getVariable()->get_value(),
+      TRACE_surf_host_set_utilization(cpu->getCname(), action.get_category(), action.getVariable()->get_value(),
                                       now - delta, delta);
       TRACE_last_timestamp_to_dump = now - delta;
     }
 
-    action.updateRemains(action.getVariable()->get_value() * delta);
+    action.update_remains(action.getVariable()->get_value() * delta);
 
-    if (action.getMaxDuration() != NO_MAX_DURATION)
-      action.updateMaxDuration(delta);
+    if (action.get_max_duration() != NO_MAX_DURATION)
+      action.update_max_duration(delta);
 
-    if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) ||
-        ((action.getMaxDuration() != NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+    if (((action.get_remains_no_update() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(kernel::resource::Action::State::done);
     }
   }
@@ -175,22 +175,22 @@ void Cpu::setSpeedTrace(tmgr_trace_t trace)
 
 void CpuAction::updateRemainingLazy(double now)
 {
-  xbt_assert(getStateSet() == getModel()->getRunningActionSet(), "You're updating an action that is not running.");
-  xbt_assert(getPriority() > 0, "You're updating an action that seems suspended.");
+  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.");
 
   double delta = now - getLastUpdate();
 
-  if (getRemainsNoUpdate() > 0) {
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, getRemainsNoUpdate(),
+  if (get_remains_no_update() > 0) {
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
                getLastUpdate());
-    updateRemains(getLastValue() * delta);
+    update_remains(getLastValue() * delta);
 
     if (TRACE_is_enabled()) {
       Cpu* cpu = static_cast<Cpu*>(getVariable()->get_constraint(0)->get_id());
-      TRACE_surf_host_set_utilization(cpu->getCname(), getCategory(), getLastValue(), getLastUpdate(),
+      TRACE_surf_host_set_utilization(cpu->getCname(), get_category(), getLastValue(), getLastUpdate(),
                                       now - getLastUpdate());
     }
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, getRemainsNoUpdate());
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, get_remains_no_update());
   }
 
   refreshLastUpdate();
index d285431..6cf864c 100644 (file)
@@ -363,7 +363,7 @@ void CpuTiModel::updateActionsState(double now, double /*delta*/)
     XBT_DEBUG("Action %p: finish", action);
     action->finish(kernel::resource::Action::State::done);
     /* set the remains to 0 due to precision problems when updating the remaining amount */
-    action->setRemains(0);
+    action->set_remains(0);
     /* update remaining amount of all actions */
     action->cpu_->updateRemainingAmount(surf_get_clock());
   }
@@ -442,7 +442,7 @@ void CpuTi::apply_event(tmgr_trace_event_t event, double value)
         if (action.get_state() == kernel::resource::Action::State::running ||
             action.get_state() == kernel::resource::Action::State::ready ||
             action.get_state() == kernel::resource::Action::State::not_in_the_system) {
-          action.setFinishTime(date);
+          action.set_finish_time(date);
           action.set_state(kernel::resource::Action::State::failed);
           action.heapRemove(model()->getActionHeap());
         }
@@ -465,45 +465,45 @@ void CpuTi::updateActionsFinishTime(double now)
 
   for (CpuTiAction const& action : actionSet_) {
     /* action not running, skip it */
-    if (action.getStateSet() != surf_cpu_model_pm->getRunningActionSet())
+    if (action.get_state_set() != surf_cpu_model_pm->getRunningActionSet())
       continue;
 
     /* bogus priority, skip it */
-    if (action.getPriority() <= 0)
+    if (action.get_priority() <= 0)
       continue;
 
     /* action suspended, skip it */
     if (action.suspended_ != kernel::resource::Action::SuspendStates::not_suspended)
       continue;
 
-    sum_priority += 1.0 / action.getPriority();
+    sum_priority += 1.0 / action.get_priority();
   }
   sumPriority_ = sum_priority;
 
   for (CpuTiAction& action : actionSet_) {
     double min_finish = -1;
     /* action not running, skip it */
-    if (action.getStateSet() != surf_cpu_model_pm->getRunningActionSet())
+    if (action.get_state_set() != surf_cpu_model_pm->getRunningActionSet())
       continue;
 
     /* verify if the action is really running on cpu */
-    if (action.suspended_ == kernel::resource::Action::SuspendStates::not_suspended && action.getPriority() > 0) {
+    if (action.suspended_ == kernel::resource::Action::SuspendStates::not_suspended && action.get_priority() > 0) {
       /* total area needed to finish the action. Used in trace integration */
-      total_area = (action.getRemains()) * sum_priority * action.getPriority();
+      total_area = (action.get_remains()) * sum_priority * action.get_priority();
 
       total_area /= speed_.peak;
 
-      action.setFinishTime(speedIntegratedTrace_->solve(now, total_area));
+      action.set_finish_time(speedIntegratedTrace_->solve(now, total_area));
       /* verify which event will happen before (max_duration or finish time) */
-      if (action.getMaxDuration() > NO_MAX_DURATION &&
-          action.get_start_time() + action.getMaxDuration() < action.getFinishTime())
-        min_finish = action.get_start_time() + action.getMaxDuration();
+      if (action.get_max_duration() > NO_MAX_DURATION &&
+          action.get_start_time() + action.get_max_duration() < action.getFinishTime())
+        min_finish = action.get_start_time() + action.get_max_duration();
       else
         min_finish = action.getFinishTime();
     } else {
       /* put the max duration time on heap */
-      if (action.getMaxDuration() > NO_MAX_DURATION)
-        min_finish = action.get_start_time() + action.getMaxDuration();
+      if (action.get_max_duration() > NO_MAX_DURATION)
+        min_finish = action.get_start_time() + action.get_max_duration();
     }
     /* add in action heap */
     if (min_finish > NO_MAX_DURATION)
@@ -512,7 +512,7 @@ void CpuTi::updateActionsFinishTime(double now)
       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.getMaxDuration());
+              &action, action.get_start_time(), action.getFinishTime(), action.get_max_duration());
   }
   /* remove from modified cpu */
   modified(false);
@@ -542,11 +542,11 @@ void CpuTi::updateRemainingAmount(double now)
   XBT_DEBUG("Flops total: %f, Last update %f", area_total, lastUpdate_);
   for (CpuTiAction& action : actionSet_) {
     /* action not running, skip it */
-    if (action.getStateSet() != model()->getRunningActionSet())
+    if (action.get_state_set() != model()->getRunningActionSet())
       continue;
 
     /* bogus priority, skip it */
-    if (action.getPriority() <= 0)
+    if (action.get_priority() <= 0)
       continue;
 
     /* action suspended, skip it */
@@ -562,8 +562,8 @@ void CpuTi::updateRemainingAmount(double now)
       continue;
 
     /* update remaining */
-    action.updateRemains(area_total / (sumPriority_ * action.getPriority()));
-    XBT_DEBUG("Update remaining action(%p) remaining %f", &action, action.getRemainsNoUpdate());
+    action.update_remains(area_total / (sumPriority_ * action.get_priority()));
+    XBT_DEBUG("Update remaining action(%p) remaining %f", &action, action.get_remains_no_update());
   }
   lastUpdate_ = now;
 }
@@ -588,13 +588,13 @@ CpuAction *CpuTi::sleep(double duration)
   XBT_IN("(%s,%g)", getCname(), duration);
   CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), 1.0, isOff(), this);
 
-  action->setMaxDuration(duration);
+  action->set_max_duration(duration);
   action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
   if (duration == NO_MAX_DURATION) {
     /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
-    simgrid::xbt::intrusive_erase(*action->getStateSet(), *action);
+    simgrid::xbt::intrusive_erase(*action->get_state_set(), *action);
     action->state_set_ = &static_cast<CpuTiModel*>(model())->runningActionSetThatDoesNotNeedBeingChecked_;
-    action->getStateSet()->push_back(*action);
+    action->get_state_set()->push_back(*action);
   }
 
   actionSet_.push_back(*action);
@@ -637,12 +637,12 @@ int CpuTiAction::unref()
   refcount_--;
   if (not refcount_) {
     if (state_set_hook_.is_linked())
-      simgrid::xbt::intrusive_erase(*getStateSet(), *this);
+      simgrid::xbt::intrusive_erase(*get_state_set(), *this);
     /* remove from action_set */
     if (action_ti_hook.is_linked())
       simgrid::xbt::intrusive_erase(cpu_->actionSet_, *this);
     /* remove from heap */
-    heapRemove(getModel()->getActionHeap());
+    heapRemove(get_model()->getActionHeap());
     cpu_->modified(true);
     delete this;
     return 1;
@@ -653,7 +653,7 @@ int CpuTiAction::unref()
 void CpuTiAction::cancel()
 {
   this->set_state(Action::State::failed);
-  heapRemove(getModel()->getActionHeap());
+  heapRemove(get_model()->getActionHeap());
   cpu_->modified(true);
 }
 
@@ -662,7 +662,7 @@ void CpuTiAction::suspend()
   XBT_IN("(%p)", this);
   if (suspended_ != Action::SuspendStates::sleeping) {
     suspended_ = Action::SuspendStates::suspended;
-    heapRemove(getModel()->getActionHeap());
+    heapRemove(get_model()->getActionHeap());
     cpu_->modified(true);
   }
   XBT_OUT();
@@ -678,40 +678,40 @@ void CpuTiAction::resume()
   XBT_OUT();
 }
 
-void CpuTiAction::setMaxDuration(double duration)
+void CpuTiAction::set_max_duration(double duration)
 {
   double min_finish;
 
   XBT_IN("(%p,%g)", this, duration);
 
-  Action::setMaxDuration(duration);
+  Action::set_max_duration(duration);
 
   if (duration >= 0)
-    min_finish = (get_start_time() + getMaxDuration()) < getFinishTime() ? (get_start_time() + getMaxDuration())
-                                                                         : getFinishTime();
+    min_finish = (get_start_time() + get_max_duration()) < getFinishTime() ? (get_start_time() + get_max_duration())
+                                                                           : getFinishTime();
   else
     min_finish = getFinishTime();
 
   /* add in action heap */
-  heapUpdate(getModel()->getActionHeap(), min_finish, Action::Type::NOTSET);
+  heapUpdate(get_model()->getActionHeap(), min_finish, Action::Type::NOTSET);
 
   XBT_OUT();
 }
 
-void CpuTiAction::setSharingWeight(double priority)
+void CpuTiAction::set_priority(double priority)
 {
   XBT_IN("(%p,%g)", this, priority);
-  setSharingWeightNoUpdate(priority);
+  set_priority_no_update(priority);
   cpu_->modified(true);
   XBT_OUT();
 }
 
-double CpuTiAction::getRemains()
+double CpuTiAction::get_remains()
 {
   XBT_IN("(%p)", this);
   cpu_->updateRemainingAmount(surf_get_clock());
   XBT_OUT();
-  return getRemainsNoUpdate();
+  return get_remains_no_update();
 }
 
 }
index 7b5d3bc..ec4806d 100644 (file)
@@ -89,9 +89,9 @@ public:
   void cancel() override;
   void suspend() override;
   void resume() override;
-  void setMaxDuration(double duration) override;
-  void setSharingWeight(double priority) override;
-  double getRemains() override;
+  void set_max_duration(double duration) override;
+  void set_priority(double priority) override;
+  double get_remains() override;
 
   CpuTi *cpu_;
 
index 133893e..b5af233 100644 (file)
@@ -182,7 +182,7 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
         kernel::lmm::Constraint* constraint = action->getVariable()->get_constraint(i);
         NetworkCm02Link* link       = static_cast<NetworkCm02Link*>(constraint->get_id());
         double value = action->getVariable()->get_value() * action->getVariable()->get_constraint_weight(i);
-        TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), value, action->getLastUpdate(),
+        TRACE_surf_link_set_utilization(link->getCname(), action->get_category(), value, action->getLastUpdate(),
                                         now - action->getLastUpdate());
       }
     }
@@ -200,7 +200,7 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
       // no need to communicate anymore
       // assume that flows that reached max_duration have remaining of 0
       XBT_DEBUG("Action %p finished", action);
-      action->setRemains(0);
+      action->set_remains(0);
       action->finish(kernel::resource::Action::State::done);
       action->heapRemove(getActionHeap());
     }
@@ -232,7 +232,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
         kernel::lmm::Constraint* constraint = action.getVariable()->get_constraint(i);
         NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
         TRACE_surf_link_set_utilization(
-            link->getCname(), action.getCategory(),
+            link->getCname(), action.get_category(),
             (action.getVariable()->get_value() * action.getVariable()->get_constraint_weight(i)),
             action.getLastUpdate(), now - action.getLastUpdate());
       }
@@ -241,15 +241,15 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
       /* There is actually no link used, hence an infinite bandwidth. This happens often when using models like
        * vivaldi. In such case, just make sure that the action completes immediately.
        */
-      action.updateRemains(action.getRemains());
+      action.update_remains(action.get_remains());
     }
-    action.updateRemains(action.getVariable()->get_value() * delta);
+    action.update_remains(action.getVariable()->get_value() * delta);
 
-    if (action.getMaxDuration() > NO_MAX_DURATION)
-      action.updateMaxDuration(delta);
+    if (action.get_max_duration() > NO_MAX_DURATION)
+      action.update_max_duration(delta);
 
-    if (((action.getRemains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
-        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+    if (((action.get_remains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(kernel::resource::Action::State::done);
     }
   }
@@ -389,7 +389,7 @@ void NetworkCm02Link::apply_event(tmgr_trace_event_t triggered, double value)
 
         if (action->get_state() == kernel::resource::Action::State::running ||
             action->get_state() == kernel::resource::Action::State::ready) {
-          action->setFinishTime(now);
+          action->set_finish_time(now);
           action->set_state(kernel::resource::Action::State::failed);
         }
       }
@@ -468,24 +468,25 @@ void NetworkCm02Action::updateRemainingLazy(double now)
     return;
 
   double delta        = now - getLastUpdate();
-  double max_duration = getMaxDuration();
+  double max_duration = get_max_duration();
 
-  if (getRemainsNoUpdate() > 0) {
-    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, getRemainsNoUpdate(), getLastUpdate());
-    updateRemains(getLastValue() * delta);
+  if (get_remains_no_update() > 0) {
+    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
+              getLastUpdate());
+    update_remains(getLastValue() * delta);
 
-    XBT_DEBUG("Updating action(%p): remains is now %f", this, getRemainsNoUpdate());
+    XBT_DEBUG("Updating action(%p): remains is now %f", this, get_remains_no_update());
   }
 
   if (max_duration > NO_MAX_DURATION) {
     double_update(&max_duration, delta, sg_surf_precision);
-    setMaxDuration(max_duration);
+    set_max_duration(max_duration);
   }
 
-  if ((getRemainsNoUpdate() <= 0 && (getVariable()->get_weight() > 0)) ||
+  if ((get_remains_no_update() <= 0 && (getVariable()->get_weight() > 0)) ||
       ((max_duration > NO_MAX_DURATION) && (max_duration <= 0))) {
     finish(Action::State::done);
-    heapRemove(getModel()->getActionHeap());
+    heapRemove(get_model()->getActionHeap());
   }
 
   refreshLastUpdate();
index 0b3016a..d9a7e31 100644 (file)
@@ -52,12 +52,12 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
         action.latency_ = 0.0;
       }
     }
-    action.updateRemains(action.getCost() * delta / action.initialLatency_);
-    if (action.getMaxDuration() != NO_MAX_DURATION)
-      action.updateMaxDuration(delta);
+    action.update_remains(action.get_cost() * delta / action.initialLatency_);
+    if (action.get_max_duration() != NO_MAX_DURATION)
+      action.update_max_duration(delta);
 
-    if ((action.getRemainsNoUpdate() <= 0) ||
-        ((action.getMaxDuration() != NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+    if ((action.get_remains_no_update() <= 0) ||
+        ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(kernel::resource::Action::State::done);
     }
   }
index 1b3d772..c42e0e1 100644 (file)
@@ -221,7 +221,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
     SgFlow* sgFlow            = elm.second;
     NetworkNS3Action * action = sgFlow->action_;
     XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
-    action->setRemains(action->getCost() - sgFlow->sentBytes_);
+    action->set_remains(action->get_cost() - sgFlow->sentBytes_);
 
     if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::running) {
       double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_;
@@ -230,8 +230,8 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 
       action->src_->routeTo(action->dst_, route, nullptr);
       for (auto const& link : route)
-        TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), (data_delta_sent) / delta, now - delta,
-                                        delta);
+        TRACE_surf_link_set_utilization(link->getCname(), action->get_category(), (data_delta_sent) / delta,
+                                        now - delta, delta);
 
       action->lastSent_ = sgFlow->sentBytes_;
     }
index 9b160b6..a613ff3 100644 (file)
@@ -98,14 +98,14 @@ void HostL07Model::updateActionsState(double /*now*/, double delta)
         maxmin_system_->update_variable_weight(action.getVariable(), 1.0);
       }
     }
-    XBT_DEBUG("Action (%p) : remains (%g) updated by %g.", &action, action.getRemains(),
+    XBT_DEBUG("Action (%p) : remains (%g) updated by %g.", &action, action.get_remains(),
               action.getVariable()->get_value() * delta);
-    action.updateRemains(action.getVariable()->get_value() * delta);
+    action.update_remains(action.getVariable()->get_value() * delta);
 
-    if (action.getMaxDuration() > NO_MAX_DURATION)
-      action.updateMaxDuration(delta);
+    if (action.get_max_duration() > NO_MAX_DURATION)
+      action.update_max_duration(delta);
 
-    XBT_DEBUG("Action (%p) : remains (%g).", &action, action.getRemains());
+    XBT_DEBUG("Action (%p) : remains (%g).", &action, action.get_remains());
 
     /* In the next if cascade, the action can be finished either because:
      *  - The amount of remaining work reached 0
@@ -113,8 +113,8 @@ void HostL07Model::updateActionsState(double /*now*/, double delta)
      * If it's not done, it may have failed.
      */
 
-    if (((action.getRemains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
-        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+    if (((action.get_remains() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(kernel::resource::Action::State::done);
     } else {
       /* Need to check that none of the model has failed */
@@ -205,8 +205,8 @@ L07Action::L07Action(kernel::resource::Model* model, int host_nb, sg_host_t* hos
   }
 
   if (nb_link + nb_used_host == 0) {
-    this->setCost(1.0);
-    this->setRemains(0.0);
+    this->set_cost(1.0);
+    this->set_remains(0.0);
   }
   delete[] host_list;
 }
@@ -273,7 +273,7 @@ kernel::resource::Action* CpuL07::execution_start(double size)
 kernel::resource::Action* CpuL07::sleep(double duration)
 {
   L07Action *action = static_cast<L07Action*>(execution_start(1.0));
-  action->setMaxDuration(duration);
+  action->set_max_duration(duration);
   action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
   model()->getMaxminSystem()->update_variable_weight(action->getVariable(), 0.0);
 
@@ -401,9 +401,9 @@ void L07Action::updateBound()
   XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
   if ((latency_ <= 0.0) && (suspended_ == Action::SuspendStates::not_suspended)) {
     if (rate_ < 0)
-      getModel()->getMaxminSystem()->update_variable_bound(getVariable(), lat_bound);
+      get_model()->getMaxminSystem()->update_variable_bound(getVariable(), lat_bound);
     else
-      getModel()->getMaxminSystem()->update_variable_bound(getVariable(), std::min(rate_, lat_bound));
+      get_model()->getMaxminSystem()->update_variable_bound(getVariable(), std::min(rate_, lat_bound));
   }
 }
 
@@ -414,7 +414,7 @@ int L07Action::unref()
     if (state_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(*state_set_, *this);
     if (getVariable())
-      getModel()->getMaxminSystem()->variable_free(getVariable());
+      get_model()->getMaxminSystem()->variable_free(getVariable());
     delete this;
     return 1;
   }
index 1dcce83..647e2b7 100644 (file)
@@ -80,13 +80,13 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
   for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
     StorageAction& action = static_cast<StorageAction&>(*it);
     ++it; // increment iterator here since the following calls to action.finish() may invalidate it
-    action.updateRemains(lrint(action.getVariable()->get_value() * delta));
+    action.update_remains(lrint(action.getVariable()->get_value() * delta));
 
-    if (action.getMaxDuration() > NO_MAX_DURATION)
-      action.updateMaxDuration(delta);
+    if (action.get_max_duration() > NO_MAX_DURATION)
+      action.update_max_duration(delta);
 
-    if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) ||
-        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+    if (((action.get_remains_no_update() <= 0) && (action.getVariable()->get_weight() > 0)) ||
+        ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(kernel::resource::Action::State::done);
     }
   }
@@ -146,8 +146,8 @@ int StorageN11Action::unref()
     if (state_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(*state_set_, *this);
     if (getVariable())
-      getModel()->getMaxminSystem()->variable_free(getVariable());
-    xbt_free(getCategory());
+      get_model()->getMaxminSystem()->variable_free(getVariable());
+    xbt_free(get_category());
     delete this;
     return 1;
   }
@@ -163,7 +163,7 @@ void StorageN11Action::suspend()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != Action::SuspendStates::sleeping) {
-    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
+    get_model()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
     suspended_ = Action::SuspendStates::suspended;
   }
   XBT_OUT();
@@ -179,12 +179,12 @@ bool StorageN11Action::isSuspended()
   return suspended_ == Action::SuspendStates::suspended;
 }
 
-void StorageN11Action::setMaxDuration(double /*duration*/)
+void StorageN11Action::set_max_duration(double /*duration*/)
 {
   THROW_UNIMPLEMENTED;
 }
 
-void StorageN11Action::setSharingWeight(double /*priority*/)
+void StorageN11Action::set_priority(double /*priority*/)
 {
   THROW_UNIMPLEMENTED;
 }
index 09ddf63..2df40f3 100644 (file)
@@ -59,8 +59,8 @@ public:
   void cancel() override;
   void resume() override;
   bool isSuspended() override;
-  void setMaxDuration(double duration) override;
-  void setSharingWeight(double priority) override;
+  void set_max_duration(double duration) override;
+  void set_priority(double priority) override;
   void updateRemainingLazy(double now) override;
 };
 
index 37fc127..aca6551 100644 (file)
@@ -1,6 +1,6 @@
 /* A few basic tests for the surf library                                   */
 
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */