Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not load a private header from s/k/resource/ headers
[simgrid.git] / src / kernel / resource / Action.cpp
index fac7b4a..8559cca 100644 (file)
@@ -3,9 +3,10 @@
 /* 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. */
 
-#include "src/kernel/resource/Action.hpp"
+#include "simgrid/kernel/resource/Action.hpp"
+#include "simgrid/kernel/resource/Model.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
-#include "src/kernel/resource/Model.hpp"
+#include "src/surf/surf_interface.hpp"
 
 XBT_LOG_NEW_CATEGORY(kernel, "Logging specific to the internals of SimGrid");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(resource, kernel, "Logging specific to the resources");
@@ -227,6 +228,20 @@ double Action::getRemains()
   return remains_;
 }
 
+void Action::updateMaxDuration(double delta)
+{
+  double_update(&maxDuration_, delta, sg_surf_precision);
+}
+void Action::updateRemains(double delta)
+{
+  double_update(&remains_, delta, sg_maxmin_precision * sg_surf_precision);
+}
+
+void Action::refreshLastUpdate()
+{
+  lastUpdate_ = surf_get_clock();
+}
+
 } // namespace surf
 } // namespace simgrid
 } // namespace simgrid