Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge maxmin_private.hpp into maxmin.hpp.
[simgrid.git] / src / surf / cpu_cas01.cpp
index c25b816..d25bf1f 100644 (file)
@@ -6,8 +6,8 @@
 
 #include "cpu_cas01.hpp"
 #include "cpu_ti.hpp"
-#include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
+#include "surf/maxmin.hpp"
 #include <algorithm>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu, "Logging specific to the SURF CPU IMPROVED module");
@@ -107,8 +107,8 @@ void CpuCas01::onSpeedChange() {
   lmm_element_t elem = nullptr;
 
   model()->getMaxminSystem()->update_constraint_bound(constraint(), coresAmount_ * speed_.scale * speed_.peak);
-  while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), constraint(), &elem))) {
-    CpuCas01Action* action = static_cast<CpuCas01Action*>(lmm_variable_id(var));
+  while ((var = constraint()->get_variable(&elem))) {
+    CpuCas01Action* action = static_cast<CpuCas01Action*>(var->get_id());
 
     model()->getMaxminSystem()->update_variable_bound(action->getVariable(),
                                                       action->requestedCore() * speed_.scale * speed_.peak);
@@ -143,8 +143,8 @@ void CpuCas01::apply_event(tmgr_trace_event_t event, double value)
 
       turnOff();
 
-      while ((var = lmm_get_var_from_cnst(model()->getMaxminSystem(), cnst, &elem))) {
-        Action *action = static_cast<Action*>(lmm_variable_id(var));
+      while ((var = cnst->get_variable(&elem))) {
+        Action* action = static_cast<Action*>(var->get_id());
 
         if (action->getState() == Action::State::running ||
             action->getState() == Action::State::ready ||