Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into fix/execute_benched
[simgrid.git] / src / surf / surf_interface.cpp
index 999fca9..cb5ed0e 100644 (file)
@@ -416,7 +416,7 @@ double Model::nextOccuringEventLazy(double now)
     action->updateRemainingLazy(now);
 
     double min = -1;
-    double share = lmm_variable_getvalue(action->getVariable());
+    double share = action->getVariable()->get_value();
 
     if (share > 0) {
       double time_to_completion;
@@ -464,22 +464,21 @@ double Model::nextOccuringEventFull(double /*now*/) {
 
   double min = -1;
 
-  for (auto it(getRunningActionSet()->begin()); it != getRunningActionSet()->end(); ++it) {
-    Action *action = &*it;
-    double value = lmm_variable_getvalue(action->getVariable());
+  for (Action& action : *getRunningActionSet()) {
+    double value = action.getVariable()->get_value();
     if (value > 0) {
-      if (action->getRemains() > 0)
-        value = action->getRemainsNoUpdate() / value;
+      if (action.getRemains() > 0)
+        value = action.getRemainsNoUpdate() / value;
       else
         value = 0.0;
       if (min < 0 || value < min) {
         min = value;
-        XBT_DEBUG("Updating min (value) with %p: %f", action, min);
+        XBT_DEBUG("Updating min (value) with %p: %f", &action, min);
       }
     }
-    if ((action->getMaxDuration() >= 0) && (min<0 || action->getMaxDuration() < min)) {
-      min = action->getMaxDuration();
-      XBT_DEBUG("Updating min (duration) with %p: %f", action, min);
+    if ((action.getMaxDuration() >= 0) && (min < 0 || action.getMaxDuration() < min)) {
+      min = action.getMaxDuration();
+      XBT_DEBUG("Updating min (duration) with %p: %f", &action, min);
     }
   }
   XBT_DEBUG("min value : %f", min);
@@ -647,14 +646,14 @@ void Action::setState(Action::State state)
 
 double Action::getBound() const
 {
-  return (variable_) ? lmm_variable_getbound(variable_) : 0;
+  return variable_ ? variable_->get_bound() : 0;
 }
 
 void Action::setBound(double bound)
 {
   XBT_IN("(%p,%g)", this, bound);
   if (variable_)
-    lmm_update_variable_bound(getModel()->getMaxminSystem(), variable_, bound);
+    getModel()->getMaxminSystem()->update_variable_bound(variable_, bound);
 
   if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate() != surf_get_clock())
     heapRemove(getModel()->getActionHeap());
@@ -681,7 +680,7 @@ void Action::setSharingWeight(double weight)
 {
   XBT_IN("(%p,%g)", this, weight);
   sharingWeight_ = weight;
-  lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), weight);
+  getModel()->getMaxminSystem()->update_variable_weight(getVariable(), weight);
 
   if (getModel()->getUpdateMechanism() == UM_LAZY)
     heapRemove(getModel()->getActionHeap());
@@ -703,7 +702,7 @@ int Action::unref(){
     if (action_hook.is_linked())
       stateSet_->erase(stateSet_->iterator_to(*this));
     if (getVariable())
-      lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
+      getModel()->getMaxminSystem()->variable_free(getVariable());
     if (getModel()->getUpdateMechanism() == UM_LAZY) {
       /* remove from heap */
       heapRemove(getModel()->getActionHeap());
@@ -720,7 +719,7 @@ void Action::suspend()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
-    lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 0.0);
+    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0);
     if (getModel()->getUpdateMechanism() == UM_LAZY){
       heapRemove(getModel()->getActionHeap());
       if (getModel()->getUpdateMechanism() == UM_LAZY && stateSet_ == getModel()->getRunningActionSet() &&
@@ -738,7 +737,7 @@ void Action::resume()
 {
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
-    lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), getPriority());
+    getModel()->getMaxminSystem()->update_variable_weight(getVariable(), getPriority());
     suspended_ = 0;
     if (getModel()->getUpdateMechanism() == UM_LAZY)
       heapRemove(getModel()->getActionHeap());