X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/95a02a8febe84fd1c2ed98c78c594a5e8a0116f7..deaf4c6f1cb3026b053ca861fe77313c78385be7:/include/simgrid/kernel/resource/Action.hpp diff --git a/include/simgrid/kernel/resource/Action.hpp b/include/simgrid/kernel/resource/Action.hpp index 6154a6767c..d3b7a0497d 100644 --- a/include/simgrid/kernel/resource/Action.hpp +++ b/include/simgrid/kernel/resource/Action.hpp @@ -6,7 +6,14 @@ #ifndef SIMGRID_KERNEL_RESOURCE_ACTION_HPP #define SIMGRID_KERNEL_RESOURCE_ACTION_HPP -#include "src/surf/surf_interface.hpp" +#include +#include +#include + +#include +#include + +const int NO_MAX_DURATION = -1.0; namespace simgrid { namespace kernel { @@ -107,11 +114,11 @@ public: /** @brief Update the maximum duration of the current action * @param delta Amount to remove from the MaxDuration */ - void updateMaxDuration(double delta) { double_update(&maxDuration_, delta, sg_surf_precision); } + void updateMaxDuration(double delta); /** @brief Update the remaining time of the current action * @param delta Amount to remove from the remaining time */ - void updateRemains(double delta) { double_update(&remains_, delta, sg_maxmin_precision * sg_surf_precision); } + void updateRemains(double delta); /** @brief Set the remaining time of the current action */ void setRemains(double value) { remains_ = value; } @@ -188,7 +195,7 @@ private: boost::optional heapHandle_ = boost::none; public: - virtual void updateRemainingLazy(double now) { THROW_IMPOSSIBLE; }; + 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); @@ -196,7 +203,7 @@ public: kernel::lmm::Variable* getVariable() const { return variable_; } void setVariable(kernel::lmm::Variable* var) { variable_ = var; } double getLastUpdate() const { return lastUpdate_; } - void refreshLastUpdate() { lastUpdate_ = surf_get_clock(); } + void refreshLastUpdate(); double getLastValue() const { return lastValue_; } void setLastValue(double val) { lastValue_ = val; } Action::Type getType() const { return type_; }